Guest User

Parent properties inside maven antrun plugin

a guest
Feb 23rd, 2012
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. <properties>
  2. <main.basedir>${project.parent.basedir}</main.basedir>
  3. ...
  4. </properties>
  5.  
  6. <plugins>
  7. <plugin>
  8. <artifactId>maven-antrun-plugin</artifactId>
  9. <executions>
  10. <execution>
  11. <id>render-parameter-sql</id>
  12. <phase>validate</phase>
  13. <goals>
  14. <goal>run</goal>
  15. </goals>
  16. <configuration>
  17. <tasks>
  18. <echoproperties/>
  19. </tasks>
  20. </configuration>
  21. </execution>
  22. </executions>
  23. </plugin>
  24. </plugins>
  25.  
  26. main:
  27. [echoproperties] #Ant properties
  28. [echoproperties] #Thu Oct 28 09:32:13 CEST 2010
  29. [echoproperties] ant.core.lib=C:\Users\gaborl\.m2\repository\org\apache\ant\ant\1.8.1\ant-1.8.1.jar
  30. ...
  31. [echoproperties] main.basedir=${project.parent.basedir}
  32. [echoproperties] maven.dependency.antlr.antlr.jar.path=C:\Users\gaborl\.m2\repository\antlr\antlr\2.7.6\antlr-2.7.6.jar
  33.  
  34. <plugin>
  35. <groupId>org.codehaus.gmaven</groupId>
  36. <artifactId>gmaven-plugin</artifactId>
  37. <version>1.3</version>
  38. <executions>
  39. <execution>
  40. <id>set-custom-property</id>
  41. <phase>validate</phase>
  42. <goals>
  43. <goal>execute</goal>
  44. </goals>
  45. <configuration>
  46. <source>
  47. project.properties.setProperty('main.basedir', project.parent.basedir.toString())
  48. </source>
  49. </configuration>
  50. </execution>
  51. </executions>
  52. </plugin>
  53. <plugin>
  54. <artifactId>maven-antrun-plugin</artifactId>
  55. <version>1.6</version>
  56. <executions>
  57. <execution>
  58. <id>render-parameter-sql</id>
  59. <phase>validate</phase>
  60. <goals>
  61. <goal>run</goal>
  62. </goals>
  63. <configuration>
  64. <target>
  65. <echo>project.artifactId : ${project.artifactId}</echo>
  66. <echo>project.parent.basedir : ${project.parent.basedir}</echo>
  67. <echo>main.basedir : ${main.basedir}</echo>
  68. <echo>project.basedir : ${project.basedir}</echo>
  69. <echo>project.build.directory : ${project.build.directory}</echo>
  70. </target>
  71. </configuration>
  72. </execution>
  73. </executions>
  74. </plugin>
Advertisement
Add Comment
Please, Sign In to add comment