Ordering Ivy dependencies -
i'm struggling head around exact behaviour of exclusions in ivy.
in following ivy file, why putting commons-logging
before log4j
pull in javax.activation
, javax.mail
log4j
whereas putting after doesn't.
<ivy-module version="2.0"> <info organisation="test" module="test" /> <configurations defaultconfmapping="default->runtime(*)" /> <dependencies> <dependency org="log4j" name="log4j" rev="1.2.15"> <exclude org="javax.activation" /> <exclude org="javax.mail" /> </dependency> <dependency org="commons-logging" name="commons-logging" rev="1.1" /> <exclude org="com.sun.jdmk" /> <exclude org="com.sun.jmx" /> <exclude org="javax.jms" /> </dependencies> </ivy-module>
the activation , mail jars dependencies of commons logging, yet you've excluded them on log4j dependency...
when use single configuration sends mixed message ivy, should excluded or not? following lot more explicit:
<dependencies> <dependency org="log4j" name="log4j" rev="1.2.15"/> <dependency org="commons-logging" name="commons-logging" rev="1.1" /> <exclude org="javax.activation" /> <exclude org="javax.mail" /> <exclude org="com.sun.jdmk" /> <exclude org="com.sun.jmx" /> <exclude org="javax.jms" /> </dependencies>
it's less confusing when excludes set globally.
if want keep dependency resolution separate you'll need set more 1 configuration (think of these dependency sets):
<ivy-module version="2.0"> <info organisation="test" module="test" /> <configurations> <conf name="log4j_deps" description="log4j dependencies"/> <conf name="commons_deps" description="commons-logging dependencies"/> </configurations> <dependencies> <dependency org="log4j" name="log4j" rev="1.2.15" conf="log4j_deps->runtime"> <exclude org="javax.activation" /> <exclude org="javax.mail" /> </dependency> <dependency org="commons-logging" name="commons-logging" rev="1.1" conf="commons_deps->runtime"/> <exclude org="com.sun.jdmk" /> <exclude org="com.sun.jmx" /> <exclude org="javax.jms" /> </dependencies> </ivy-module>
switching around dependency tags have no effect now, because dependency resolution explicit.
- log4j , dependencies associated log4j_deps configuration
- commons dependencies placed onto commons_deps configuration.
Comments
Post a Comment