Intellij idea 如何通过自己的mvn存储库(artifactory)解析项目库

Intellij idea 如何通过自己的mvn存储库(artifactory)解析项目库,intellij-idea,dependencies,setup-project,Intellij Idea,Dependencies,Setup Project,如何将内部设置的maven存储库与Intellij链接 在ProjectLibraries视图中,我可以添加一个驻留在标准maven Reppositions中的新项目库,但我看不到如何将IntelliJ指向特定的maven存储库,例如我们为公司设置的artifactory Intellij也无法识别Settings.xml。我后来发布了settings.xml,但无法识别(密码、用户名和公司名称已被替换): 使用者 嗯 中心的 * https://dev.mycompany.com:8443

如何将内部设置的maven存储库与Intellij链接

在ProjectLibraries视图中,我可以添加一个驻留在标准maven Reppositions中的新项目库,但我看不到如何将IntelliJ指向特定的maven存储库,例如我们为公司设置的artifactory

Intellij也无法识别Settings.xml。我后来发布了settings.xml,但无法识别(密码、用户名和公司名称已被替换):


使用者
嗯
中心的
*
https://dev.mycompany.com:8443/artifactory/any
中心的
中心的
https://dev.mycompany.com:8443/artifactory/libs
中心的
https://dev.mycompany.com:8443/artifactory/plugins
人工制品
人工制品

IntelliJ将
pom.xml
中的存储库用于maven项目和maven配置文件
settings.xml
。为了从repote存储库中获取依赖项,并且不添加
pom.xml
,我认为您应该在设置文件中定义存储库

默认情况下,此文件位于主文件夹中,如
{home}/.m2/settings.xml

尝试添加此配置:

<settings>
 ...
 <profiles>
   ...
   <profile>
     <id>myprofile</id>
     <activation>
        <activeByDefault>true</activeByDefault>
     </activation>
     <repositories>
       <repository>
         <id>my-repo2</id>
         <name>your custom repo</name>
         <url>http://jarsm2.dyndns.dk</url>
       </repository>
     </repositories>
   </profile>
   ...
 </profiles>

 <activeProfiles>
   <activeProfile>myprofile</activeProfile>
 </activeProfiles>
 ...
</settings>

...
...
我的个人资料

为什么不在
pom.xml
中定义新的回购协议?IntelliJ将很好地获取它。我很想这样做,但是当前的项目是一个旧的遗留ant项目。像pom.xml等奇特的东西目前并不存在。当然,我可以找到一个解决方法,但另一方面,我也希望告诉IntelliJ使用内部maven存储库。答案是Thx!我增强了我的初始帖子,因为实际上我们已经在做这件事了,但是IntelliJ无法识别settings.xml
<settings>
 ...
 <profiles>
   ...
   <profile>
     <id>myprofile</id>
     <activation>
        <activeByDefault>true</activeByDefault>
     </activation>
     <repositories>
       <repository>
         <id>my-repo2</id>
         <name>your custom repo</name>
         <url>http://jarsm2.dyndns.dk</url>
       </repository>
     </repositories>
   </profile>
   ...
 </profiles>

 <activeProfiles>
   <activeProfile>myprofile</activeProfile>
 </activeProfiles>
 ...
</settings>