I want to download a Jar that is on a closed (authentified) Nexus. I want to do this via Maven, to be technology agnostic (it can work with Nexus or Artifcatory for example).
I found this intersting plugin: https://maven.apache.org/plugins/maven-dependency-plugin/get-mojo.html, this works with an artifact that is on the central repository, or any "open" repository.
My command is:
mvn org.apache.maven.plugins:maven-dependency-plugin:2.4:get -Dartifact=com.test.job:job-template:1.0.0:jar:jar-with-dependencies -Ddest=/tmp/test.jar -DremoteRepositories=http://nexus.test.local/nexus/content/repositories/test-releases/
I get an error: "Not authorized , ReasonPhrase:Unauthorized". Of course, I have to be authentified to get this artifact. How can I give my credentials to this command? My Maven settings.xml already contains the credentials for this local repository, but the command does not read these credentials (seems logical).
Thanks!