Find hidden dependencies in Ivy

若如初见. 提交于 2019-12-03 02:51:17

We have an ant target that looks like this:

<target name="report" depends="init">
    <mkdir dir="report" />
    <!-- 
     The type attribute is optional, we're using it to exlude other dependcy types we're not interested in. 
     Note that each resolve uses that list (via a property) in our build. 
    -->
    <ivy:resolve type="jar,ejb,tld,bundle"/> 
    <ivy:report todir="report" />
</target>

Then it's just a call ant report and Ivy will generate the report as HTML in the given directory.

Take a look at the Ivy documentation for ivy:report.

Edit:

To prevent the inclusion of those artifacts/dependencies, you could try transitive="false" on the <dependency ..> element, or use <exclude>. For example, we use Hibernate 3 but don't want to have JTA 1.1, so our ivy.xml containts this: <exclude module="jta"/> to exclude all transitive JTA dependencies.

I'd like to build on Thomas' answer and recommend adding a "conf" declaration to the dependencies:

    <dependency org="org.slf4j" name="jcl-over-slf4j" rev="1.6.1" conf="default"/>
    <dependency org="ch.qos.logback" name="logback-classic" rev="0.9.27" conf="default"/>

This will reduce the transitive dependencies to the default sub-set, which in Maven terminology is the jars on the "compile" scope.

Without this setting you get all the dependencies which includes lot of optional stuff you won't need.

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