Guest User

lukewpatterson

a guest
Jun 18th, 2010
485
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 2.55 KB | None | 0 0
  1. <project>
  2.   <modelVersion>4.0.0</modelVersion>
  3.   <groupId>some.groupId</groupId>
  4.   <artifactId>some.artifactId</artifactId>
  5.   <version>1-SNAPSHOT</version>
  6.   <name>${project.build.directory.portable}</name>
  7.   <properties>
  8.     <project.build.directory.portable>the_value_resolved_before_any_plugin_runs</project.build.directory.portable>
  9.   </properties>
  10.   <build>
  11.     <plugins>
  12.         <plugin>
  13.           <groupId>org.apache.maven.plugins</groupId>
  14.           <artifactId>maven-antrun-plugin</artifactId>
  15.           <version>1.4</version>
  16.           <executions>
  17.             <execution>
  18.               <id>echo-maven-property-before-changing</id>
  19.               <phase>validate</phase>
  20.               <goals>
  21.                 <goal>run</goal>
  22.               </goals>
  23.               <configuration>
  24.                 <tasks>
  25.                   <echo message="${project.build.directory.portable}"/>
  26.                 </tasks>
  27.               </configuration>
  28.             </execution>
  29.           </executions>
  30.         </plugin>
  31.         <plugin>
  32.           <groupId>org.codehaus.groovy.maven</groupId>
  33.           <artifactId>gmaven-plugin</artifactId>
  34.           <version>1.0</version>
  35.           <executions>
  36.             <execution>
  37.               <id>set-maven-property</id>
  38.               <phase>validate</phase>
  39.               <goals>
  40.                 <goal>execute</goal>
  41.               </goals>
  42.               <configuration>
  43.                 <source>
  44.                   ant.pathconvert(targetos:"unix", property:'project.build.directory.portable') {
  45.                     path(location:project.build.directory)
  46.                   }
  47.                   project.properties.setProperty('project.build.directory.portable', ant.project.properties.'project.build.directory.portable')
  48.                 </source>
  49.               </configuration>
  50.             </execution>
  51.           </executions>
  52.         </plugin>
  53.         <plugin>
  54.           <groupId>org.apache.maven.plugins</groupId>
  55.           <artifactId>maven-antrun-plugin</artifactId>
  56.           <version>1.4</version>
  57.           <executions>
  58.             <execution>
  59.               <id>echo-maven-property-after-changing</id>
  60.               <phase>initialize</phase>
  61.               <goals>
  62.                 <goal>run</goal>
  63.               </goals>
  64.               <configuration>
  65.                 <tasks>
  66.                   <echo message="${project.build.directory.portable}"/>
  67.                 </tasks>
  68.               </configuration>
  69.             </execution>
  70.           </executions>
  71.         </plugin>
  72.     </plugins>
  73.   </build>
  74. </project>
Advertisement
Add Comment
Please, Sign In to add comment