JavaTec
JavaTec

Reputation: 1044

eclipse Mars: Maven M2_REPO not modifiable

enter image description hereenter image description hereWe have been trying to search a solution for this last few hours but no success.

We never installed Maven as such. Directly downloaded eclipse Mars, which comes with in-built Maven plugin. But it doesn't allow to provide the location for a maven repository. Our understanding is this that updating the value of M2_REPO in Workspace->preferences->Maven->User Settings should allow to specify the local Maven repository. But this is not editable, there is NO 'open-file' link either. We checked the local directory .m2 -> there is no settings.xml there

The question is :1) how do we update the M2_REPO variable in that case? 2) Where on our system can we expect to find maven's .settings.xml? (a windows search did not show a settings.xml)

Upvotes: 4

Views: 7356

Answers (1)

david a.
david a.

Reputation: 5291

Per OP's request, I'm posting my earlier comment as an answer:

The "Update Settings" button only refreshes Eclipse configuration with whatever is set in the settings.xml file. You have to provide the file yourself as the Maven plugin provides no editor for it. If you want to change the local repository location, you need to specify it in that file.

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      https://maven.apache.org/xsd/settings-1.0.0.xsd">
  <localRepository>C:\Projects\mvn-repo</localRepository>
</settings>

Upvotes: 4

Related Questions