Nexus Ivy Maven : Second Level Dependencies Ignores Transitive

 ̄綄美尐妖づ 提交于 2019-12-13 06:59:29

问题


1.) I have a Project1 with this ivy dependency :

<dependency org="xalan" name="serializer" rev="2.7.1" transitive="false" conf="compile->default" />

This project brings serializer.jar (just only this jar, OK! )

2.) In a second one Project (Proyect2) i put the next dependency :

<dependency org="com.net" name="Project1" rev="latest.integration" conf="default->default;compile->compile;runtime->runtime" transitive="true">
</dependency>

This "Project 2" brings :

  1. Project 1
  2. Serializer.jar
  3. xml-apis.jar

    Despite of putting transite to false in xalan dependency.

I haven't this behaviour in my Eclipse + IVEDe environment, just only with Nexus and Maven.... It seems to be wrong because on Project1 i set xalan transitive to false.


回答1:


Try the following dependency in Project 1 and see if that fixes the problem:

<dependency org="xalan" name="serializer" rev="2.7.1" conf="compile->master" />

See the following answer on how Ivy interprets Maven modules and scopes:

  • How are maven scopes mapped to ivy configurations by ivy

I'm not a fan of switching off transitive dependencies. I think it's much better to rely on configuration mappings and if absolutely necessary include an exclude statement to remove an objectionable dependency.



来源:https://stackoverflow.com/questions/26178442/nexus-ivy-maven-second-level-dependencies-ignores-transitive

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!