Skip to content
Browse files

Importing HEAD sources from https://svn.codehaus.org/groovy/gmaven

  • Loading branch information...
0 parents commit 8c6c548fde2d37648974ba00212030e6e5c1eebf user57 committed Jul 11, 2009
Showing with 19,613 additions and 0 deletions.
  1. +203 −0 LICENSE.txt
  2. +61 −0 README.txt
  3. +47 −0 gmaven-archetypes/gmaven-archetype-basic/pom.xml
  4. +67 −0 gmaven-archetypes/gmaven-archetype-basic/src/main/filtered-resources/archetype-resources/pom.xml
  5. +44 −0 gmaven-archetypes/gmaven-archetype-basic/src/main/resources/META-INF/maven/archetype-metadata.xml
  6. +32 −0 ...ypes/gmaven-archetype-basic/src/main/resources/archetype-resources/src/main/groovy/Example.groovy
  7. +32 −0 ...hetypes/gmaven-archetype-basic/src/main/resources/archetype-resources/src/main/groovy/Helper.java
  8. +35 −0 .../gmaven-archetype-basic/src/main/resources/archetype-resources/src/test/groovy/ExampleTest.groovy
  9. +35 −0 ...s/gmaven-archetype-basic/src/main/resources/archetype-resources/src/test/groovy/HelperTest.groovy
  10. +47 −0 gmaven-archetypes/gmaven-archetype-mojo/pom.xml
  11. +68 −0 gmaven-archetypes/gmaven-archetype-mojo/src/main/filtered-resources/archetype-resources/pom.xml
  12. +44 −0 gmaven-archetypes/gmaven-archetype-mojo/src/main/resources/META-INF/maven/archetype-metadata.xml
  13. +44 −0 ...pes/gmaven-archetype-mojo/src/main/resources/archetype-resources/src/main/groovy/HelloMojo.groovy
  14. +110 −0 gmaven-archetypes/pom.xml
  15. +46 −0 gmaven-common/pom.xml
  16. +138 −0 gmaven-common/src/main/java/org/codehaus/groovy/maven/common/ArtifactItem.java
  17. +143 −0 gmaven-common/src/main/java/org/codehaus/groovy/maven/common/StreamPair.java
  18. +266 −0 gmaven-common/src/main/java/org/codehaus/groovy/maven/common/SystemOutputHijacker.java
  19. +207 −0 gmaven-common/src/test/java/org/codehaus/groovy/maven/common/SystemOutputHijackerTest.java
  20. +70 −0 gmaven-examples/clean-maven-plugin/pom.xml
  21. +1 −0 gmaven-examples/clean-maven-plugin/src/it/clean-1/goals.txt
  22. +48 −0 gmaven-examples/clean-maven-plugin/src/it/clean-1/pom.xml
  23. +29 −0 gmaven-examples/clean-maven-plugin/src/it/clean-1/setup.groovy
  24. +22 −0 gmaven-examples/clean-maven-plugin/src/it/clean-1/validate.groovy
  25. +65 −0 ...ples/clean-maven-plugin/src/main/groovy/org/codehaus/groovy/maven/examples/clean/CleanMojo.groovy
  26. +85 −0 gmaven-examples/install-maven-plugin/pom.xml
  27. +1 −0 gmaven-examples/install-maven-plugin/src/it/install-1/goals.txt
  28. +58 −0 gmaven-examples/install-maven-plugin/src/it/install-1/pom.xml
  29. +23 −0 gmaven-examples/install-maven-plugin/src/it/install-1/setup.groovy
  30. +3 −0 gmaven-examples/install-maven-plugin/src/it/install-1/src/main/java/test.java
  31. 0 gmaven-examples/install-maven-plugin/src/it/install-1/src/main/resources/test
  32. +23 −0 gmaven-examples/install-maven-plugin/src/it/install-1/validate.groovy
  33. +94 −0 ...nstall-maven-plugin/src/main/groovy/org/codehaus/groovy/maven/examples/install/InstallMojo.groovy
  34. +145 −0 ...maven-plugin/src/main/groovy/org/codehaus/groovy/maven/examples/install/InstallMojoSupport.groovy
  35. +83 −0 gmaven-examples/pom.xml
  36. +53 −0 gmaven-feature/gmaven-feature-api/pom.xml
  37. +30 −0 gmaven-feature/gmaven-feature-api/src/main/java/org/codehaus/groovy/maven/feature/Component.java
  38. +41 −0 ...eature/gmaven-feature-api/src/main/java/org/codehaus/groovy/maven/feature/ComponentException.java
  39. +319 −0 gmaven-feature/gmaven-feature-api/src/main/java/org/codehaus/groovy/maven/feature/Configuration.java
  40. +41 −0 ...re/gmaven-feature-api/src/main/java/org/codehaus/groovy/maven/feature/ConfigurationException.java
  41. +40 −0 gmaven-feature/gmaven-feature-api/src/main/java/org/codehaus/groovy/maven/feature/Feature.java
  42. +41 −0 ...-feature/gmaven-feature-api/src/main/java/org/codehaus/groovy/maven/feature/FeatureException.java
  43. +46 −0 gmaven-feature/gmaven-feature-api/src/main/java/org/codehaus/groovy/maven/feature/Provider.java
  44. +41 −0 ...feature/gmaven-feature-api/src/main/java/org/codehaus/groovy/maven/feature/ProviderException.java
  45. +30 −0 ...en-feature/gmaven-feature-api/src/main/java/org/codehaus/groovy/maven/feature/ProviderLoader.java
  46. +34 −0 ...n-feature/gmaven-feature-api/src/main/java/org/codehaus/groovy/maven/feature/ProviderManager.java
  47. +40 −0 ...-feature/gmaven-feature-api/src/main/java/org/codehaus/groovy/maven/feature/ProviderRegistry.java
  48. +34 −0 ...-feature/gmaven-feature-api/src/main/java/org/codehaus/groovy/maven/feature/ProviderSelector.java
  49. +117 −0 gmaven-feature/gmaven-feature-api/src/main/java/org/codehaus/groovy/maven/feature/Version.java
  50. +49 −0 gmaven-feature/gmaven-feature-support/pom.xml
  51. +59 −0 ...ven-feature-support/src/main/java/org/codehaus/groovy/maven/feature/support/ComponentSupport.java
  52. +172 −0 ...maven-feature-support/src/main/java/org/codehaus/groovy/maven/feature/support/FeatureSupport.java
  53. +189 −0 ...aven-feature-support/src/main/java/org/codehaus/groovy/maven/feature/support/ProviderSupport.java
  54. +44 −0 gmaven-feature/pom.xml
  55. +132 −0 gmaven-legacy/groovy-maven-plugin/pom.xml
  56. +42 −0 ...-legacy/groovy-maven-plugin/src/main/java/org/codehaus/groovy/maven/legacy/plugin/LegacyMojo.java
  57. +43 −0 gmaven-legacy/pom.xml
  58. +64 −0 gmaven-mojo-support/pom.xml
  59. +120 −0 gmaven-mojo-support/src/main/groovy/org/codehaus/groovy/maven/mojo/support/ProcessLauncher.groovy
  60. +128 −0 gmaven-mojo-support/src/main/groovy/org/codehaus/groovy/maven/mojo/support/ShellExecutor.groovy
  61. +91 −0 gmaven-mojo/pom.xml
  62. +126 −0 gmaven-mojo/src/main/groovy/org/codehaus/groovy/maven/mojo/GroovyMojo.groovy
  63. +54 −0 gmaven-packaging/pom.xml
  64. +40 −0 gmaven-packaging/src/it/common.xml
  65. +1 −0 gmaven-packaging/src/it/gmaven-plugin-1/goals.txt
  66. +39 −0 gmaven-packaging/src/it/gmaven-plugin-1/pom.xml
  67. +24 −0 gmaven-packaging/src/it/gmaven-plugin-1/validate.groovy
  68. +1 −0 gmaven-packaging/src/it/groovy-jar-1/goals.txt
  69. +39 −0 gmaven-packaging/src/it/groovy-jar-1/pom.xml
  70. +24 −0 gmaven-packaging/src/it/groovy-jar-1/validate.groovy
  71. +147 −0 gmaven-packaging/src/main/resources/META-INF/plexus/components.xml
  72. +270 −0 gmaven-plugin/pom.xml
  73. +1 −0 gmaven-plugin/src/it/anttasks-1/goals.txt
  74. +80 −0 gmaven-plugin/src/it/anttasks-1/pom.xml
  75. +23 −0 gmaven-plugin/src/it/anttasks-1/src/test/groovy/test.groovy
  76. +21 −0 gmaven-plugin/src/it/anttasks-1/validate.groovy
  77. +131 −0 gmaven-plugin/src/it/common.xml
  78. +37 −0 gmaven-plugin/src/it/compile/common.xml
  79. +1 −0 gmaven-plugin/src/it/compile/compile-1/goals.txt
  80. +61 −0 gmaven-plugin/src/it/compile/compile-1/pom.xml
  81. +25 −0 gmaven-plugin/src/it/compile/compile-1/src/main/groovy/Hello.groovy
  82. +27 −0 gmaven-plugin/src/it/compile/compile-1/src/main/groovy/HelloSupport.groovy
  83. +18 −0 gmaven-plugin/src/it/compile/compile-1/src/main/groovy/sayhello.groovy
  84. +33 −0 gmaven-plugin/src/it/compile/compile-1/validate.groovy
  85. +1 −0 gmaven-plugin/src/it/compile/compile-2/goals.txt
  86. +65 −0 gmaven-plugin/src/it/compile/compile-2/pom.xml
  87. +25 −0 gmaven-plugin/src/it/compile/compile-2/src/custom/groovy/DoNotCompileMe.groovy
  88. +27 −0 gmaven-plugin/src/it/compile/compile-2/src/custom/groovy/HelloSupport.groovy
  89. +27 −0 gmaven-plugin/src/it/compile/compile-2/src/custom/groovy/sayhello.groovy
  90. +25 −0 gmaven-plugin/src/it/compile/compile-2/src/main/groovy/DoNotCompileMe.groovy
  91. +33 −0 gmaven-plugin/src/it/compile/compile-2/validate.groovy
  92. +2 −0 gmaven-plugin/src/it/compile/compile-3/goals.txt
  93. +47 −0 gmaven-plugin/src/it/compile/compile-3/pom.xml
  94. +27 −0 gmaven-plugin/src/it/compile/compile-3/src/main/groovy/HelloSupport.groovy
  95. +27 −0 gmaven-plugin/src/it/compile/compile-3/src/main/groovy/sayhello.groovy
  96. +33 −0 gmaven-plugin/src/it/compile/compile-3/validate.groovy
  97. +1 −0 gmaven-plugin/src/it/compile/compile-4/goals.txt
  98. +93 −0 gmaven-plugin/src/it/compile/compile-4/pom.xml
  99. 0 gmaven-plugin/src/it/compile/compile-4/src/main/groovy/Hello.groovy
  100. +27 −0 gmaven-plugin/src/it/compile/compile-4/src/main/groovy/HelloSupport.groovy
  101. +27 −0 gmaven-plugin/src/it/compile/compile-4/src/main/groovy/sayhello.groovy
  102. +1 −0 gmaven-plugin/src/it/compile/generate-stubs-1/goals.txt
  103. +107 −0 gmaven-plugin/src/it/compile/generate-stubs-1/pom.xml
  104. +25 −0 gmaven-plugin/src/it/compile/generate-stubs-1/src/main/groovy/testing/CrackPipe.groovy
  105. +30 −0 gmaven-plugin/src/it/compile/generate-stubs-1/src/main/groovy/testing/CrackPipeSupport.java
  106. +30 −0 gmaven-plugin/src/it/compile/generate-stubs-1/src/main/groovy/testing/DarkCrystal.groovy
  107. +21 −0 gmaven-plugin/src/it/compile/generate-stubs-1/src/main/groovy/testing/HelloScript.groovy
  108. +26 −0 ...n-plugin/src/it/compile/generate-stubs-1/src/main/groovy/testing/YellowTubularSwimmingThingy.java
  109. +1 −0 gmaven-plugin/src/it/compile/generate-stubs-2/goals.txt
  110. +73 −0 gmaven-plugin/src/it/compile/generate-stubs-2/pom.xml
  111. +25 −0 gmaven-plugin/src/it/compile/generate-stubs-2/src/main/groovy/testing/CrackPipe.groovy
  112. +30 −0 gmaven-plugin/src/it/compile/generate-stubs-2/src/main/groovy/testing/CrackPipeSupport.java
  113. +30 −0 gmaven-plugin/src/it/compile/generate-stubs-2/src/main/groovy/testing/DarkCrystal.groovy
  114. +26 −0 ...n-plugin/src/it/compile/generate-stubs-2/src/main/groovy/testing/YellowTubularSwimmingThingy.java
  115. +21 −0 gmaven-plugin/src/it/compile/generate-stubs-2/validate.groovy
  116. +1 −0 gmaven-plugin/src/it/compile/mixed-compile-1/goals.txt
  117. +70 −0 gmaven-plugin/src/it/compile/mixed-compile-1/pom.xml
  118. +28 −0 gmaven-plugin/src/it/compile/mixed-compile-1/src/main/groovy/mgroovy186/Child.groovy
  119. +32 −0 gmaven-plugin/src/it/compile/mixed-compile-1/src/main/groovy/mgroovy186/Parent.java
  120. +25 −0 gmaven-plugin/src/it/compile/mixed-compile-1/src/main/groovy/testing/CrackPipe.groovy
  121. +30 −0 gmaven-plugin/src/it/compile/mixed-compile-1/src/main/groovy/testing/CrackPipeSupport.java
  122. +30 −0 gmaven-plugin/src/it/compile/mixed-compile-1/src/main/groovy/testing/DarkCrystal.groovy
  123. +26 −0 ...en-plugin/src/it/compile/mixed-compile-1/src/main/groovy/testing/YellowTubularSwimmingThingy.java
  124. +34 −0 gmaven-plugin/src/it/compile/mixed-compile-1/src/test/groovy/mgroovy186/ChildTest.groovy
  125. +35 −0 gmaven-plugin/src/it/compile/mixed-compile-1/src/test/groovy/testing/SmokeTest.groovy
  126. +1 −0 gmaven-plugin/src/it/compile/mixed-compile-2/goals.txt
  127. +70 −0 gmaven-plugin/src/it/compile/mixed-compile-2/pom.xml
  128. +25 −0 gmaven-plugin/src/it/compile/mixed-compile-2/src/main/groovy/testing/CrackPipe.groovy
  129. +30 −0 gmaven-plugin/src/it/compile/mixed-compile-2/src/main/groovy/testing/CrackPipeSupport.java
  130. +30 −0 gmaven-plugin/src/it/compile/mixed-compile-2/src/main/groovy/testing/DarkCrystal.groovy
  131. +26 −0 ...en-plugin/src/it/compile/mixed-compile-2/src/main/groovy/testing/YellowTubularSwimmingThingy.java
  132. +35 −0 gmaven-plugin/src/it/compile/mixed-compile-2/src/test/groovy/testing/SmokeTest.groovy
  133. +1 −0 gmaven-plugin/src/it/compile/test-compile-1/goals.txt
  134. +68 −0 gmaven-plugin/src/it/compile/test-compile-1/pom.xml
  135. +28 −0 gmaven-plugin/src/it/compile/test-compile-1/src/test/groovy/SimpleTest.groovy
  136. +30 −0 gmaven-plugin/src/it/compile/test-compile-1/src/test/groovy/TestSupport.groovy
  137. +21 −0 gmaven-plugin/src/it/compile/test-compile-1/validate.groovy
  138. +1 −0 gmaven-plugin/src/it/compile/test-compile-2/goals.txt
  139. +80 −0 gmaven-plugin/src/it/compile/test-compile-2/pom.xml
  140. +30 −0 gmaven-plugin/src/it/compile/test-compile-2/src/main/java/foo/Bar.java
  141. 0 gmaven-plugin/src/it/compile/test-compile-2/src/main/resources/main.txt
  142. +31 −0 gmaven-plugin/src/it/compile/test-compile-2/src/test/groovy/foo/BarTest.groovy
  143. 0 gmaven-plugin/src/it/compile/test-compile-2/src/test/resources/test.txt
  144. +21 −0 gmaven-plugin/src/it/compile/test-compile-2/validate.groovy
  145. +1 −0 gmaven-plugin/src/it/compile/test-compile-3/goals.txt
  146. +73 −0 gmaven-plugin/src/it/compile/test-compile-3/pom.xml
  147. +30 −0 gmaven-plugin/src/it/compile/test-compile-3/src/main/java/foo/Bar.java
  148. 0 gmaven-plugin/src/it/compile/test-compile-3/src/main/resources/main.txt
  149. +31 −0 gmaven-plugin/src/it/compile/test-compile-3/src/test/groovy/foo/BarTest.groovy
  150. 0 gmaven-plugin/src/it/compile/test-compile-3/src/test/resources/test.txt
  151. +21 −0 gmaven-plugin/src/it/compile/test-compile-3/validate.groovy
  152. +1 −0 gmaven-plugin/src/it/compile/test-compile-4/goals.txt
  153. +81 −0 gmaven-plugin/src/it/compile/test-compile-4/pom.xml
  154. +28 −0 gmaven-plugin/src/it/compile/test-compile-4/src/test/groovy/SimpleTest.groovy
  155. +30 −0 gmaven-plugin/src/it/compile/test-compile-4/src/test/groovy/TestSupport.groovy
  156. +37 −0 gmaven-plugin/src/it/execute/common.xml
  157. +1 −0 gmaven-plugin/src/it/execute/execute-defaults/goals.txt
  158. +103 −0 gmaven-plugin/src/it/execute/execute-defaults/pom.xml
  159. +1 −0 gmaven-plugin/src/it/execute/execute-file-1/goals.txt
  160. +58 −0 gmaven-plugin/src/it/execute/execute-file-1/pom.xml
  161. +29 −0 gmaven-plugin/src/it/execute/execute-file-1/src/main/groovy/HelloSupport.groovy
  162. +29 −0 gmaven-plugin/src/it/execute/execute-file-1/src/main/groovy/sayhello.groovy
  163. +1 −0 gmaven-plugin/src/it/execute/execute-file-2/goals.txt
  164. +50 −0 gmaven-plugin/src/it/execute/execute-file-2/pom.xml
  165. +27 −0 gmaven-plugin/src/it/execute/execute-file-2/src/main/groovy/HelloSupport.groovy
  166. +27 −0 gmaven-plugin/src/it/execute/execute-file-2/src/main/groovy/sayhello.groovy
  167. +1 −0 gmaven-plugin/src/it/execute/execute-inline-1/goals.txt
  168. +68 −0 gmaven-plugin/src/it/execute/execute-inline-1/pom.xml
  169. +1 −0 gmaven-plugin/src/it/execute/execute-inline-2/goals.txt
  170. +64 −0 gmaven-plugin/src/it/execute/execute-inline-2/pom.xml
  171. +27 −0 gmaven-plugin/src/it/execute/execute-inline-2/src/main/groovy/HelloSupport.groovy
  172. +1 −0 gmaven-plugin/src/it/execute/execute-props-1/goals.txt
  173. +83 −0 gmaven-plugin/src/it/execute/execute-props-1/pom.xml
  174. +1 −0 gmaven-plugin/src/it/execute/execute-props-2/goals.txt
  175. +86 −0 gmaven-plugin/src/it/execute/execute-props-2/pom.xml
  176. +21 −0 gmaven-plugin/src/it/execute/execute-props-2/test.properties
  177. +1 −0 gmaven-plugin/src/it/execute/execute-props-3/goals.txt
  178. +105 −0 gmaven-plugin/src/it/execute/execute-props-3/pom.xml
  179. +1 −0 gmaven-plugin/src/it/execute/execute-props-4/goals.txt
  180. +102 −0 gmaven-plugin/src/it/execute/execute-props-4/pom.xml
  181. +21 −0 gmaven-plugin/src/it/execute/execute-props-4/test.properties
  182. +1 −0 gmaven-plugin/src/it/execute/execute-props-5/goals.txt
  183. +79 −0 gmaven-plugin/src/it/execute/execute-props-5/module/pom.xml
  184. +49 −0 gmaven-plugin/src/it/execute/execute-props-5/pom.xml
  185. +21 −0 gmaven-plugin/src/it/execute/execute-props-5/test.properties
  186. +1 −0 gmaven-plugin/src/it/execute/execute-props-6/goals.txt
  187. +127 −0 gmaven-plugin/src/it/execute/execute-props-6/pom.xml
  188. +26 −0 gmaven-plugin/src/it/execute/execute-props-6/test.properties
  189. +22 −0 gmaven-plugin/src/it/execute/execute-props-6/validate.groovy
  190. +1 −0 gmaven-plugin/src/it/execute/execute-source/goals.txt
  191. +84 −0 gmaven-plugin/src/it/execute/execute-source/pom.xml
  192. +18 −0 gmaven-plugin/src/it/execute/execute-source/src/main/groovy/test.groovy
  193. +1 −0 gmaven-plugin/src/it/expansion-1/goals.txt
  194. +72 −0 gmaven-plugin/src/it/expansion-1/pom.xml
  195. +21 −0 gmaven-plugin/src/it/expansion-1/validate.groovy
  196. +1 −0 gmaven-plugin/src/it/plexus-descriptor-1/goals.txt
  197. +74 −0 gmaven-plugin/src/it/plexus-descriptor-1/pom.xml
  198. +32 −0 gmaven-plugin/src/it/plexus-descriptor-1/src/main/groovy/ComponentA.groovy
  199. +32 −0 gmaven-plugin/src/it/plexus-descriptor-1/src/main/groovy/testing/ComponentB.groovy
  200. +21 −0 gmaven-plugin/src/it/plexus-descriptor-1/validate.groovy
  201. +63 −0 gmaven-plugin/src/it/script-libraries/app/pom.xml
  202. +1 −0 gmaven-plugin/src/it/script-libraries/goals.txt
  203. +40 −0 gmaven-plugin/src/it/script-libraries/library/pom.xml
  204. +24 −0 gmaven-plugin/src/it/script-libraries/library/src/main/resources/AppImpl.groovy
  205. +30 −0 gmaven-plugin/src/it/script-libraries/library/src/main/resources/AppSupport.groovy
  206. +31 −0 gmaven-plugin/src/it/script-libraries/library/src/main/resources/util/Utils.groovy
  207. +40 −0 gmaven-plugin/src/it/script-libraries/pom.xml
  208. +116 −0 gmaven-plugin/src/main/java/org/codehaus/groovy/maven/plugin/CompileState.java
  209. +157 −0 gmaven-plugin/src/main/java/org/codehaus/groovy/maven/plugin/CompilerMojoSupport.java
  210. +69 −0 gmaven-plugin/src/main/java/org/codehaus/groovy/maven/plugin/ComponentMojoSupport.java
  211. +323 −0 gmaven-plugin/src/main/java/org/codehaus/groovy/maven/plugin/MojoSupport.java
  212. +216 −0 gmaven-plugin/src/main/java/org/codehaus/groovy/maven/plugin/ProviderMojoSupport.java
  213. +209 −0 gmaven-plugin/src/main/java/org/codehaus/groovy/maven/plugin/compile/AbstractCompileMojo.java
  214. +74 −0 gmaven-plugin/src/main/java/org/codehaus/groovy/maven/plugin/compile/CompileMojo.java
  215. +93 −0 gmaven-plugin/src/main/java/org/codehaus/groovy/maven/plugin/compile/TestCompileMojo.java
  216. +385 −0 gmaven-plugin/src/main/java/org/codehaus/groovy/maven/plugin/execute/ExecuteMojo.java
  217. +251 −0 gmaven-plugin/src/main/java/org/codehaus/groovy/maven/plugin/execute/ExpressionEvaluatorImpl.java
  218. +168 −0 gmaven-plugin/src/main/java/org/codehaus/groovy/maven/plugin/execute/GroovyMavenProjectAdapter.java
  219. +622 −0 ...en-plugin/src/main/java/org/codehaus/groovy/maven/plugin/execute/MavenProjectDelegateAdapter.java
  220. +41 −0 gmaven-plugin/src/main/java/org/codehaus/groovy/maven/plugin/execute/Source.java
  221. +68 −0 gmaven-plugin/src/main/java/org/codehaus/groovy/maven/plugin/execute/SourceConverter.java
  222. +178 −0 gmaven-plugin/src/main/java/org/codehaus/groovy/maven/plugin/stubgen/AbstractGenerateStubsMojo.java
  223. +73 −0 gmaven-plugin/src/main/java/org/codehaus/groovy/maven/plugin/stubgen/GenerateStubsMojo.java
  224. +73 −0 gmaven-plugin/src/main/java/org/codehaus/groovy/maven/plugin/stubgen/GenerateTestStubsMojo.java
  225. +69 −0 gmaven-plugin/src/main/java/org/codehaus/groovy/maven/plugin/tools/ConsoleMojo.java
  226. +152 −0 gmaven-plugin/src/main/java/org/codehaus/groovy/maven/plugin/tools/ProvidersMojo.java
  227. +149 −0 gmaven-plugin/src/main/java/org/codehaus/groovy/maven/plugin/tools/ShellMojo.java
  228. +69 −0 gmaven-plugin/src/main/resources/META-INF/plexus/components.xml
  229. +209 −0 gmaven-runtime/gmaven-runtime-1.0/pom.xml
  230. +155 −0 ...gmaven-runtime-1.0/src/main/java/org/codehaus/groovy/maven/runtime/v1_0/ClassCompilerFeature.java
  231. +184 −0 .../gmaven-runtime-1.0/src/main/java/org/codehaus/groovy/maven/runtime/v1_0/ClassFactoryFeature.java
  232. +95 −0 ...ntime/gmaven-runtime-1.0/src/main/java/org/codehaus/groovy/maven/runtime/v1_0/ConsoleFeature.java
  233. +69 −0 ...runtime/gmaven-runtime-1.0/src/main/java/org/codehaus/groovy/maven/runtime/v1_0/ProviderImpl.java
  234. +108 −0 ...maven-runtime-1.0/src/main/java/org/codehaus/groovy/maven/runtime/v1_0/ScriptExecutorFeature.java
  235. +78 −0 ...runtime/gmaven-runtime-1.0/src/main/java/org/codehaus/groovy/maven/runtime/v1_0/ShellFeature.java
  236. +148 −0 .../gmaven-runtime-1.0/src/main/java/org/codehaus/groovy/maven/runtime/v1_0/StubCompilerFeature.java
  237. +40 −0 ...maven-runtime-1.0/src/main/java/org/codehaus/groovy/maven/runtime/v1_0/TraceSanitizerFeature.java
  238. +68 −0 ...en-runtime-1.0/src/main/java/org/codehaus/groovy/maven/runtime/v1_0/stubgen/ModelFactoryImpl.java
  239. +253 −0 ...n-runtime-1.0/src/main/java/org/codehaus/groovy/maven/runtime/v1_0/stubgen/ParserFactoryImpl.java
  240. +50 −0 ...runtime-1.0/src/main/java/org/codehaus/groovy/maven/runtime/v1_0/stubgen/RendererFactoryImpl.java
  241. +55 −0 ...untime-1.0/src/test/java/org/codehaus/groovy/maven/runtime/v1_0/stubgen/ModelFactoryImplTest.java
  242. +90 −0 ...ime-1.0/src/test/java/org/codehaus/groovy/maven/runtime/v1_0/stubgen/RendererFactoryImplTest.java
  243. +43 −0 ...time-1.0/src/test/resources/org/codehaus/groovy/maven/runtime/v1_0/stubgen/SimpleInterface.groovy
  244. +27 −0 ...runtime-1.0/src/test/resources/org/codehaus/groovy/maven/runtime/v1_0/stubgen/SimpleScript.groovy
  245. +240 −0 ...n-runtime-1.0/src/test/resources/org/codehaus/groovy/maven/runtime/v1_0/stubgen/SimpleTest.groovy
  246. +77 −0 gmaven-runtime/gmaven-runtime-1.5/pom.xml
  247. +170 −0 ...gmaven-runtime-1.5/src/main/java/org/codehaus/groovy/maven/runtime/v1_5/ClassCompilerFeature.java
  248. +184 −0 .../gmaven-runtime-1.5/src/main/java/org/codehaus/groovy/maven/runtime/v1_5/ClassFactoryFeature.java
  249. +95 −0 ...ntime/gmaven-runtime-1.5/src/main/java/org/codehaus/groovy/maven/runtime/v1_5/ConsoleFeature.java
  250. +69 −0 ...runtime/gmaven-runtime-1.5/src/main/java/org/codehaus/groovy/maven/runtime/v1_5/ProviderImpl.java
  251. +107 −0 ...maven-runtime-1.5/src/main/java/org/codehaus/groovy/maven/runtime/v1_5/ScriptExecutorFeature.java
  252. +169 −0 ...runtime/gmaven-runtime-1.5/src/main/java/org/codehaus/groovy/maven/runtime/v1_5/ShellFeature.java
  253. +148 −0 .../gmaven-runtime-1.5/src/main/java/org/codehaus/groovy/maven/runtime/v1_5/StubCompilerFeature.java
  254. +40 −0 ...maven-runtime-1.5/src/main/java/org/codehaus/groovy/maven/runtime/v1_5/TraceSanitizerFeature.java
  255. +59 −0 ...en-runtime-1.5/src/main/java/org/codehaus/groovy/maven/runtime/v1_5/stubgen/ModelFactoryImpl.java
  256. +260 −0 ...n-runtime-1.5/src/main/java/org/codehaus/groovy/maven/runtime/v1_5/stubgen/ParserFactoryImpl.java
  257. +50 −0 ...runtime-1.5/src/main/java/org/codehaus/groovy/maven/runtime/v1_5/stubgen/RendererFactoryImpl.java
  258. +55 −0 ...untime-1.5/src/test/java/org/codehaus/groovy/maven/runtime/v1_5/stubgen/ModelFactoryImplTest.java
  259. +90 −0 ...ime-1.5/src/test/java/org/codehaus/groovy/maven/runtime/v1_5/stubgen/RendererFactoryImplTest.java
  260. +43 −0 ...time-1.5/src/test/resources/org/codehaus/groovy/maven/runtime/v1_5/stubgen/SimpleInterface.groovy
  261. +27 −0 ...runtime-1.5/src/test/resources/org/codehaus/groovy/maven/runtime/v1_5/stubgen/SimpleScript.groovy
  262. +239 −0 ...n-runtime-1.5/src/test/resources/org/codehaus/groovy/maven/runtime/v1_5/stubgen/SimpleTest.groovy
  263. +101 −0 gmaven-runtime/gmaven-runtime-1.6/pom.xml
  264. +173 −0 ...gmaven-runtime-1.6/src/main/java/org/codehaus/groovy/maven/runtime/v1_6/ClassCompilerFeature.java
  265. +184 −0 .../gmaven-runtime-1.6/src/main/java/org/codehaus/groovy/maven/runtime/v1_6/ClassFactoryFeature.java
  266. +95 −0 ...ntime/gmaven-runtime-1.6/src/main/java/org/codehaus/groovy/maven/runtime/v1_6/ConsoleFeature.java
  267. +69 −0 ...runtime/gmaven-runtime-1.6/src/main/java/org/codehaus/groovy/maven/runtime/v1_6/ProviderImpl.java
  268. +107 −0 ...maven-runtime-1.6/src/main/java/org/codehaus/groovy/maven/runtime/v1_6/ScriptExecutorFeature.java
  269. +169 −0 ...runtime/gmaven-runtime-1.6/src/main/java/org/codehaus/groovy/maven/runtime/v1_6/ShellFeature.java
  270. +148 −0 .../gmaven-runtime-1.6/src/main/java/org/codehaus/groovy/maven/runtime/v1_6/StubCompilerFeature.java
  271. +40 −0 ...maven-runtime-1.6/src/main/java/org/codehaus/groovy/maven/runtime/v1_6/TraceSanitizerFeature.java
  272. +59 −0 ...en-runtime-1.6/src/main/java/org/codehaus/groovy/maven/runtime/v1_6/stubgen/ModelFactoryImpl.java
  273. +253 −0 ...n-runtime-1.6/src/main/java/org/codehaus/groovy/maven/runtime/v1_6/stubgen/ParserFactoryImpl.java
  274. +50 −0 ...runtime-1.6/src/main/java/org/codehaus/groovy/maven/runtime/v1_6/stubgen/RendererFactoryImpl.java
  275. +31 −0 ...ime-1.6/src/test/java/org/codehaus/groovy/maven/runtime/v1_6/stubgen/AnnotationRenderingTest.java
  276. +31 −0 ...-runtime-1.6/src/test/java/org/codehaus/groovy/maven/runtime/v1_6/stubgen/ClassRenderingTest.java
  277. +31 −0 ...n-runtime-1.6/src/test/java/org/codehaus/groovy/maven/runtime/v1_6/stubgen/EnumRenderingTest.java
  278. +31 −0 ...ntime-1.6/src/test/java/org/codehaus/groovy/maven/runtime/v1_6/stubgen/GenericsRenderingTest.java
  279. +31 −0 ...time-1.6/src/test/java/org/codehaus/groovy/maven/runtime/v1_6/stubgen/InterfaceRenderingTest.java
  280. +89 −0 ...runtime-1.6/src/test/java/org/codehaus/groovy/maven/runtime/v1_6/stubgen/RendererTestSupport.java
  281. +31 −0 ...runtime-1.6/src/test/java/org/codehaus/groovy/maven/runtime/v1_6/stubgen/ScriptRenderingTest.java
  282. +34 −0 ...time-1.6/src/test/resources/org/codehaus/groovy/maven/runtime/v1_6/stubgen/annotations.groovy.txt
  283. +239 −0 ...-runtime-1.6/src/test/resources/org/codehaus/groovy/maven/runtime/v1_6/stubgen/classes.groovy.txt
  284. +50 −0 ...en-runtime-1.6/src/test/resources/org/codehaus/groovy/maven/runtime/v1_6/stubgen/enums.groovy.txt
  285. +26 −0 ...runtime-1.6/src/test/resources/org/codehaus/groovy/maven/runtime/v1_6/stubgen/generics.groovy.txt
  286. +43 −0 ...ntime-1.6/src/test/resources/org/codehaus/groovy/maven/runtime/v1_6/stubgen/interfaces.groovy.txt
  287. +27 −0 ...-runtime-1.6/src/test/resources/org/codehaus/groovy/maven/runtime/v1_6/stubgen/scripts.groovy.txt
  288. +44 −0 gmaven-runtime/gmaven-runtime-api/pom.xml
  289. +68 −0 gmaven-runtime/gmaven-runtime-api/src/main/java/org/codehaus/groovy/maven/runtime/ClassCompiler.java
  290. +41 −0 gmaven-runtime/gmaven-runtime-api/src/main/java/org/codehaus/groovy/maven/runtime/ClassFactory.java
  291. +33 −0 gmaven-runtime/gmaven-runtime-api/src/main/java/org/codehaus/groovy/maven/runtime/Console.java
  292. +36 −0 ...en-runtime/gmaven-runtime-api/src/main/java/org/codehaus/groovy/maven/runtime/ScriptExecutor.java
  293. +60 −0 gmaven-runtime/gmaven-runtime-api/src/main/java/org/codehaus/groovy/maven/runtime/Shell.java
  294. +33 −0 gmaven-runtime/gmaven-runtime-api/src/main/java/org/codehaus/groovy/maven/runtime/StubCompiler.java
  295. +47 −0 ...en-runtime/gmaven-runtime-api/src/main/java/org/codehaus/groovy/maven/runtime/TraceSanitizer.java
  296. +28 −0 gmaven-runtime/gmaven-runtime-api/src/main/java/org/codehaus/groovy/maven/runtime/util/Callable.java
  297. +124 −0 ...-runtime/gmaven-runtime-api/src/main/java/org/codehaus/groovy/maven/runtime/util/ClassSource.java
