maven command line how to point to a specific settings.xml for a single command?

guilhebl picture guilhebl · Aug 13, 2014 · Viewed 133.1k times · Source

Is it possible to point to a specific settings file in order to override the default settings.xml being used by maven for a single command? Example:

mvn clean install -Dparam # -> pass specific settings file path as param to override default "home/.m2/settings.xml"

Answer

khmarbaise picture khmarbaise · Aug 13, 2014

You can simply use:

mvn --settings YourOwnSettings.xml clean install

or

mvn -s YourOwnSettings.xml clean install