java - How can I prevent Ivy from downloading multiple versions of the same dependency? -
i have ivy.xml
file (without ivysettings.xml
file) following dependency:
<dependency org="org.freemarker" name="freemarker" rev="2.3.23"/>
however when resolve ivy dependencies end freemarker-2.3.8.jar
, freemarker-2.3.23.jar
. causing problem in apache tomcat because 2.3.8.jar
taking precedence on 2.3.23.jar
, static final int
called configuration.version_2_3_23
showing @ run-time unavailable (though available compile time). here full ivy.xml in case helps:
<ivy-module version="2.0"> <info organisation="com.example" module="exampleproject"/> <configurations defaultconfmapping="default"> <conf name="default"/> <conf name="java8" extends="default" description="java 8 dependencies"/> <conf name="eclipse" description="special dependencies in eclipse"/> <conf name="utest" extends="eclipse" description="unit testing dependencies"/> </configurations> <dependencies> <dependency org="com.amazonaws" name="aws-java-sdk-s3" rev="1.10.6"/> <dependency org="org.slf4j" name="slf4j-simple" rev="1.7.10" /> <dependency org="org.lesscss" name="lesscss" rev="1.7.0.1.1"/> <dependency org="com.github.mfornos" name="humanize-slim" rev="1.2.1"/> <dependency org="com.google.code.gson" name="gson" rev="2.3.1"/> <dependency org="com.lambdaworks" name="scrypt" rev="1.4.0"/> <dependency org="commons-cli" name="commons-cli" rev="1.2"/> <dependency org="commons-codec" name="commons-codec" rev="1.10"/> <dependency org="commons-fileupload" name="commons-fileupload" rev="1.3.1"/> <dependency org="joda-time" name="joda-time" rev="2.8.1"/> <dependency org="mysql" name="mysql-connector-java" rev="5.1.36"/> <dependency org="org.apache.ant" name="ant" rev="1.9.6"/> <dependency org="org.apache.commons" name="commons-lang3" rev="3.4"/> <dependency org="org.apache.httpcomponents" name="httpclient" rev="4.5"/> <dependency org="org.freemarker" name="freemarker" rev="2.3.23"/> <dependency org="org.hibernate" name="hibernate-c3p0" rev="4.3.10.final"/> <dependency org="org.hibernate" name="hibernate-core" rev="4.3.10.final"/> <dependency org="org.hibernate" name="hibernate-search" rev="4.5.1.final"/> <dependency org="org.hibernate" name="hibernate-tools" rev="4.3.1.cr1"/> <dependency org="org.imgscalr" name="imgscalr-lib" rev="4.2"/> <dependency org="org.jadira.usertype" name="usertype.core" rev="3.1.0.ga"/> <dependency org="org.jsoup" name="jsoup" rev="1.8.3"/> <dependency org="org.projectlombok" name="lombok" rev="1.16.6" /> <dependency org="org.tuckey" name="urlrewritefilter" rev="4.0.4"/> </dependencies> </ivy-module>
"freemarker-2.3.8.jar" part of "freemarker:freemarker" module , transitive dependency of
<dependency org="org.hibernate" name="hibernate-tools" rev="4.3.1.cr1"/>
i recommend following fix, telling ivy exclude unwanted module:
<ivy-module version="2.0"> .. .. <dependencies> .. .. <exclude org="freemarker" module="freemarker"/> </dependencies> </ivy-module>
to diagnose problem used report task analyse content of each ivy configuration.
<project name="demo" default="resolve" xmlns:ivy="antlib:org.apache.ivy.ant"> <target name="resolve"> <ivy:retrieve pattern="lib/[conf]/[artifact]-[revision](-[classifier]).[ext]"/> <ivy:report todir="reports" graph="false"/> </target> </project>
Comments
Post a Comment