简体   繁体   English

eclipse Mars:Maven M2_REPO 不可修改

[英]eclipse Mars: Maven M2_REPO not modifiable

在此处输入图片说明 在此处输入图片说明 We have been trying to search a solution for this last few hours but no success.在过去的几个小时里,我们一直在尝试寻找解决方案,但没有成功。

We never installed Maven as such.我们从来没有像这样安装 Maven。 Directly downloaded eclipse Mars, which comes with in-built Maven plugin.直接下载eclipse Mars,自带Maven插件。 But it doesn't allow to provide the location for a maven repository.但它不允许提供 Maven 存储库的位置。 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.我们的理解是,在 Workspace->preferences->Maven->User Settings 中更新 M2_REPO 的值应该允许指定本地 Maven 存储库。 But this is not editable, there is NO 'open-file' link either.但这不可编辑,也没有“打开文件”链接。 We checked the local directory .m2 -> there is no settings.xml there我们检查了本地目录 .m2 -> 那里没有 settings.xml

The question is :1) how do we update the M2_REPO variable in that case?问题是:1)在这种情况下,我们如何更新 M2_REPO 变量? 2) Where on our system can we expect to find maven's .settings.xml? 2) 在我们的系统上,我们可以在哪里找到 maven 的 .settings.xml? (a windows search did not show a settings.xml) (Windows 搜索未显示 settings.xml)

Per OP's request, I'm posting my earlier comment as an answer:根据 OP 的要求,我发布了我之前的评论作为答案:

The "Update Settings" button only refreshes Eclipse configuration with whatever is set in the settings.xml file. “更新设置”按钮仅使用settings.xml文件中settings.xml任何内容刷新 Eclipse 配置。 You have to provide the file yourself as the Maven plugin provides no editor for it.您必须自己提供文件,因为 Maven 插件没有为它提供编辑器。 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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM