【发布时间】:2019-08-12 12:21:37
【问题描述】:
我已在我的全局 m2 设置中配置了我的组织正在使用的 Nexus 存储库。
在执行mvn install 时,它会从 Nexus Repo 下载软件包,这表明配置正常。
然而,当在 eclipse 中使用 maven 时,似乎每当我执行 Maven > Update Project 时,并且 eclipse 尝试下载添加到 pom.xml 中的新包,它仍在从 Maven Repo 下载。
我已经配置了以下内容:
- 在 Preferences > Maven > Installations 下,这是指向我的 maven 文件
- 在 Preferences > Maven > User Settings 下,这是指向我的用户文件夹下的 settings.xml 并配置到 nexus 存储库
但是,我不确定为什么仍然没有从 nexus repo 中检索到包。
我的 settings.xml
<settings>
<profiles>
<profile>
<id>MyId</id>
<repositories>
<repository>
<id>MyRepo</id>
<url>MyCompanysNexusRepoUrl</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>MyRepo</id>
<url>MyCompanysNexusRepoUrl</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>MyId</activeProfile>
</activeProfiles>
</settings>
【问题讨论】:
-
请出示您的
settings.xml....因为我认为它没有正确完成... -
感谢分享! @khmarbaise
-
这正是我所期望的。看我的回答。