Wednesday, June 18, 2008

Copy dependencies to a folder using Ant that runs in Maven

The following plugin copies dependencies of the specific pom to a folder.
Ant is used for this task.

<typedef resource="org/apache/maven/artifact/ant/antlib.xml">
<classpath refid="maven.dependency.classpath">
<pom id="maven.project" file="pom.xml">
<dependencies filesetid="dependency.fileset" usescope="runtime">
<pom refid="maven.project">
<mkdir dir="target/deps">
<copy todir="target/deps">
<fileset refid="dependency.fileset">


P.S. It's true that it's possible to use the assembly plugin for this specific task. But sometimes things become complex and ANT is essential.

No comments: