【发布时间】:2014-08-27 22:32:28
【问题描述】:
如何将我们在内部设置的 Maven 存储库与我的 Intellij 链接?
在项目库视图中,我能够添加一个位于标准 maven 存储库中的新项目库,但我看不到如何将 IntelliJ 指向特定的 maven 存储库,例如我们为公司。
Intellij 也无法识别 Settings.xml。之后我发布了 settings.xml,但它无法识别(密码、用户名和公司名称已被替换):
<settings>
<servers>
<server>
<username>USER</username>
<password>PW</password>
<id>central</id>
</server>
</servers>
<mirrors>
<mirror>
<mirrorOf>*</mirrorOf>
<url>
https://dev.mycompany.com:8443/artifactory/any
</url>
<id>central</id>
</mirror>
</mirrors>
<profiles>
<profile>
<repositories>
<repository>
<snapshots />
<id>central</id>
<url>
https://dev.mycompany.com:8443/artifactory/libs
</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots />
<id>central</id>
<url>
https://dev.mycompany.com:8443/artifactory/plugins
</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>
【问题讨论】:
-
为什么不在
pom.xml中定义一个新的仓库? IntelliJ 会很好地获取它 -
我想这样做,但当前项目是一个旧的单体遗留 ant 项目。 pom.xml 等花哨的东西目前不存在。当然我可以找到一种解决方法,但另一方面我也想告诉 IntelliJ 使用内部 maven 存储库。
标签: intellij-idea dependencies setup-project