ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig Berry" <>
Subject RE: Extension to Manifest task?
Date Wed, 03 Mar 2004 19:29:51 GMT
> From: Stefan Bodewig []
> <pathconvert> should be able to take the <path> and turn it into a
> property stripping of the leading absolute path with nested <map>
> (or, CVS HEAD only, <mapper>) elements.
> I'd prefer an approach that works outside of <ear> and even outside of
> <manifest> as it may very well apply to a more general problem.  So
> please look into <pathconvert> to see whether it fits.

The fit turns out to be rather awkward.  I've reproduced the minimal
approach I've been able to make work below.  Note that this is just the
non-ejb-jar gathering and manifest-generation target; actually building
the EAR using the <ear> task happens in a different target.  Note that I
need two pathconverts, one to turn my relative lib path into an absolute
path, and one to drive the prefix-replacement mapping.

I am coming more and more to think that the right solution is an
addition to the manifest task to handle constructing a path-substituted
classpath attr based on a fileset of jars and an intendended
EAR-relative prefix.  Doing it in the <ear> task would be more direct,
but also a bit uglier as you'd need to reach into every ejb jar and mess
with its manifest, which seems wrong.

Anyway, here's my current solution.  Thoughts on how to make this easier
and cleaner, either through better use of existing tools or through
enhancements of the <ear>, <jar>, or <manifest> tasks, are very welcome.

    <target name="prepare.libs" depends="init">
		<!-- Gather the non-ejb EAR jars and build a fileset
containing them -->
		<copy todir="${}"
			<fileset refid="portblue.libs.ear"/>
		<fileset dir="${}"

		<!-- Turn the rel path of these jars into an abs path
		<pathconvert property="lib.prefix" pathsep=" ">
			<path location="${}"/>

		<!-- Replace the abs path prefix of the jars with 'lib'
(which will
		     be the EAR-relative path) -->
     	      <pathconvert refid="lib.include"
     	             pathsep=" ">
     		    <map from="${lib.prefix}" to="lib"/>

     	      <!-- Build the manifest file using the generated classpath
     		      <attribute name="Class-Path"

Craig Berry
Principal Architect and Technical Manager
(310) 566-7546

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message