Fast forward to 2011 and we're using Ant with Ivy as our dependency manager. We use Ivy's retrieve Ant task to get our artifacts but how do we print out a simple list of what Ivy got for us? Well, it turns out cachepath can get this for us, optionally filtered if we see fit:
<!-- after a resolve; in our case this target depends on our resolving target -->
<ivy:cachepath pathid="ivy.cachepath" settingsRef="ivy.settings" />
<pathconvert pathsep="${line.separator} "
property="dependency.list"
refid="ivy.cachepath"/>
<echo>DEPENDENCY LIST</echo>
<echo> ${dependency.list}</echo>
This will print something along the lines of:
[echo] C:\...\.ivy2\cache\org.slf4j\slf4j-api\jars\slf4j-api-1.6.1.jar
[echo] C:\...\.ivy2\cache\org.slf4j\jcl-over-slf4j\jars\jcl-over-slf4j-1.6.1.jar
[echo] C:\...\.ivy2\cache\org.slf4j\log4j-over-slf4j\jars\log4j-over-slf4j-1.6.1.jar
[echo] C:\...\.ivy2\cache\ch.qos.logback\logback-classic\jars\logback-classic-0.9.28.jar
[echo] C:\...\.ivy2\cache\ch.qos.logback\logback-core\jars\logback-core-0.9.28.jar
Once in a while this is a lifesaver as it makes it easy to see a simple list of our dependencies. Since we print it out line-by-line it's now nice and easy to grep through and find specific things. Like say what version of the components in such and such a group we are getting.
No comments:
Post a Comment