Exporting Maven properties from Ant code

Posted by Gili on Stack Overflow See other posts from Stack Overflow or by Gili
Published on 2010-06-17T23:06:02Z Indexed on 2010/06/17 23:13 UTC
Read the original article Hit count: 290

Filed under:
|

I've embedded the following code within my POM:

<plugin name="test">
  <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-antrun-plugin</artifactId>
      <executions>
        <execution>
          <phase>validate</phase>
            <configuration>
              <tasks>
                <pathconvert targetos="unix" property="project.build.directory.portable">
                  <path location="${project.build.directory}"/>
                </pathconvert>
              </tasks>
            </configuration>
          <goals>
        <goal>run</goal>
      </goals>
    </execution>
  </executions>
</plugin>

I then reference ${project.build.directory.portable} from the run project action but it comes back as null. Executing <echo> within the Ant block shows the correct value. What am I doing wrong?

© Stack Overflow or respective owner

Related posts about maven-2

Related posts about ant