简体   繁体   English

Maven不使用依赖项pom.xml中指定的存储库

[英]Maven doesn't use repository specified in the pom.xml of dependency

Our project depends on drools 我们的项目取决于流口水

<dependency>
  <groupId>org.drools</groupId>
  <artifactId>drools-compiler</artifactId>
  <version>6.1.0.Final</version>
</dependency>

Maven can find drools-compiler in Maven central repository. Maven可以在Maven中央存储库中找到drools-compiler The problem is that Maven cannot find some dependencies of drools-compiler , which are located in jboss Maven repository http://repository.jboss.org/nexus/content/groups/public/ . 问题是Maven无法找到drools-compiler某些依赖项,这些依赖项位于jboss Maven存储库http://repository.jboss.org/nexus/content/groups/public/中

The parent of drools-compiler is drools-multiproject , and it declares jboss repository as follows drools-compiler的父drools-compilerdrools-multiproject ,它声明jboss存储库,如下所示

<repository>
  <id>jboss-public-repository-group</id>
  <name>JBoss Public Repository Group</name>
  <url>http://repository.jboss.org/nexus/content/groups/public/</url>
  <layout>default</layout>
  <releases>
    <enabled>true</enabled>
    <updatePolicy>never</updatePolicy>
  </releases>
  <snapshots>
    <enabled>true</enabled>
    <updatePolicy>daily</updatePolicy>
  </snapshots>
</repository>

I also checked the effective pom of drools-compiler , and found jboss maven repository is listed. 我还检查了drools-compiler的有效pom,发现其中列出了jboss maven存储库。

In theory Maven should use jboss Maven repository to search those dependencies, but sometimes it doesn't. 从理论上讲,Maven应该使用jboss Maven存储库来搜索那些依赖项,但有时不是。

I don't know whether there other settings affect Maven's behavior. 我不知道是否有其他设置会影响Maven的行为。

Thanks 谢谢

Did you try adding the dependent repository in your POM. 您是否尝试在POM中添加从属存储库。 Adding dependent repositories transitively is a potential security bug, so probably Maven is using only repositories listed in your POM. 过渡性地添加从属存储库是一个潜在的安全漏洞,因此Maven可能仅使用POM中列出的存储库。

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

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