maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "shinjan sen" <shinjanse...@gmail.com>
Subject Maven and Ant | Executing Ant script before downloading dependencies | Need Help
Date Mon, 25 Jun 2007 07:20:10 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message