javaperson
javaperson

Reputation: 109

Editing settings file for maven

I have maven 3.5.4 and java 1.8 running on my Windows 7 machine. I may need to make some edits to the settings.xml file for maven, however I am not able to locate it. My maven installation folder is as follow: C:\Users\username\.m2. I am not able to locate settings.xml in any of the subfolders inside this folder.

Upvotes: 2

Views: 5034

Answers (2)

Veselin Davidov
Veselin Davidov

Reputation: 7081

You can create a default settings file in C:\users\user\.m2

Settings.xml is not mandatory. If it is absent, then Maven still works without custom settings.

You can also call maven with a specific settings.xml file by using -s or --settings options. For example:

mvn -s mySettings.xml clean install

Upvotes: 4

Stijn Van Bever
Stijn Van Bever

Reputation: 100

You can always run the mvn command with debug specified in any directory and in the message it will show you which settings.xml files he's using

Command: mvn -X

Output:

...
[DEBUG] Reading global settings from C:\tools\apache-maven-3.5.2\bin\..\conf\settings.xml
[DEBUG] Reading user settings from C:\Users\{username}\.m2\settings.xml
...

Upvotes: 1

Related Questions