在有些情況下設置有兩個位置。請確定你使用哪一個。檢查manual,檢查文件屬性。
One is Maven install (global), second is inside user account.
The settings element in the settings.xml file contains elements used to define values which configure Maven execution in various ways, like the pom.xml, but should not be bundled to any specific project, or distributed to an audience. These include values such as the local repository location, alternate remote repository servers, and authentication information.
There are two locations where a settings.xml file may live:
The Maven install: $M2_HOME/conf/settings.xml
A user’s install: ${user.home}/.m2/settings.xml
The former settings.xml are also called global settings, the latter settings.xml are referred to as user settings. If both files exists, their contents gets merged, with the user-specific settings.xml being dominant.
Tip: If you need to create user-specific settings from scratch, it’s easiest to copy the global settings from your Maven installation to your ${user.home}/.m2 directory. Maven’s default settings.xml is a template with comments and examples so you can quickly tweak it to match your needs.
作爲一個黑客,它可能會幫助移動'〜/ .m2'目錄'/ tmp'並添加符號鏈接。 –
你編輯_ {} M2_HOME /conf/settings.xml_? – Berger
你上哪兒去位於你的'settings.xml'?正確地在'$ HOME/.m2/settings.xml'中? – khmarbaise