简体   繁体   English

常春藤不解决公共Maven仓库的传递依赖

[英]Ivy not resolving transitive dependencies from public maven repos

Considering the following ivy dependencies, 考虑以下常春藤的依赖关系,

<dependency org="org.fusesource.restygwt" name="restygwt" rev="1.3"
 conf="gwtcompile->default; compile->default"/>

<dependency org="org.jboss.resteasy" name="resteasy-jaxrs" rev="2.3.4.Final"
 conf="compile->compile(*),runtime(*);runtime->runtime(*)"/>

They depend on public maven repos mirrored by 他们依赖于由

http ://myivyserver:8888/mirrored/ . http:// myivyserver:8888 / mirrored /。

as specified by the ivysettings resolver chaining to ... 由ivysettings解析器链接到...

<url name="mirrored" m2compatible="true">
  <artifact
    pattern="http://myivyserver:8888/mirrored/${maven2.artifact.pattern}" />
</url>

Where I can see the mirrored directory completely replicating the artefacts of remote maven repos. 在这里,我可以看到镜像目录完全复制了远程Maven存储库的伪像。

I am used to Maven and the seeing the buildpath on eclipse showing maven dependencies. 我习惯了Maven,并在Eclipse上看到了显示Maven依赖项的buildpath。

Now, I am creating Ivy-dependency for a project. 现在,我正在为项目创建常春藤相关性。 I am expecting to see similar, and I do see, a similar Ivy dependency node showing all the jars due to the Ivy eclipse pluggin. 由于Ivy eclipse插件,我希望看到类似的Ivy依赖项节点,并且显示所有jar。

However, the Ivy dependency node in eclipse buildpath does not show any jars transitively specified by the mirrored poms. 但是,eclipse buildpath中的Ivy依赖项节点不会显示镜像pom传递指定的任何jar。

For example, 例如,

<dependency org="org.fusesource.restygwt" name="restygwt" rev="1.3"
 conf="gwtcompile->default; compile->default"/>

<dependency org="org.jboss.resteasy" name="resteasy-jaxrs" rev="2.3.4.Final"
 conf="compile->compile(*),runtime(*);runtime->runtime(*)"/>

both dependencies' pom specify dependency on javax.ws.rs (jsr311-api) 两个依赖项的pom均指定对javax.ws.rs的依赖项(jsr311-api)

<dependency>
  <groupId>javax.ws.rs</groupId>
  <artifactId>jsr311-api</artifactId>
  <version>1.1</version>
  <scope>provided</scope>
</dependency>

However javax.ws.rs(jsr311-api) does not show up on the buildpath library of the ivy managed project, as a Maven managed one would. 但是,javax.ws.rs(jsr311-api)不会显示在ivy管理的项目的buildpath库中,就像Maven管理的项目一样。

What further more would I have to do to get ivy plugin to resolve transitive dependencies that are due to maven poms? 我还要做些什么才能使ivy插件解决由于maven poms引起的传递依赖关系?

Thank you. 谢谢。

URL resolver considers maven layout but not pom dependencies. URL解析器考虑Maven布局,但不考虑pom依赖性。 When I was implementing this functionality ibiblio resolver was able to resolve pom's dependencies. 当我实现此功能时,ibiblio解析器能够解析pom的依赖关系。

http://ant.apache.org/ivy/history/latest-milestone/resolver/ibiblio.html
<ibiblio name="maven2" m2compatible="true" root="http://myivyserver:8888/mirrored">

I haven't used it long because I preferred non-transitive dependencies in my code so I've finished with using pure url resolver. 我用了很长时间,因为我在代码中更喜欢非传递性的依赖关系,因此我已经完成了使用纯URL解析器的工作。

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

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