Seconding Adrian's suggestion below. Here's a pointer to Apache Axis2's Subversion repository as a cautionary example that is related to using Ant tags in Maven builds:
http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/maven.xml They moved to Maven 1, but they did so by just adapting existing Ant build scripts into a maven.xml file. Check out the trunk of Axis2; try to understand the build system, and I think you'll quickly come to the conclusion that Axis2 doesn't use Maven. It uses Maven as a wrapper around a core build that is still written in Ant. When a project moves to Maven by wrapping existing Ant build scripts, the end product is neither an Ant build nor a Maven build, it is a custom Frankenstein build that gains no benefit from Maven's life-cycle; it doesn't benefit from the reuse that are Maven plug-ins, and it takes just as much work to manage as the original. In the last two years most people have moved to Maven 1 from Ant, and I don't think that the Maven people did a good job of letting people know not to do this [make heavy use of Ant tags]. People tended to put customizations in maven.xml and then they had a bad experience with Maven 1. (Then they read the BileBlog, and now there is a siginificant portion of the population that *hates* Maven.) Maven 2 was redesigned from the ground up to discourage build customization via Ant tags. In general, Maven 2 can handle almost anything you can throw at it, and, when it can't, it is easy to write a script in the form of a plugin (and if you really want to write that plugin in Ant see: http://maven.apache.org/guides/plugin/guide-ant-plugin-development.html) What you are trying to do below is already handled by the jar plugin and if that doesn't meet your needs you can create an assembly descriptor. But, I wouldn't expect people to just know that because the docs are lacking. I wouldn't recommend using the antrun plug-in even as a temporary stop-gap. If you are going to move to Maven 2, adopt it in full; otherwise, you'll end up in the same situation as Axis2. You'll have semi-adoption of Maven 2, but most of your build logic will still be captured in Ant. --- Adrian Brock <[EMAIL PROTECTED]> wrote: > On the maven build in general, I don't like the kind of thing > seen below. We might as well use ant than learn a new tool > to do this??? > > Good: Declarative information known to the build system > Bad: Scripting or any other hack that breaks the information trail > > Is this just because our projects are hopelessly entangled? > > <plugins> > <plugin> > <artifactId>maven-antrun-plugin</artifactId> > <version>1.0</version> > <executions> > <execution> > <!-- instruct maven that this plugin should be > executed whenever the package phase is ran > --> > <phase>package</phase> > <configuration> > <tasks> > > <mkdir dir="${basedir}/output/lib"/> > > <!-- Build jboss-common.jar --> > <jar > jarfile="${basedir}/output/lib/jboss-common.jar" > > manifest="${basedir}/src/etc/default.mf"> > <fileset > dir="${basedir}/output/classes"> > <include name="org/jboss/**"/> > <include > name="org/apache/xerces/**"/> > </fileset> > </jar> > > <!-- Build jboss-common-client.jar --> > <jar > jarfile="${basedir}/output/lib/jboss-common-client.jar" > > manifest="${basedir}/src/etc/default.mf"> > <fileset > dir="${basedir}/output/classes"> > <include name="org/jboss/**"/> > <include > name="org/apache/xerces/**"/> > <exclude > name="org/jboss/deployment/**"/> > </fileset> > </jar> > > <!-- Build namespace.jar --> > <jar > jarfile="${basedir}/output/lib/namespace.jar" > > manifest="${basedir}/src/etc/default.mf"> > <fileset > dir="${basedir}/output/classes"> > <include > name="javax/xml/namespace/*"/> > </fileset> > </jar> > > > -- > xxxxxxxxxxxxxxxxxxxxxxxx > Adrian Brock > Chief Scientist > JBoss Inc. > xxxxxxxxxxxxxxxxxxxxxxxx > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 > _______________________________________________ > JBoss-Development mailing list > JBoss-Development@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jboss-development > ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ JBoss-Development mailing list JBoss-Development@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-development