Sorry, we could not display the entire diff because too many files (477) changed.
203 LICENSE.txt
@@ -0,0 +1,203 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
61 README.txt
@@ -0,0 +1,61 @@
+$Id$
+
+Building
+========
+
+Simply run Maven ;-)
+
+ mvn install
+
+
+Integration Testing
+===================
+
+To invoke integration tests using the SHITTY plugin you need to:
+
+ mvn -Dit
+
+
+Site Generation
+===============
+
+You need to perform a full build first, before site generation will function correctly:
+
+ mvn install site
+
+To generate the full site locally for review:
+
+ mvn install site-deploy -DstageDistributionUrl=file:`pwd`/dist
+
+NOTE: Looks like something is whacky somewhere, and you will *need* to
+ run the site goals with the install goal for the gmaven-examples
+ site to generate correctly.
+
+Release Muck
+============
+
+NOTE: This does not really work ATM, not sure why... but release:prepare barfs
+ while tagging, so have to finish up the rest of the details by hand.
+ Hopefully for the next release I'll get this sorted out... or write my
+ own damn plugin to deal with this crap.
+
+First sanity check:
+
+ mvn -Drelease release:prepare -DdryRun | tee release-prepare-dry.log
+
+If all looks happy, first clean up:
+
+ mvn release:clean
+ rm *.log
+
+And then:
+
+ mvn -Drelease release:prepare | tee release-prepare.log
+ mvn -Drelease release:perform | tee release-perform.log
+
+NOTE: It appears that release:prepare needs -Dusername=xxx and -Dpassword=xxx to
+ work correctly... :-(
+
+The generated website is not deployed as part of the release process ATM, so
+keep the release tree around and run site build from there.
+
47 gmaven-archetypes/gmaven-archetype-basic/pom.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2006-2007 the original author or authors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- $Id$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.codehaus.groovy.maven.archetypes</groupId>
+ <artifactId>gmaven-archetypes</artifactId>
+ <version>1.1-SNAPSHOT</version>
+ </parent>
+
+ <name>GMaven Archetypes :: Basic</name>
+ <artifactId>gmaven-archetype-basic</artifactId>
+ <packaging>maven-archetype</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
67 ...archetypes/gmaven-archetype-basic/src/main/filtered-resources/archetype-resources/pom.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+##
+## Copyright (C) 2006-2008 the original author or authors.
+##
+## Licensed under the Apache License, Version 2.0 (the "License");
+## you may not use this file except in compliance with the License.
+## You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+## $Id$
+##
+<!--
+ Generated from archetype; please customize.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>${groupId}</groupId>
+ <artifactId>${artifactId}</artifactId>
+ <name>${name}</name>
+ <version>${version}</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.codehaus.groovy.maven.runtime</groupId>
+ <artifactId>gmaven-runtime-1.6</artifactId>
+ <version>@project.version@</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.groovy.maven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <version>@project.version@</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generateStubs</goal>
+ <goal>compile</goal>
+ <goal>generateTestStubs</goal>
+ <goal>testCompile</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
44 ...rchetypes/gmaven-archetype-basic/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2006-2007 the original author or authors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- $Id$ -->
+
+<archetype-descriptor name="basic">
+ <requiredProperties>
+ <requiredProperty key="name">
+ <defaultValue>Example Project</defaultValue>
+ </requiredProperty>
+ </requiredProperties>
+
+ <fileSets>
+ <fileSet filtered="true" packaged="true" encoding="UTF-8">
+ <directory>src/main/groovy</directory>
+ <includes>
+ <include>**/*.groovy</include>
+ <include>**/*.java</include>
+ </includes>
+ </fileSet>
+
+ <fileSet filtered="true" packaged="true" encoding="UTF-8">
+ <directory>src/test/groovy</directory>
+ <includes>
+ <include>**/*.groovy</include>
+ <include>**/*.java</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+</archetype-descriptor>
32 ...ven-archetype-basic/src/main/resources/archetype-resources/src/main/groovy/Example.groovy
@@ -0,0 +1,32 @@
+##
+## Copyright (C) 2006-2008 the original author or authors.
+##
+## Licensed under the Apache License, Version 2.0 (the "License");
+## you may not use this file except in compliance with the License.
+## You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+## $Id$
+##
+//
+// Generated from archetype; please customize.
+//
+
+package ${package}
+
+/**
+ * Example Groovy class.
+ */
+class Example
+{
+ def show() {
+ println 'Hello World'
+ }
+}
32 ...gmaven-archetype-basic/src/main/resources/archetype-resources/src/main/groovy/Helper.java
@@ -0,0 +1,32 @@
+##
+## Copyright (C) 2006-2008 the original author or authors.
+##
+## Licensed under the Apache License, Version 2.0 (the "License");
+## you may not use this file except in compliance with the License.
+## You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+## $Id$
+##
+//
+// Generated from archetype; please customize.
+//
+
+package ${package};
+
+/**
+ * Example Java class.
+ */
+public class Helper
+{
+ public void help(final Example example) {
+ example.show();
+ }
+}
35 ...archetype-basic/src/main/resources/archetype-resources/src/test/groovy/ExampleTest.groovy
@@ -0,0 +1,35 @@
+##
+## Copyright (C) 2006-2008 the original author or authors.
+##
+## Licensed under the Apache License, Version 2.0 (the "License");
+## you may not use this file except in compliance with the License.
+## You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+## $Id$
+##
+//
+// Generated from archetype; please customize.
+//
+
+package ${package}
+
+import groovy.util.GroovyTestCase
+
+/**
+ * Tests for the {@link Example} class.
+ */
+class ExampleTest
+ extends GroovyTestCase
+{
+ void testShow() {
+ new Example().show()
+ }
+}
35 ...-archetype-basic/src/main/resources/archetype-resources/src/test/groovy/HelperTest.groovy
@@ -0,0 +1,35 @@
+##
+## Copyright (C) 2006-2008 the original author or authors.
+##
+## Licensed under the Apache License, Version 2.0 (the "License");
+## you may not use this file except in compliance with the License.
+## You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+## $Id$
+##
+//
+// Generated from archetype; please customize.
+//
+
+package ${package}
+
+import groovy.util.GroovyTestCase
+
+/**
+ * Tests for the {@link Helper} class.
+ */
+class HelperTest
+ extends GroovyTestCase
+{
+ void testHelp() {
+ new Helper().help(new Example())
+ }
+}
47 gmaven-archetypes/gmaven-archetype-mojo/pom.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2006-2007 the original author or authors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- $Id$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.codehaus.groovy.maven.archetypes</groupId>
+ <artifactId>gmaven-archetypes</artifactId>
+ <version>1.1-SNAPSHOT</version>
+ </parent>
+
+ <name>GMaven Archetypes :: Mojo</name>
+ <artifactId>gmaven-archetype-mojo</artifactId>
+ <packaging>maven-archetype</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
68 ...-archetypes/gmaven-archetype-mojo/src/main/filtered-resources/archetype-resources/pom.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+##
+## Copyright (C) 2006-2008 the original author or authors.
+##
+## Licensed under the Apache License, Version 2.0 (the "License");
+## you may not use this file except in compliance with the License.
+## You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+## $Id$
+##
+<!--
+ Generated from archetype; please customize.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>${groupId}</groupId>
+ <artifactId>${artifactId}</artifactId>
+ <name>${name}</name>
+ <version>${version}</version>
+ <packaging>maven-plugin</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.codehaus.groovy.maven</groupId>
+ <artifactId>gmaven-mojo</artifactId>
+ <version>@project.version@</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.groovy.maven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <version>@project.version@</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generateStubs</goal>
+ <goal>compile</goal>
+ <goal>generateTestStubs</goal>
+ <goal>testCompile</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
44 ...archetypes/gmaven-archetype-mojo/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2006-2007 the original author or authors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- $Id$ -->
+
+<archetype-descriptor name="basic">
+ <requiredProperties>
+ <requiredProperty key="name">
+ <defaultValue>Example Maven Plugin</defaultValue>
+ </requiredProperty>
+ </requiredProperties>
+
+ <fileSets>
+ <fileSet filtered="true" packaged="true" encoding="UTF-8">
+ <directory>src/main/groovy</directory>
+ <includes>
+ <include>**/*.groovy</include>
+ <include>**/*.java</include>
+ </includes>
+ </fileSet>
+
+ <fileSet filtered="true" packaged="true" encoding="UTF-8">
+ <directory>src/test/groovy</directory>
+ <includes>
+ <include>**/*.groovy</include>
+ <include>**/*.java</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+</archetype-descriptor>
44 ...en-archetype-mojo/src/main/resources/archetype-resources/src/main/groovy/HelloMojo.groovy
@@ -0,0 +1,44 @@
+##
+## Copyright (C) 2006-2008 the original author or authors.
+##
+## Licensed under the Apache License, Version 2.0 (the "License");
+## you may not use this file except in compliance with the License.
+## You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+## $Id$
+##
+//
+// Generated from archetype; please customize.
+//
+
+package ${package}
+
+import org.codehaus.groovy.maven.mojo.GroovyMojo
+
+/**
+ * Example Maven2 Groovy Mojo.
+ *
+ * @goal hello
+ */
+class HelloMojo
+ extends GroovyMojo
+{
+ /**
+ * The hello message to display.
+ *
+ * @parameter expression="${message}" default-value="Hello World"
+ */
+ String message
+
+ void execute() {
+ println "${message}"
+ }
+}
110 gmaven-archetypes/pom.xml
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2006-2007 the original author or authors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- $Id$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.codehaus.groovy.maven</groupId>
+ <artifactId>gmaven</artifactId>
+ <version>1.1-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.codehaus.groovy.maven.archetypes</groupId>
+ <name>GMaven Archetypes</name>
+ <artifactId>gmaven-archetypes</artifactId>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>gmaven-archetype-basic</module>
+ <module>gmaven-archetype-mojo</module>
+ </modules>
+
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-packaging</artifactId>
+ <version>2.0-alpha-2</version>
+ </extension>
+ </extensions>
+
+ <pluginManagement>
+ <plugins>
+ <!--
+ HACK: For some reason maven-archetype-plugin 2.0-alpha-2's artifact hndler for the maven-archetype
+ packaging is not getting resolved properly, causing the archive to be installed with a
+ .maven-archetype extention instead of .jar. So force a .jar artifact to be installed.
+ -->
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>${project.build.directory}/${project.build.finalName}.jar</file>
+ <type>jar</type>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!--
+ Manually filter @project.version@, since the maven-resources-plugin will clobber
+ more ${} things than it should, so *ucking stupid.
+ -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <copy todir="${project.build.outputDirectory}" filtering="true" includeEmptyDirs="false">
+ <fileset dir="${project.basedir}/src/main/filtered-resources">
+ <include name="**" />
+ </fileset>
+ <filterset>
+ <filter token="project.version" value="${project.version}" />
+ </filterset>
+ </copy>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+</project>
46 gmaven-common/pom.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2006-2007 the original author or authors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- $Id$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.codehaus.groovy.maven</groupId>
+ <artifactId>gmaven</artifactId>
+ <version>1.1-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>gmaven-common</artifactId>
+ <name>GMaven Common</name>
+
+ <description>
+ Common components used by the Maven plugin and Mojo support.
+ </description>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
+
138 gmaven-common/src/main/java/org/codehaus/groovy/maven/common/ArtifactItem.java
@@ -0,0 +1,138 @@
+/*
+ * Copyright (C) 2006-2007 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.codehaus.groovy.maven.common;
+
+/**
+ * Represents a Maven-artifact.
+ *
+ * @version $Id$
+ * @author <a href="mailto:jason@planet57.com">Jason Dillon</a>
+ */
+public class ArtifactItem
+{
+ /**
+ * Group Id of artifact.
+ *
+ * @parameter
+ * @required
+ */
+ private String groupId;
+
+ /**
+ * Name of artifact.
+ *
+ * @parameter
+ * @required
+ */
+ private String artifactId;
+
+ /**
+ * Version of artifact.
+ *
+ * @parameter
+ */
+ private String version = null;
+
+ /**
+ * Type of artifact.
+ *
+ * @parameter
+ * @required
+ */
+ private String type = "jar";
+
+ /**
+ * Classifier for artifact.
+ *
+ * @parameter
+ */
+ private String classifier;
+
+ public String toString() {
+ return groupId + ":" + artifactId + ":" + classifier + ":" + version + ":" + type;
+ }
+
+ /**
+ * @return Returns the artifactId.
+ */
+ public String getArtifactId() {
+ return artifactId;
+ }
+
+ /**
+ * @param artifactId The artifactId to set.
+ */
+ public void setArtifactId(final String artifactId) {
+ this.artifactId = artifactId;
+ }
+
+ /**
+ * @return Returns the groupId.
+ */
+ public String getGroupId() {
+ return groupId;
+ }
+
+ /**
+ * @param groupId The groupId to set.
+ */
+ public void setGroupId(final String groupId) {
+ this.groupId = groupId;
+ }
+
+ /**
+ * @return Returns the type.
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * @param type The type to set.
+ */
+ public void setType(final String type) {
+ this.type = type;
+ }
+
+ /**
+ * @return Returns the version.
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * @param version The version to set.
+ */
+ public void setVersion(final String version) {
+ this.version = version;
+ }
+
+ /**
+ * @return Classifier.
+ */
+ public String getClassifier() {
+ return classifier;
+ }
+
+ /**
+ * @param classifier Classifier.
+ */
+ public void setClassifier(final String classifier) {
+ this.classifier = classifier;
+ }
+}
143 gmaven-common/src/main/java/org/codehaus/groovy/maven/common/StreamPair.java
@@ -0,0 +1,143 @@
+/*
+ * Copyright (C) 2007 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License")
+ * you may not use this file except in compliance doWith the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * doWithOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.codehaus.groovy.maven.common;
+
+import java.io.PrintStream;
+
+/**
+ * Contains a pair of {@link PrintStream}.
+ *
+ * @version $Id$
+ * @author <a href="mailto:jason@planet57.com">Jason Dillon</a>
+ */
+public class StreamPair
+{
+ public final PrintStream out;
+
+ public final PrintStream err;
+
+ public final boolean combined;
+
+ public StreamPair(final PrintStream out, final PrintStream err) {
+ assert out != null;
+ assert err != null;
+
+ this.out = out;
+ this.err = err;
+ this.combined = (out == err);
+ }
+
+ public StreamPair(final PrintStream out) {
+ assert out != null;
+
+ this.out = out;
+ this.err = out;
+ this.combined = true;
+ }
+
+ public PrintStream get(final Type type) {
+ assert type != null;
+
+ switch (type.code) {
+ case OUT_CODE:
+ return out;
+
+ case ERR_CODE:
+ return err;
+ }
+
+ // Should never happen
+ throw new InternalError();
+ }
+
+ public String toString() {
+ if (combined) {
+ return "StreamPair{ " + out + ", * }";
+ }
+
+ return "StreamPair{ " + out + ", " + err + " }";
+ }
+
+ public void flush() {
+ out.flush();
+
+ if (!combined) {
+ err.flush();
+ }
+ }
+
+ public void close() {
+ out.close();
+
+ if (!combined) {
+ err.close();
+ }
+ }
+
+ /**
+ * Create a new pair as System is currently configured.
+ */
+ public static StreamPair system() {
+ return new StreamPair(System.out, System.err);
+ }
+
+ /**
+ * Install the given stream pair as the System streams.
+ */
+ public static void system(final StreamPair streams) {
+ assert streams != null;
+
+ System.setOut(streams.out);
+ System.setErr(streams.err);
+ }
+
+ /**
+ * The original System streams (as they were when this class loads).
+ */
+ public static final StreamPair SYSTEM = system();
+
+ /**
+ * Pseudo-enum for a stream type.
+ */
+ public static final class Type
+ {
+ public final String name;
+
+ public final int code;
+
+ private Type(final String name, final int code) {
+ this.name = name;
+ this.code = code;
+ }
+
+ public String toString() {
+ return name;
+ }
+ }
+
+ public static final Type OUT = new Type("OUT", 0);
+
+ public static final String OUT_NAME = "OUT";
+
+ public static final int OUT_CODE = 0;
+
+ public static final Type ERR = new Type("ERR", 1);
+
+ public static final String ERR_NAME = "ERR";
+
+ public static final int ERR_CODE = 1;
+}
266 gmaven-common/src/main/java/org/codehaus/groovy/maven/common/SystemOutputHijacker.java
@@ -0,0 +1,266 @@
+/*
+ * Copyright (C) 2007 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License")
+ * you may not use this file except in compliance doWith the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * doWithOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.codehaus.groovy.maven.common;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+
+/**
+ * Hijacks the systems standard output and error streams on a per-thread basis
+ * and redirects to given streams.
+ *
+ * @version $Id$
+ * @author <a href="mailto:jason@planet57.com">Jason Dillon</a>
+ */
+public class SystemOutputHijacker
+{
+ /**
+ * Contains a {@link StreamRegistration} for the current thread if its registered, else null.
+ */
+ private static final InheritableThreadLocal registrations = new InheritableThreadLocal();
+
+ /**
+ * The previously installed System streams, initialized when installing.
+ */
+ private static StreamPair previous;
+
+ /**
+ * Flag to indicate if the hijacker is installed or not.
+ */
+ private static boolean installed;
+
+ /**
+ * Check if the hijacker has been installed.
+ */
+ public static synchronized boolean isInstalled() {
+ return installed;
+ }
+
+ private static synchronized void ensureInstalled() {
+ if (!isInstalled()) {
+ throw new IllegalStateException("Not installed");
+ }
+ }
+
+ /**
+ * Install the hijacker.
+ */
+ public static synchronized void install() {
+ if (installed) {
+ throw new IllegalStateException("Already installed");
+ }
+
+ // Capture the current set of streams
+ previous = new StreamPair(System.out, System.err);
+
+ // Install our streams
+ System.setOut(new DelegateStream(StreamPair.OUT));
+ System.setErr(new DelegateStream(StreamPair.ERR));
+
+ installed = true;
+ }
+
+ /**
+ * Install the hijacker and register streams for the current thread.
+ */
+ public static synchronized void install(final PrintStream out, final PrintStream err) {
+ install();
+ register(out, err);
+ }
+
+ /**
+ * Install the hijacker and register combinded streams for the current thread.
+ */
+ public static synchronized void install(final PrintStream out) {
+ install();
+ register(out);
+ }
+
+ /**
+ * Uninstall the hijacker.
+ */
+ public static synchronized void uninstall() {
+ ensureInstalled();
+
+ System.setOut(previous.out);
+ System.setErr(previous.err);
+
+ previous = null;
+ installed = false;
+ }
+
+ /**
+ * Get the current stream registration.
+ */
+ private static synchronized StreamRegistration registration(final boolean required) {
+ if (required) {
+ ensureRegistered();
+ }
+
+ return (StreamRegistration)registrations.get();
+ }
+
+ /**
+ * Check if there are streams registered for the current thread.
+ */
+ public static synchronized boolean isRegistered() {
+ return registration(false) != null;
+ }
+
+ private static synchronized void ensureRegistered() {
+ ensureInstalled();
+
+ if (!isRegistered()) {
+ throw new IllegalStateException("Streams not registered for thread: " + Thread.currentThread());
+ }
+ }
+
+ /**
+ * Register streams for the current thread.
+ */
+ public static synchronized void register(final PrintStream out, final PrintStream err) {
+ ensureInstalled();
+
+ StreamRegistration prev = registration(false);
+
+ StreamPair pair = new StreamPair(out, err);
+
+ StreamRegistration next = new StreamRegistration(pair, prev);
+
+ registrations.set(next);
+ }
+
+ /**
+ * Register combinded streams for the current thread.
+ */
+ public static synchronized void register(final PrintStream out) {
+ register(out, out);
+ }
+
+ /**
+ * Register streams for the current thread.
+ */
+ public static synchronized void register(final StreamPair pair) {
+ assert pair != null;
+
+ register(pair.out, pair.err);
+ }
+
+ /**
+ * Reregister streams for the current thread, and restore the previous if any.
+ */
+ public static synchronized void deregister() {
+ StreamRegistration cur = registration(true);
+
+ registrations.set(cur.previous);
+ }
+
+ /**
+ * Stream registration information.
+ */
+ private static class StreamRegistration
+ {
+ public final StreamPair streams;
+
+ public final StreamRegistration previous;
+
+ public StreamRegistration(final StreamPair streams, final StreamRegistration previous) {
+ assert streams != null;
+
+ this.streams = streams;
+ this.previous = previous;
+ }
+ }
+
+ /**
+ * Returns the currently registered streams.
+ */
+ private static synchronized StreamPair current() {
+ StreamRegistration reg = registration(true);
+
+ return reg.streams;
+ }
+
+ /**
+ * Delegates write calls to the currently registered stream.
+ */
+ private static class DelegateStream
+ extends PrintStream
+ {
+ private static final ByteArrayOutputStream NULL_OUTPUT = new ByteArrayOutputStream();
+
+ private final StreamPair.Type type;
+
+ public DelegateStream(final StreamPair.Type type) {
+ super(NULL_OUTPUT);
+
+ assert type != null;
+
+ this.type = type;
+ }
+
+ private PrintStream get() {
+ return current().get(type);
+ }
+
+ public void write(final int b) {
+ get().write(b);
+ }
+
+ public void write(final byte b[]) throws IOException {
+ get().write(b, 0, b.length);
+ }
+
+ public void write(final byte[] b, final int off, final int len) {
+ get().write(b, off, len);
+ }
+
+ public void flush() {
+ get().flush();
+ }
+
+ public void close() {
+ get().close();
+ }
+ }
+
+ //
+ // System Stream Restoration. This stuff needs more testing, not sure its working as I'd like... :-(
+ //
+
+ /**
+ * Restores the System streams to the given pair and resets the hijacker state to uninstalled.
+ */
+ public static synchronized void restore(final StreamPair streams) {
+ assert streams != null;
+
+ StreamPair.system(streams);
+
+ previous = null;
+ installed = false;
+ }
+
+ /**
+ * Restores the original System streams from {@link StreamPair#SYSTEM} and resets
+ * the hijacker state to uninstalled.
+ */
+ public static synchronized void restore() {
+ restore(StreamPair.SYSTEM);
+ }
+
+}
207 gmaven-common/src/test/java/org/codehaus/groovy/maven/common/SystemOutputHijackerTest.java
@@ -0,0 +1,207 @@
+/*
+ * Copyright (C) 2007 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License")
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.codehaus.groovy.maven.common;
+
+import junit.framework.TestCase;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+
+/**
+ * Tests for the {@link SystemOutputHijacker} class.
+ *
+ * @version $Id$
+ * @author <a href="mailto:jason@planet57.com">Jason Dillon</a>
+ */
+public class SystemOutputHijackerTest
+ extends TestCase
+{
+ private ByteArrayOutputStream buff;
+
+ private PrintStream out;
+
+ protected void setUp() throws Exception {
+ buff = new ByteArrayOutputStream();
+ out = new PrintStream(buff);
+
+ assertFalse(SystemOutputHijacker.isInstalled());
+ }
+
+ protected void tearDown() throws Exception {
+ buff = null;
+ out = null;
+
+ assertFalse(SystemOutputHijacker.isInstalled());
+ }
+
+ private void installOut() throws Exception {
+ assertFalse(SystemOutputHijacker.isRegistered());
+
+ SystemOutputHijacker.install(out);
+
+ assertTrue(SystemOutputHijacker.isInstalled());
+ assertTrue(SystemOutputHijacker.isRegistered());
+ }
+
+ private void deregisterAndUninstall() throws Exception {
+ SystemOutputHijacker.deregister();
+
+ assertFalse(SystemOutputHijacker.isRegistered());
+
+ SystemOutputHijacker.uninstall();
+
+ assertFalse(SystemOutputHijacker.isInstalled());
+ }
+
+ public void testInstallWithStream() throws Exception {
+ System.out.println("before");
+
+ installOut();
+
+ try {
+ System.out.print("hijacked");
+ }
+ finally {
+ deregisterAndUninstall();
+ }
+
+ System.out.println("after");
+
+ String msg = new String(buff.toByteArray());
+
+ assertEquals("hijacked", msg);
+ }
+
+ public void testInstallRegisterWithStream() throws Exception {
+ System.out.println("before");
+
+ SystemOutputHijacker.install();
+ assertTrue(SystemOutputHijacker.isInstalled());
+
+ assertFalse(SystemOutputHijacker.isRegistered());
+ SystemOutputHijacker.register(out);
+ assertTrue(SystemOutputHijacker.isRegistered());
+
+ try {
+ System.out.print("hijacked");
+ }
+ finally {
+ deregisterAndUninstall();
+ }
+
+ System.out.println("after");
+
+ String msg = new String(buff.toByteArray());
+
+ assertEquals("hijacked", msg);
+ }
+
+ public void testDualStreams() throws Exception {
+ ByteArrayOutputStream errBuff = new ByteArrayOutputStream();
+ PrintStream err = new PrintStream(errBuff);
+
+ System.out.println("before");
+ System.err.println("BEFORE");
+
+ SystemOutputHijacker.install(out, err);
+
+ assertTrue(SystemOutputHijacker.isInstalled());
+ assertTrue(SystemOutputHijacker.isRegistered());
+
+ try {
+ System.out.print("hijacked");
+ System.err.print("HIJACKED");
+ }
+ finally {
+ deregisterAndUninstall();
+ }
+
+ System.out.println("after");
+ System.err.println("AFTER");
+
+ assertEquals("hijacked", new String(buff.toByteArray()));
+ assertEquals("HIJACKED", new String(errBuff.toByteArray()));
+ }
+
+ public void testChildThreads() throws Exception {
+ System.out.println("before");
+
+ installOut();
+
+ Runnable task = new Runnable() {
+ public void run() {
+ System.out.print("hijacked");
+ }
+ };
+
+ try {
+ System.out.print("<");
+
+ Thread t = new Thread(task);
+ t.start();
+ t.join();
+
+ System.out.print(">");
+ }
+ finally {
+ deregisterAndUninstall();
+ }
+
+ System.out.println("after");
+
+ String msg = new String(buff.toByteArray());
+
+ assertEquals("<hijacked>", msg);
+ }
+
+ public void testNestedRegistration() throws Exception {
+ System.out.println("before");
+
+ installOut();
+
+ try {
+ System.out.print("hijacked");
+
+ ByteArrayOutputStream childBuff = new ByteArrayOutputStream();
+ PrintStream childOut = new PrintStream(childBuff);
+
+ System.out.print("!");
+
+ SystemOutputHijacker.register(childOut);
+
+ try {
+ System.out.print("child");
+ }
+ finally {
+ SystemOutputHijacker.deregister();
+ }
+
+ System.out.print("!");
+
+ assertEquals("child", new String(childBuff.toByteArray()));
+ }
+ finally {
+ deregisterAndUninstall();
+ }
+
+ System.out.println("after");
+
+ String msg = new String(buff.toByteArray());
+
+ assertEquals("hijacked!!", msg);
+ }
+}
70 gmaven-examples/clean-maven-plugin/pom.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2006-2007 the original author or authors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- $Id$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.codehaus.groovy.maven.examples</groupId>
+ <artifactId>gmaven-examples</artifactId>
+ <version>1.1-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>clean-maven-plugin</artifactId>
+ <name>GMaven Examples :: Clean Maven Plugin</name>
+ <packaging>maven-plugin</packaging>
+
+ <description>
+ Cleans up generated build artifacts.
+ </description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.codehaus.groovy.maven</groupId>
+ <artifactId>gmaven-mojo</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>file-management</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.groovy.maven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generateStubs</goal>
+ <goal>compile</goal>
+ <goal>generateTestStubs</goal>
+ <goal>testCompile</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
+
1 gmaven-examples/clean-maven-plugin/src/it/clean-1/goals.txt
@@ -0,0 +1 @@
+package
48 gmaven-examples/clean-maven-plugin/src/it/clean-1/pom.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2006-2007 the original author or authors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.