Hi Shinjan,
You can separate the two. Place the ant project in its own project,
configure the ant run plugin there. Then, in the maven project, add the
ant project as a dependency. If you want this in one nice build, you can
place both projects under one parent, this way, when you build the
parent, it would build the ant project first, then the maven one.
HTH,
Henry
shinjan sen wrote:
Hi,
I have a maven project which has a dependency on an ant project. To achieve
this I have added a execution of the maven ant-run-plugin in my pom.xml as
follows:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<configuration>
<tasks>
<echo>Download dependent jars</echo>
<ant antfile="build.xml" dir="." inheritAll="true" inheritRefs="true">
</ant>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
This ant script "build.xml" compiles the associated ant project and
installs
the same in the maven local repository.
<project basedir="." default="buildJar" >
<condition property="mvn.exec" value="mvn.bat" else="mvn">
<os family="windows"/>
</condition>
<target name="buildJar" description="Builds ant project and copies jar to
local repository">
<ant antfile="build.xml" dir="ant_common" target="compile" />
<exec executable="${mvn.exec}">
<arg line="-D mvn install:install-file -Dfile=ant_common.jar
-DgroupId=mytest -DartifactId=ant_common -Dversion=1.0 -Dpackaging=jar"/>
</exec>
</target>
</project>
My question is how do I add this ant project as a dependency in my pom.xml?
if I add it as
<dependency>
<groupId>mytest</groupId>
<artifactId>ant_common</artifactId>
<version>1.0</version>
</dependency>
my pom will try to download the same before executing the
maven-antrun-plugin execution and will throw an error.
I want to achieve the effect of installing the ant project and then
referencing it as a dependency in one execution.
Please advise.
Thanks in advance.
Regards,
Shinjan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]