ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles Scokart" <>
Subject ivy and jars in war or ear
Date Fri, 20 Apr 2007 11:25:26 GMT


I have a web application with multiple jars.  Some jars are included
directly in the wars, but some are placed in the ear itself.

I would like to find an elegant solution using ivy and ant to :
- package the wars with the correct libs
- generate the classpath to be placed in the MANIFEST.MF of the wars
- package the ear with the correct libs

Currently, I have a rather complex implementation.  It uses ivy to retrieve
the list of dependencies, then filtering only the one that are required at
each level using antcontrib to plays with some properties (I put the
knowledge of where to place each jar in a property file).

I would like to simplify that.

I would like to place the knowledge of which jars to include in the war (or
in the ear) at the level of the ivy.xml of the wars.  The idea is that the
wars should have two configurations: 'war_libs' and 'ear_libs'.  But it is
not easy to achieve...

My problem is that I don't want to place all jars in the ivy.xml of the
wars.  I just want to put some top level one, and add a filter to say which
one should be kept in the war, or which one should be placed in the ear.  In
my case, I want to keep the jar produced in my company in the war, and place
the others in the ear.

Did you have any idea on how to do that elegantly?  

My second problem is to generate theclasspath of the of the war.
Currently, I have to play with antcontrib.  I iterate on all jar of the
dependency (that are placed in the ear and that are dependencies of the
war), and I create variable containing the classpath.  Could it be simpler?
Do we miss something in ivy or ant to do that?

Thanks for your suggestions,

View raw message