Background : I need to run an ant task in the build.xml file using maven. So I'm using maven-antrun-plugin to do this.
Question :
When I'm reading the basedir in ant (after running pom) it displays as fldr1.fldr2.prjctNm which was it's defualt value (in both echoes). But, I want to set the parent directory path to it. (eg : fldr1.fldr2). How can I do this.
Ant file alone does this because it defines basedir="../ in the tag.
pom.xml (location : fldr1.fldr2.prjctNm)
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>default-cli</id>
<phase>package</phase>
<configuration>
<target>
<property name="basedir" value="../" />
<echo message="basedir path 1 : ${basedir}"/>
<ant antfile="build.xml" target="cleanAll" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
build.xml (location : fldr1.fldr2.prjctNm)
<project name="RideUtilities" default="cleanAll" basedir="../">
<target name="cleanAll" depends="all"></target>
<target name="all" depends="init,build"></target>
<target name="init">
<echo message="basedir path 2 : ${basedir}"/>
<property name="dirs.base" value="${basedir}/RideUtilities" />
<property name="src" value="${dirs.base}\src" />
<property name="jarFile" value="RideUtilities.jar" />
</target>
<target name="build">
<echo> ---Building jar files using ${dirs.base} ---- </echo>
</target>
</project>