0
我有一個ivy.xml
文件(無ivysettings.xml
文件)具有以下依賴性:如何防止常春藤下載同一依賴項的多個版本?
<dependency org="org.freemarker" name="freemarker" rev="2.3.23"/>
然而,當我解決我的常春藤依賴我結束了freemarker-2.3.8.jar
和freemarker-2.3.23.jar
。這在Apache Tomcat中造成了一個問題,因爲2.3.8.jar
優先於2.3.23.jar
,而Configuration.VERSION_2_3_23
這個在運行時顯示爲不可用(儘管它可用於編譯時)。下面是完整的的ivy.xml的情況下,它可以幫助:
<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>
我把你的答案和實施是'<依賴組織= 「org.hibernate作爲」 NAME = 「休眠工具」 REV = 「4.3.1.CR1」> <排除有機= 「freemarker的」 模塊=「freemarker」/>'它工作! –