I have a java application that is in git repo RepoA and has a scm configuration set up for this repo for maven-release plugin etc. I want to fetch one file from another RepoB (it is fine to checkout the whole repo also because there is only 1 file there) and use it as a part of build step. How to do it with maven-scm plugin if scm section is already set up for RepoA?
Thanks.
You can use a separate maven profile for this task.
Here's profile part from
pom.xml, assuming that you want to fetch filefoo/bar.txtfrom github repogithub-user/some-repo:Then run
mvn scm:checkout -P checkout-foo-barPlugin first fetches all the files from repo and then removes ones that you don't need. This takes extra time, especially if the repo is huge.
I didn't find a way to setup output directory other than default
target/checkout. But hopefully this working example can be a good starting point to solve a problem.