Question

I would like to deploy my Maven build to an Artifactory repo. This repo requires authentication, but I would prefer not modifying my settings.xml file. Is there a way to provide the credentials at build time? I know that you can set properties in the POM with the -D switch:

mvn clean package -Dmy.prop=blah

Is there a way to do something similar to provide the contents of a <server> block in the settings.xml file?

Was it helpful?

Solution

You can use the Maven Artifactory plugin, which accepts credentials in pom file and use the -D as intended.

And, of course, you'll get the full build-info support :)

OTHER TIPS

You can prepare separate settings.xml file for build purpose and use this by -s options.

Eg.

mvn -s build_settings.xml clean deploy
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top