Reputation: 531
I have added proxy configuration in settigns.xml file, but it is not used by Maven, i confirmed this by making the settings.xml file invalid. I ran the maven install command to update settings and global-settings to point to the correct file, still no luck. I am using maven3.0.4.
Upvotes: 15
Views: 69372
Reputation: 1073
Right click on the project root if you are using IntelliJ IDEA. Go to Maven -> Create 'setting.xml' file. Do your configuration there.
Upvotes: 0
Reputation: 5445
What I found was that even if I set my own maven setting file using the --settings
or -s
command such as:
mvn -s $MAVEN_HOME/libexec/conf/my-settings.xml clean
Maven was still reading the default global setting.xml
Two ways that one can slove this:
setting.xml.bak
in the $MAVEN_HOME/conf
dicrectory.-gs
hence the final command becomes:mvn -gs $MAVEN_HOME/libexec/conf/my-settings.xml clean
Upvotes: 2
Reputation: 637
It's almost to stupid to tell, but it might save some time for somebody else: If you're using a new computer, make sure file extensions are displayed. Otherwise your "settings.xml" file probably is a "settings.xml.txt" file in fact...
Upvotes: 11
Reputation: 23
I have also been facing the same issue. I removed the file and folder, but still maven was still picking the settings.
For me, restarting the system solved the issue.
Upvotes: 0
Reputation: 158
You can set the path of settings file in Eclipse* as :
In the menubar goto Window -> Preferences
In Preferences Dialog, Goto Maven Section(On the left) and Expand it.
Click on UserSettings.
Add the path of settings file using Browse. The default for most users will be (C:\Users\.m2\settings.xml). It will be shown in grey but you need to actually enter the location.
Click on Update Settings !
You can also enable debug logs and stack traces for debugging by clicking on the Maven Section in the Preferences dialog and Checking the box against the label "Debug Output".
Upvotes: 0
Reputation: 1570
have you tried with these options: from the command line to specify the settings file?
mvn -o –Dmaven.repo.local=$HOME/.my_m2path/repository clean install --settings $HOME/.my_m2path/settings.xml Dcheckstyle.skip=true –DskipTests
Some options that might not be necessary
Upvotes: 4
Reputation: 101
Please make sure you are using the settings.xml which you modified. for example: your using IDE's embedded maven which using different settings.xml in you operation system.
Upvotes: 0
Reputation: 9319
In the Ubuntu package repository (and probably other disto's too), there are two maven packages: maven
and maven2
. For some reason, I had maven2
installed, which seems to ignore settings.xml
in ~/.m2
.
As a solution, I removed it using
sudo apt-get purge maven2
and installed the other one with
sudo apt-get install maven
I couldn't find a reliable source, but apparently, maven2
is an older version (2.x), as the latest maven has version 3.x and is served with maven
.
Upvotes: 2
Reputation: 2373
Since there is no accepted answer, and I encountered that problem today and other answers proved unhlepful as the file path was correct:
The solution is to restart your computer. No, seriously. After restart maven is guaranteed to read settings.xml file again and use whatever changes you made.
Upvotes: 1
Reputation: 54457
Try running Maven with the -X option. It should print as part of the debug output which settings file is being used.
Since you already tried it with an invalid file, I bet that something is wrong with the location of your file.
Upvotes: 24
Reputation: 2671
Make sure it is in the right directory (HOME/.m2/settings.xml)
You can find the relevant paths and a proxy example here: Maven proxy settings not working
And of course the reference is always useful: https://maven.apache.org/settings.html
Upvotes: 5