ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Partridge, Michael" <>
Subject RE: How to download only the required JARs?
Date Tue, 06 Jan 2009 17:16:50 GMT
You can exclude the jars you don't want using the exclude element [1]
within dependency:

    <conf name="build" visibility="private" description="compilation
only need jar" />
    <conf name="runtime" visibility="private" extends="build"
description="all runtime jars" />
    <dependency org="ch.qos.logback" name="logback-classic" rev="0.9.14"
      <exclude org="javax.mail" />
      <!-- etc -->

where, in the conf attribute of the dependency element, you would
replace conf1 with the logback's configuration that provides slf4j-api,
and conf2 with the configuration which provides logback-core and
logback-classic jars.


-----Original Message-----
From: hezjing [] 
Sent: Tuesday, January 06, 2009 10:26 AM
Subject: How to download only the required JARs?

I want to test Logback.

Without Ivy, my project has one compile JAR:

and two runtime JARs:


With Ivy, I configured the following ivy.xml:

<ivy-module version="1.0">
  <info organisation="com.dummy" module="hello" />
    <conf name="build" visibility="private" description="compilation
need jar" />
    <dependency org="ch.qos.logback" name="logback-classic" rev="0.9.14"

and here is the Ant's task to download the dependencies:

  <target name="resolve" description="retrieve dependencies">
    <ivy:retrieve pattern="${lib}/[conf]/[artifact].[ext]" />

Do you know why when Ant run, it start downloading the following JARs?
[ivy:retrieve]  found ch.qos.logback#logback-classic;0.9.14 in public
[ivy:retrieve]  found ch.qos.logback#logback-core;0.9.14 in public
[ivy:retrieve]  found org.slf4j#slf4j-api;1.5.6 in public
[ivy:retrieve]  found javax.mail#mail;1.4 in public
[ivy:retrieve]  found javax.activation#activation;1.1 in public
[ivy:retrieve]  found janino#janino;2.4.3 in public
[ivy:retrieve]  found
org.apache.geronimo.specs#geronimo-jms_1.1_spec;1.0 in
[ivy:retrieve]  found javax.servlet#servlet-api;2.5 in public

What I want to do is to configure a 'build' configuration, that gives
me slf4j-api-1.5.6.jar
and a 'runtime' configuration, that gives me logback-core-0.9.14.jar
and logback-classic-0.9.14.jar (which also extends the 'build'



CONFIDENTIALITY NOTICE: This electronic message transmission is
intended only for the person or the entity to which it is addressed
and may contain information that is privileged, confidential or
otherwise protected from disclosure. If you have received this
transmission, but are not the intended recipient, you are hereby
notified that any disclosure, copying, distribution or use of the
contents of this information is strictly prohibited. If you have
received this e-mail in error, please contact the sender of the
e-mail and destroy the original message and all copies.

View raw message