My project was constructed using Maven. I was happily building it with Maven. Now, I need to build it with Ant (which I wish I needn't!!!). I wish to use existing maven dependencies - i.e., wish to retain the pom for dependency management.
So, I wrote this task:
<target name="java.compile">
<artifact:pom id="mypom" file="pom.xml" />
<artifact:dependencies filesetId="mypomdeps" pomRefId="mypom" />
<mkdir dir="build/classes" />
<javac
srcdir="${src.java.dir}"
destdir="build/classes"
includeantruntime="no">
<classpath>
<fileset refid="mypomdeps"/>
</classpath>
</javac>
</target>
However, the ant compilation output complains the libraries(in the jars) pointed to by mypomdeps are missing.
What are the reasons that javac was unable to see the classpath that I intended?
Am I using the filesetId generated by artifact:dependencies correctly?
My ant project defn:
I placed maven-ant-tasks-2.1.3.jar in the project basedir.
<project name="why-does-the-sun-go-on-shining"
default="java.compile"
xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<path id="maven-ant-tasks.classpath" path="maven-ant-tasks-2.1.3.jar" />
<typedef
resource="org/apache/maven/artifact/ant/antlib.xml"
uri="antlib:org.apache.maven.artifact.ant"
classpathref="maven-ant-tasks.classpath" />
Further Clarification
The gist of the question is ... how to use my pom dependencies in my Ant javac task?