Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <project>
- <modelVersion>4.0.0</modelVersion>
- <groupId>some.groupId</groupId>
- <artifactId>some.artifactId</artifactId>
- <version>1-SNAPSHOT</version>
- <name>${project.build.directory.portable}</name>
- <properties>
- <project.build.directory.portable>the_value_resolved_before_any_plugin_runs</project.build.directory.portable>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.4</version>
- <executions>
- <execution>
- <id>echo-maven-property-before-changing</id>
- <phase>validate</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <echo message="${project.build.directory.portable}"/>
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.groovy.maven</groupId>
- <artifactId>gmaven-plugin</artifactId>
- <version>1.0</version>
- <executions>
- <execution>
- <id>set-maven-property</id>
- <phase>validate</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- <configuration>
- <source>
- ant.pathconvert(targetos:"unix", property:'project.build.directory.portable') {
- path(location:project.build.directory)
- }
- project.properties.setProperty('project.build.directory.portable', ant.project.properties.'project.build.directory.portable')
- </source>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.4</version>
- <executions>
- <execution>
- <id>echo-maven-property-after-changing</id>
- <phase>initialize</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <echo message="${project.build.directory.portable}"/>
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </project>
Advertisement
Add Comment
Please, Sign In to add comment