Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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"
like image 251
guilhebl Avatar asked Oct 03 '22 18:10

guilhebl


People also ask

How do you check which settings xml Maven is using?

mvn help:effective-settings shows the effective settings of the current environment including your location of settings. xml file. Additionally showPasswords=true will help you see the passwords resolved as well if you are using environment variables.

How do I update settings xml?

Open your Eclipse and go to Window -> Preferences. Click on the Browse button of User Settings , and select the settings. xml. Click on the "Update Settings" button to update the settings.


1 Answers

You can simply use:

mvn --settings YourOwnSettings.xml clean install

or

mvn -s YourOwnSettings.xml clean install
like image 388
khmarbaise Avatar answered Oct 17 '22 10:10

khmarbaise