I want to specify a different location for settings.xml for the maven build other than the default one (<USER_HOME>/.m2/settings.xml
).
I have tried the -s
flag but it is not working. Is there any way to do this?
The Maven settings file, settings. xml , is usually kept in the . m2 directory inside your home directory.
A Maven settings. xml file defines values that configure Maven execution in various ways. Most commonly, it is used to define a local repository location, alternate remote repository servers, and authentication information for private repositories.
I found an easy way to do this..
Go to the 'Build' Section of the job and click "Advanced". There is a 'Settings File' option there. Specify the location your 'settings.xml' file.
Actually -s flag works. We use it maven jobs.
Under Build section add Invoke top level Maven targets and set Goals to [your goals] -s [path/to/settings.xml]
(e.g. clean deploy -s /some/path/settings.xml
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With