ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Prior <>
Subject container supplied jars excluded in ivy
Date Sun, 24 Jul 2011 15:12:04 GMT
I'm using Ivy to build libraries which can either be used from the command line 
or incorporated into a webapp in a container such as Tomcat and am trying to 
find an intelligent way to handle dependencies which need to be excluded from 
the generated war file because they are supplied with Tomcat itself.


I've got project someLib which interacts with a MySQL database so it has a 
dependency on the mysql java connector for the case when I launch a main program 
in the library for command line use.

I've also got project someWebApp which adds a web UI on top of the someLib 
functionality.  Since my standard Tomcat installation manages the MySQL database 
connection the mysql java connector should not be built into the war file 
deployed to Tomcat.  Also, while I need the servlet library to be able to 
compile my webapp, I certainly should not include that in the built war file 
under any circumstances.

It occurs to me that which jars are installed standard on the servers is a site 
wide configuration and shouldn't really be the concern of the individual 
projects.  I was thinking of defining a war configuration which extends the 
runtime configuration, but then excludes the artifacts which should not be built in.

Something along the general idea of this (though I don't know yet if placing 
excludes is allowed here:

     <conf name="runtime" extends="compile" />

     <conf name="war" extends = "runtime" >
        <exclude org="com.mysql" name="mysql-connector-java" />

I've gotta believe I'm not the first person to want to do this, are there any 
best practices out there?  Do I appear to be heading in the right direction?


View raw message