Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[maven-scm] copy for tag maven-archetype-2.0-alpha-5

  • Loading branch information...
commit 2d49fe403a6d39b92d76dbfa6c3b0eb0ae11b1e2 2 parents 33de113 + e3024fc
@hboutemy hboutemy authored
Showing with 15,699 additions and 12,638 deletions.
  1. +5 −5 NOTICE.txt
  2. +64 −63 archetype-common/pom.xml
  3. +6 −4 archetype-common/src/main/java/org/apache/maven/archetype/ArchetypeCreationRequest.java
  4. +2 −2 archetype-common/src/main/java/org/apache/maven/archetype/ArchetypeCreationResult.java
  5. +32 −32 archetype-common/src/main/java/org/apache/maven/archetype/ArchetypeGenerationRequest.java
  6. +3 −3 archetype-common/src/main/java/org/apache/maven/archetype/ArchetypeGenerationResult.java
  7. +11 −11 archetype-common/src/main/java/org/apache/maven/archetype/{Archetype.java → ArchetypeManager.java}
  8. +26 −26 ...common/src/main/java/org/apache/maven/archetype/{DefaultArchetype.java → DefaultArchetypeManager.java}
  9. +145 −145 archetype-common/src/main/java/org/apache/maven/archetype/common/ArchetypeArtifactManager.java
  10. +87 −87 archetype-common/src/main/java/org/apache/maven/archetype/common/ArchetypeFilesResolver.java
  11. +77 −77 archetype-common/src/main/java/org/apache/maven/archetype/common/ArchetypeRegistryManager.java
  12. +92 −92 archetype-common/src/main/java/org/apache/maven/archetype/common/Constants.java
  13. +304 −399 archetype-common/src/main/java/org/apache/maven/archetype/common/DefaultArchetypeArtifactManager.java
  14. +476 −482 archetype-common/src/main/java/org/apache/maven/archetype/common/DefaultArchetypeFilesResolver.java
  15. +225 −232 archetype-common/src/main/java/org/apache/maven/archetype/common/DefaultArchetypeRegistryManager.java
  16. +521 −576 archetype-common/src/main/java/org/apache/maven/archetype/common/DefaultPomManager.java
  17. +3,193 −3,193 archetype-common/src/main/java/org/apache/maven/archetype/common/MavenJDOMWriter.java
  18. +70 −70 archetype-common/src/main/java/org/apache/maven/archetype/common/PomManager.java
  19. +2 −2 archetype-common/src/main/java/org/apache/maven/archetype/common/util/FileCharsetDetector.java
  20. +14 −22 archetype-common/src/main/java/org/apache/maven/archetype/common/util/Format.java
  21. +8 −2 archetype-common/src/main/java/org/apache/maven/archetype/common/util/ListScanner.java
  22. +2 −1  archetype-common/src/main/java/org/apache/maven/archetype/common/util/NamespaceStack.java
  23. +2 −2 archetype-common/src/main/java/org/apache/maven/archetype/common/util/PathUtils.java
  24. +39 −44 archetype-common/src/main/java/org/apache/maven/archetype/common/util/XMLOutputter.java
  25. +6 −4 archetype-common/src/main/java/org/apache/maven/archetype/creator/ArchetypeCreator.java
  26. +694 −1,148 archetype-common/src/main/java/org/apache/maven/archetype/creator/FilesetArchetypeCreator.java
  27. +0 −152 archetype-common/src/main/java/org/apache/maven/archetype/creator/olddescriptor/OldArchetypeDescriptor.java
  28. +0 −147 ...common/src/main/java/org/apache/maven/archetype/creator/olddescriptor/OldArchetypeDescriptorXpp3Writer.java
  29. +34 −22 archetype-common/src/main/java/org/apache/maven/archetype/downloader/DefaultDownloader.java
  30. +20 −2 archetype-common/src/main/java/org/apache/maven/archetype/downloader/DownloadException.java
  31. +20 −2 archetype-common/src/main/java/org/apache/maven/archetype/downloader/DownloadNotFoundException.java
  32. +23 −12 archetype-common/src/main/java/org/apache/maven/archetype/downloader/Downloader.java
  33. +2 −2 ...type-common/src/main/java/org/apache/maven/archetype/exception/ArchetypeGenerationConfigurationFailure.java
  34. +2 −2 archetype-common/src/main/java/org/apache/maven/archetype/exception/ArchetypeGenerationFailure.java
  35. +5 −4 archetype-common/src/main/java/org/apache/maven/archetype/exception/ArchetypeNotConfigured.java
  36. +44 −44 archetype-common/src/main/java/org/apache/maven/archetype/exception/ArchetypeNotDefined.java
  37. +2 −2 archetype-common/src/main/java/org/apache/maven/archetype/exception/ArchetypeSelectionFailure.java
  38. +2 −2 archetype-common/src/main/java/org/apache/maven/archetype/exception/InvalidPackaging.java
  39. +2 −2 archetype-common/src/main/java/org/apache/maven/archetype/exception/OutputFileExists.java
  40. +2 −2 archetype-common/src/main/java/org/apache/maven/archetype/exception/PomFileExists.java
  41. +2 −2 archetype-common/src/main/java/org/apache/maven/archetype/exception/ProjectDirectoryExists.java
  42. +2 −2 archetype-common/src/main/java/org/apache/maven/archetype/exception/TemplateCreationException.java
  43. +2 −2 archetype-common/src/main/java/org/apache/maven/archetype/exception/UnknownArchetype.java
  44. +2 −2 archetype-common/src/main/java/org/apache/maven/archetype/exception/UnknownGroup.java
  45. +6 −3 archetype-common/src/main/java/org/apache/maven/archetype/generator/ArchetypeGenerator.java
  46. +121 −198 archetype-common/src/main/java/org/apache/maven/archetype/generator/DefaultArchetypeGenerator.java
  47. +232 −482 archetype-common/src/main/java/org/apache/maven/archetype/generator/DefaultFilesetArchetypeGenerator.java
  48. +4 −11 archetype-common/src/main/java/org/apache/maven/archetype/generator/FilesetArchetypeGenerator.java
  49. +16 −13 archetype-common/src/main/java/org/apache/maven/archetype/old/ArchetypeDescriptorException.java
  50. +16 −13 archetype-common/src/main/java/org/apache/maven/archetype/old/ArchetypeNotFoundException.java
  51. +16 −13 archetype-common/src/main/java/org/apache/maven/archetype/old/ArchetypeTemplateProcessingException.java
  52. +79 −59 archetype-common/src/main/java/org/apache/maven/archetype/old/DefaultOldArchetype.java
  53. +27 −16 archetype-common/src/main/java/org/apache/maven/archetype/old/OldArchetype.java
  54. +14 −11 archetype-common/src/main/java/org/apache/maven/archetype/old/descriptor/ArchetypeDescriptor.java
  55. +14 −11 archetype-common/src/main/java/org/apache/maven/archetype/old/descriptor/ArchetypeDescriptorBuilder.java
  56. +14 −11 archetype-common/src/main/java/org/apache/maven/archetype/old/descriptor/ArchetypeDescriptorGenerator.java
  57. +14 −11 archetype-common/src/main/java/org/apache/maven/archetype/old/descriptor/TemplateDescriptor.java
  58. +8 −7 archetype-common/src/main/java/org/apache/maven/archetype/repositorycrawler/DefaultRepositoryCrawler.java
  59. +4 −4 archetype-common/src/main/java/org/apache/maven/archetype/repositorycrawler/RepositoryCrawler.java
  60. +19 −0 archetype-common/src/main/java/org/apache/maven/archetype/source/ArchetypeDataSink.java
  61. +19 −0 archetype-common/src/main/java/org/apache/maven/archetype/source/ArchetypeDataSinkException.java
  62. +2 −2 archetype-common/src/main/java/org/apache/maven/archetype/source/ArchetypeDataSource.java
  63. +2 −2 archetype-common/src/main/java/org/apache/maven/archetype/source/ArchetypeDataSourceDescriptor.java
  64. +2 −2 archetype-common/src/main/java/org/apache/maven/archetype/source/ArchetypeDataSourceException.java
  65. +19 −0 archetype-common/src/main/java/org/apache/maven/archetype/source/CatalogArchetypeDataSink.java
  66. +22 −9 archetype-common/src/main/java/org/apache/maven/archetype/source/CatalogArchetypeDataSource.java
  67. +24 −9 archetype-common/src/main/java/org/apache/maven/archetype/source/InternalCatalogArchetypeDataSource.java
  68. +47 −22 archetype-common/src/main/java/org/apache/maven/archetype/source/RemoteCatalogArchetypeDataSource.java
  69. +159 −138 archetype-common/src/main/mdo/archetype-catalog.mdo
  70. +228 −301 archetype-common/src/main/mdo/archetype-common.mdo
  71. +209 −183 archetype-common/src/main/mdo/archetype-descriptor.mdo
  72. +60 −53 archetype-common/src/main/mdo/archetype-registry.mdo
  73. +70 −14 archetype-common/src/main/mdo/archetype.mdo
  74. +94 −16 archetype-common/src/main/resources/archetype-catalog.xml
  75. +3 −0  archetype-common/src/main/resources/org/apache/maven/archetype/creator/archetype.properties
  76. 0  archetype-common/src/main/resources/org/apache/maven/archetype/creator/goal.txt
  77. +22 −0 archetype-common/src/main/resources/org/apache/maven/archetype/creator/pom-prototype.xml
  78. +46 −0 archetype-common/src/site/apt/internal.apt
  79. +37 −0 archetype-common/src/site/site.xml
  80. +10 −1 archetype-common/src/test/archetypes/basic-1.0/archetype-resources/pom.xml
  81. +1 −1  archetype-common/src/test/archetypes/fileset-1.0/archetype-resources/pom.xml
  82. +1 −1  archetype-common/src/test/archetypes/fileset-1.0/archetype-resources/subproject/pom.xml
  83. +1 −1  archetype-common/src/test/archetypes/fileset-1.0/archetype-resources/subproject/subsubproject/pom.xml
  84. +6 −1 archetype-common/src/test/archetypes/old-1.0/archetype-resources/pom.xml
  85. +1 −1  archetype-common/src/test/archetypes/partial-1.0/archetype-resources/pom.xml
  86. +1 −1  archetype-common/src/test/archetypes/site-1.0/archetype-resources/pom.xml
  87. +12 −20 archetype-common/src/test/java/org/apache/maven/archetype/ArchetypeCatalogsTest.java
  88. +71 −0 archetype-common/src/test/java/org/apache/maven/archetype/common/TestDefaultArchetypeFilesResolver.java
  89. +31 −51 archetype-common/src/test/java/org/apache/maven/archetype/creator/DefaultArchetypeCreatorTest.java
  90. +269 −632 archetype-common/src/test/java/org/apache/maven/archetype/generator/DefaultArchetypeGeneratorTest.java
  91. +83 −44 archetype-common/src/test/java/org/apache/maven/archetype/old/ArchetypeTest.java
  92. +0 −30 archetype-common/src/test/java/org/apache/maven/archetype/source/CatalogArchetypeDataSinkTest.java
  93. +28 −33 archetype-common/src/test/java/org/apache/maven/archetype/{test → source}/WikiArchetypeDataSource.java
  94. +57 −8 archetype-common/src/test/java/org/apache/maven/archetype/source/WikiArchetypeDataSourceTest.java
  95. +10 −9 archetype-common/src/test/java/org/apache/maven/archetype/test/ArchetypeGenerationTest.java
  96. +60 −60 archetype-common/src/test/java/org/apache/maven/archetype/test/ArchetyperRoundtripTest.java
  97. +44 −42 archetype-common/src/test/java/org/apache/maven/archetype/test/ArchetyperRoundtripWithProxyTest.java
  98. +63 −40 archetype-common/src/test/java/org/apache/maven/archetype/test/InternalCatalogArchetypesVerification.java
  99. +226 −117 archetype-common/src/test/java/org/apache/maven/archetype/test/InternalCatalogFromWiki.java
  100. +118 −104 archetype-common/src/test/java/org/apache/maven/archetype/test/RoundtripMultiModuleTest.java
  101. +1 −1  archetype-common/src/test/resources/projects/create-1/pom.xml.sample
  102. +1 −1  archetype-common/src/test/resources/projects/create-2/pom.xml.sample
  103. +1 −1  archetype-common/src/test/resources/projects/create-3/pom.xml.sample
  104. +1 −1  archetype-common/src/test/resources/projects/generate-5/pom.xml.sample
  105. +1 −1  archetype-common/src/test/resources/projects/generate-7/pom.xml.sample
  106. +1 −1  archetype-common/src/test/resources/projects/generate-8/file-value/pom.xml.sample
  107. +1 −1  archetype-common/src/test/resources/projects/generate-8/pom.xml.sample
  108. +1 −1  archetype-common/src/test/resources/projects/generate-9/file-value/pom.xml.sample
  109. +1 −1  archetype-common/src/test/resources/projects/generate-9/pom.xml.sample
  110. +91 −0 archetype-common/src/test/resources/wiki/wiki-source.txt
  111. +0 −123 archetype-common/src/test/sources/wiki/wiki-source.txt
  112. +22 −1 archetype-packaging/pom.xml
  113. +28 −0 archetype-packaging/src/site/site.xml
  114. +22 −38 archetype-plugin/pom.xml
  115. +84 −91 archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/AddArchetypeMetadataMojo.java
  116. +51 −53 archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/CleanMojo.java
  117. +10 −10 archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/CrawlRepositoryMojo.java
  118. +59 −69 archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/CreateArchetypeFromProjectMojo.java
  119. +24 −24 archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/CreateProjectFromArchetypeMojo.java
  120. +283 −316 archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/IntegrationTestMojo.java
  121. +8 −7 archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/JarMojo.java
  122. +31 −41 archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/MavenArchetypeMojo.java
  123. +30 −27 archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/UpdateLocalCatalogMojo.java
  124. +5 −15 archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeCreationConfigurator.java
  125. +14 −26 archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeCreationQueryer.java
  126. +10 −18 archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeFactory.java
  127. +5 −12 archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeGenerationConfigurator.java
  128. +3 −6 archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeGenerationQueryer.java
  129. +29 −27 archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypePrompter.java
  130. +5 −5 archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeSelectionQueryer.java
  131. +3 −8 archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeSelector.java
  132. +61 −133 archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeCreationConfigurator.java
  133. +24 −39 archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeCreationQueryer.java
  134. +373 −371 archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeFactory.java
  135. +67 −53 archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeGenerationConfigurator.java
  136. +8 −12 archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeGenerationQueryer.java
  137. +46 −41 archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelectionQueryer.java
  138. +120 −112 archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelector.java
  139. +9 −9 archetype-plugin/src/site/apt/advanced-usage.apt
  140. +1 −1  archetype-plugin/src/site/apt/examples/create-with-property-file.apt
  141. +20 −24 archetype-plugin/src/site/apt/index.apt
  142. +26 −26 archetype-plugin/src/site/apt/specification/archetype-catalog.apt
  143. +38 −37 archetype-plugin/src/site/apt/specification/archetype-metadata.apt
  144. +18 −18 archetype-plugin/src/site/apt/specification/archetype.apt
  145. +17 −18 archetype-plugin/src/site/apt/specification/create-from-project.apt
  146. +33 −32 archetype-plugin/src/site/apt/specification/generate.apt
  147. +9 −9 archetype-plugin/src/site/apt/specification/specification.apt
  148. +6 −31 archetype-plugin/src/site/site.xml
  149. +32 −32 archetype-plugin/src/test/projects/deep-inheritence/a/b/pom.xml
  150. +37 −37 archetype-plugin/src/test/projects/deep-inheritence/a/pom.xml
  151. +40 −40 archetype-plugin/src/test/projects/deep-inheritence/pom.xml
  152. +33 −33 archetype-plugin/src/test/projects/sibling-dependency/a/pom.xml
  153. +41 −41 archetype-plugin/src/test/projects/sibling-dependency/b/pom.xml
  154. +41 −41 archetype-plugin/src/test/projects/sibling-dependency/pom.xml
  155. +120 −120 archetype-plugin/src/test/projects/simple-inheritence/enforcer-rules/pom.xml
  156. +122 −122 archetype-plugin/src/test/projects/simple-inheritence/pom.xml
  157. +22 −1 archetype-testing/archetype-proxy/pom.xml
  158. +22 −1 archetype-testing/archetype-repository/pom.xml
  159. +23 −2 archetype-testing/pom.xml
  160. +28 −0 archetype-testing/src/site/site.xml
  161. +46 −0 maven-archetype-bundles/maven-archetype-archetype/pom.xml
  162. +13 −0 maven-archetype-bundles/maven-archetype-archetype/src/main/resources/META-INF/maven/archetype.xml
  163. +35 −0 maven-archetype-bundles/maven-archetype-archetype/src/main/resources/archetype-resources/pom.xml
  164. +11 −0 ...-archetype-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/maven/archetype.xml
  165. +17 −0 ...n-archetype-archetype/src/main/resources/archetype-resources/src/main/resources/archetype-resources/pom.xml
  166. +13 −0 ...hetype/src/main/resources/archetype-resources/src/main/resources/archetype-resources/src/main/java/App.java
  167. +38 −0 ...pe/src/main/resources/archetype-resources/src/main/resources/archetype-resources/src/test/java/AppTest.java
  168. +3 −0  ...ype-resources/src/main/resources/archetype-resources/src/test/resources/projects/basic/archetype.properties
  169. 0  ...urces/archetype-resources/src/main/resources/archetype-resources/src/test/resources/projects/basic/goal.txt
  170. +27 −0 maven-archetype-bundles/maven-archetype-archetype/src/site/site.xml
  171. +3 −0  maven-archetype-bundles/maven-archetype-archetype/src/test/resources/projects/basic/archetype.properties
  172. 0  maven-archetype-bundles/maven-archetype-archetype/src/test/resources/projects/basic/goal.txt
  173. +46 −0 maven-archetype-bundles/maven-archetype-j2ee-simple/pom.xml
  174. +18 −0 maven-archetype-bundles/maven-archetype-j2ee-simple/src/main/resources/META-INF/maven/archetype.xml
  175. +53 −0 maven-archetype-bundles/maven-archetype-j2ee-simple/src/main/resources/archetype-resources/ear/pom.xml
  176. +43 −0 maven-archetype-bundles/maven-archetype-j2ee-simple/src/main/resources/archetype-resources/ejbs/pom.xml
  177. 0  ...n-archetype-j2ee-simple/src/main/resources/archetype-resources/ejbs/src/main/resources/META-INF/ejb-jar.xml
  178. +72 −0 maven-archetype-bundles/maven-archetype-j2ee-simple/src/main/resources/archetype-resources/pom.xml
  179. +36 −0 ...archetype-bundles/maven-archetype-j2ee-simple/src/main/resources/archetype-resources/primary-source/pom.xml
  180. +16 −0 ...chetype-bundles/maven-archetype-j2ee-simple/src/main/resources/archetype-resources/projects/logging/pom.xml
  181. +21 −0 maven-archetype-bundles/maven-archetype-j2ee-simple/src/main/resources/archetype-resources/projects/pom.xml
  182. +22 −0 maven-archetype-bundles/maven-archetype-j2ee-simple/src/main/resources/archetype-resources/servlets/pom.xml
  183. +24 −0 ...chetype-bundles/maven-archetype-j2ee-simple/src/main/resources/archetype-resources/servlets/servlet/pom.xml
  184. 0  ...chetype-j2ee-simple/src/main/resources/archetype-resources/servlets/servlet/src/main/webapp/WEB-INF/web.xml
  185. +5 −0 ...ven-archetype-j2ee-simple/src/main/resources/archetype-resources/servlets/servlet/src/main/webapp/index.jsp
  186. +27 −0 maven-archetype-bundles/maven-archetype-j2ee-simple/src/site/site.xml
  187. +3 −0  maven-archetype-bundles/maven-archetype-j2ee-simple/src/test/resources/projects/basic/archetype.properties
  188. 0  maven-archetype-bundles/maven-archetype-j2ee-simple/src/test/resources/projects/basic/goal.txt
  189. +2 −0  maven-archetype-bundles/maven-archetype-mojo/README.txt
  190. +46 −0 maven-archetype-bundles/maven-archetype-mojo/pom.xml
  191. +8 −0 maven-archetype-bundles/maven-archetype-mojo/src/main/resources/META-INF/maven/archetype.xml
  192. +30 −0 maven-archetype-bundles/maven-archetype-mojo/src/main/resources/archetype-resources/pom.xml
  193. +81 −0 maven-archetype-bundles/maven-archetype-mojo/src/main/resources/archetype-resources/src/main/java/MyMojo.java
  194. +27 −0 maven-archetype-bundles/maven-archetype-mojo/src/site/site.xml
  195. +3 −0  maven-archetype-bundles/maven-archetype-mojo/src/test/resources/projects/basic/archetype.properties
  196. 0  maven-archetype-bundles/maven-archetype-mojo/src/test/resources/projects/basic/goal.txt
  197. +47 −0 maven-archetype-bundles/maven-archetype-plugin-site/pom.xml
  198. +12 −0 maven-archetype-bundles/maven-archetype-plugin-site/src/main/resources/META-INF/maven/archetype.xml
  199. +23 −0 maven-archetype-bundles/maven-archetype-plugin-site/src/main/resources/archetype-resources/pom.xml
  200. +34 −0 ...undles/maven-archetype-plugin-site/src/main/resources/archetype-resources/src/site/apt/examples/example.apt
  201. +30 −0 ...archetype-bundles/maven-archetype-plugin-site/src/main/resources/archetype-resources/src/site/apt/index.apt
  202. +21 −0 ...archetype-bundles/maven-archetype-plugin-site/src/main/resources/archetype-resources/src/site/apt/usage.apt
  203. +40 −0 maven-archetype-bundles/maven-archetype-plugin-site/src/main/resources/archetype-resources/src/site/site.xml
  204. +27 −0 maven-archetype-bundles/maven-archetype-plugin-site/src/site/site.xml
  205. +3 −0  maven-archetype-bundles/maven-archetype-plugin-site/src/test/resources/projects/basic/archetype.properties
  206. 0  maven-archetype-bundles/maven-archetype-plugin-site/src/test/resources/projects/basic/goal.txt
  207. +46 −0 maven-archetype-bundles/maven-archetype-plugin/pom.xml
  208. +7 −0 maven-archetype-bundles/maven-archetype-plugin/src/main/resources/META-INF/maven/archetype.xml
  209. +30 −0 maven-archetype-bundles/maven-archetype-plugin/src/main/resources/archetype-resources/pom.xml
  210. +81 −0 ...n-archetype-bundles/maven-archetype-plugin/src/main/resources/archetype-resources/src/main/java/MyMojo.java
  211. +27 −0 maven-archetype-bundles/maven-archetype-plugin/src/site/site.xml
  212. +46 −0 maven-archetype-bundles/maven-archetype-portlet/pom.xml
  213. +17 −0 maven-archetype-bundles/maven-archetype-portlet/src/main/resources/META-INF/maven/archetype.xml
  214. +53 −0 maven-archetype-bundles/maven-archetype-portlet/src/main/resources/archetype-resources/pom.xml
  215. +73 −0 ...chetype-bundles/maven-archetype-portlet/src/main/resources/archetype-resources/src/main/java/MyPortlet.java
  216. +36 −0 ...-archetype-bundles/maven-archetype-portlet/src/main/resources/archetype-resources/src/main/jetspeed/web.xml
  217. +30 −0 ...-bundles/maven-archetype-portlet/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/portlet.xml
  218. +104 −0 ...dles/maven-archetype-portlet/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/tld/portlet.tld
  219. +36 −0 ...type-bundles/maven-archetype-portlet/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
  220. +3 −0  ...n-archetype-bundles/maven-archetype-portlet/src/main/resources/archetype-resources/src/main/webapp/help.jsp
  221. +3 −0  ...hetype-bundles/maven-archetype-portlet/src/main/resources/archetype-resources/src/main/webapp/maximized.jsp
  222. +3 −0  ...archetype-bundles/maven-archetype-portlet/src/main/resources/archetype-resources/src/main/webapp/normal.jsp
  223. +27 −0 maven-archetype-bundles/maven-archetype-portlet/src/site/site.xml
  224. +3 −0  maven-archetype-bundles/maven-archetype-portlet/src/test/resources/projects/basic/archetype.properties
  225. 0  maven-archetype-bundles/maven-archetype-portlet/src/test/resources/projects/basic/goal.txt
  226. +46 −0 maven-archetype-bundles/maven-archetype-profiles/pom.xml
  227. +11 −0 maven-archetype-bundles/maven-archetype-profiles/src/main/resources/META-INF/maven/archetype.xml
  228. +25 −0 maven-archetype-bundles/maven-archetype-profiles/src/main/resources/archetype-resources/pom.xml
  229. +1 −0  ...les/maven-archetype-profiles/src/main/resources/archetype-resources/src/main/filters/development.properties
  230. +1 −0  ...dles/maven-archetype-profiles/src/main/resources/archetype-resources/src/main/filters/production.properties
  231. +1 −0  ...type-bundles/maven-archetype-profiles/src/main/resources/archetype-resources/src/main/filters/qa.properties
  232. +13 −0 maven-archetype-bundles/maven-archetype-profiles/src/main/resources/archetype-resources/src/main/java/App.java
  233. +38 −0 ...rchetype-bundles/maven-archetype-profiles/src/main/resources/archetype-resources/src/test/java/AppTest.java
  234. +27 −0 maven-archetype-bundles/maven-archetype-profiles/src/site/site.xml
  235. +3 −0  maven-archetype-bundles/maven-archetype-profiles/src/test/resources/projects/basic/archetype.properties
  236. 0  maven-archetype-bundles/maven-archetype-profiles/src/test/resources/projects/basic/goal.txt
  237. +54 −0 maven-archetype-bundles/maven-archetype-quickstart/pom.xml
  238. +11 −0 maven-archetype-bundles/maven-archetype-quickstart/src/main/resources/META-INF/maven/archetype.xml
  239. +25 −0 maven-archetype-bundles/maven-archetype-quickstart/src/main/resources/archetype-resources/pom.xml
  240. +13 −0 ...-archetype-bundles/maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/java/App.java
  241. +38 −0 ...hetype-bundles/maven-archetype-quickstart/src/main/resources/archetype-resources/src/test/java/AppTest.java
  242. +27 −0 maven-archetype-bundles/maven-archetype-quickstart/src/site/site.xml
  243. +3 −0  maven-archetype-bundles/maven-archetype-quickstart/src/test/resources/projects/basic/archetype.properties
  244. 0  maven-archetype-bundles/maven-archetype-quickstart/src/test/resources/projects/basic/goal.txt
  245. +55 −0 maven-archetype-bundles/maven-archetype-simple/pom.xml
  246. +1 −0  maven-archetype-bundles/maven-archetype-simple/src/main/archetype/archetype.properties
  247. +13 −0 maven-archetype-bundles/maven-archetype-simple/src/main/java/archetype/App.java
  248. +1 −0  maven-archetype-bundles/maven-archetype-simple/src/main/resources/app.properties
  249. +27 −0 maven-archetype-bundles/maven-archetype-simple/src/site/site.xml
  250. +38 −0 maven-archetype-bundles/maven-archetype-simple/src/test/java/archetype/AppTest.java
  251. +1 −0  maven-archetype-bundles/maven-archetype-simple/src/test/resources/test.properties
  252. +46 −0 maven-archetype-bundles/maven-archetype-site-simple/pom.xml
  253. +10 −0 maven-archetype-bundles/maven-archetype-site-simple/src/main/resources/META-INF/maven/archetype.xml
  254. +20 −0 maven-archetype-bundles/maven-archetype-site-simple/src/main/resources/archetype-resources/pom.xml
  255. +18 −0 ...archetype-bundles/maven-archetype-site-simple/src/main/resources/archetype-resources/src/site/apt/index.apt
  256. +14 −0 maven-archetype-bundles/maven-archetype-site-simple/src/main/resources/archetype-resources/src/site/site.xml
  257. +27 −0 maven-archetype-bundles/maven-archetype-site-simple/src/site/site.xml
  258. +3 −0  maven-archetype-bundles/maven-archetype-site-simple/src/test/resources/projects/basic/archetype.properties
  259. 0  maven-archetype-bundles/maven-archetype-site-simple/src/test/resources/projects/basic/goal.txt
  260. +20 −0 maven-archetype-bundles/maven-archetype-site-simple/src/test/resources/projects/basic/reference/pom.xml
  261. +18 −0 ...type-bundles/maven-archetype-site-simple/src/test/resources/projects/basic/reference/src/site/apt/index.apt
  262. +14 −0 ...archetype-bundles/maven-archetype-site-simple/src/test/resources/projects/basic/reference/src/site/site.xml
  263. +48 −0 maven-archetype-bundles/maven-archetype-site/pom.xml
  264. +18 −0 maven-archetype-bundles/maven-archetype-site/src/main/resources/META-INF/maven/archetype.xml
  265. +34 −0 maven-archetype-bundles/maven-archetype-site/src/main/resources/archetype-resources/pom.xml
  266. +602 −0 maven-archetype-bundles/maven-archetype-site/src/main/resources/archetype-resources/src/site/apt/format.apt
  267. +16 −0 maven-archetype-bundles/maven-archetype-site/src/main/resources/archetype-resources/src/site/apt/index.apt
  268. +27 −0 maven-archetype-bundles/maven-archetype-site/src/main/resources/archetype-resources/src/site/fml/faq.fml
  269. +602 −0 maven-archetype-bundles/maven-archetype-site/src/main/resources/archetype-resources/src/site/fr/apt/format.apt
  270. +17 −0 maven-archetype-bundles/maven-archetype-site/src/main/resources/archetype-resources/src/site/fr/apt/index.apt
  271. +27 −0 maven-archetype-bundles/maven-archetype-site/src/main/resources/archetype-resources/src/site/fr/fml/faq.fml
  272. +17 −0 maven-archetype-bundles/maven-archetype-site/src/main/resources/archetype-resources/src/site/fr/xdoc/xdoc.xml
  273. +27 −0 maven-archetype-bundles/maven-archetype-site/src/main/resources/archetype-resources/src/site/site.xml
  274. +27 −0 maven-archetype-bundles/maven-archetype-site/src/main/resources/archetype-resources/src/site/site_fr.xml
  275. +17 −0 maven-archetype-bundles/maven-archetype-site/src/main/resources/archetype-resources/src/site/xdoc/xdoc.xml
  276. +27 −0 maven-archetype-bundles/maven-archetype-site/src/site/site.xml
  277. +3 −0  maven-archetype-bundles/maven-archetype-site/src/test/resources/projects/basic/archetype.properties
  278. 0  maven-archetype-bundles/maven-archetype-site/src/test/resources/projects/basic/goal.txt
  279. +46 −0 maven-archetype-bundles/maven-archetype-webapp/pom.xml
  280. +9 −0 maven-archetype-bundles/maven-archetype-webapp/src/main/resources/META-INF/maven/archetype.xml
  281. +29 −0 maven-archetype-bundles/maven-archetype-webapp/src/main/resources/archetype-resources/pom.xml
  282. +7 −0 ...etype-bundles/maven-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
  283. +5 −0 ...n-archetype-bundles/maven-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/index.jsp
  284. +27 −0 maven-archetype-bundles/maven-archetype-webapp/src/site/site.xml
  285. +3 −0  maven-archetype-bundles/maven-archetype-webapp/src/test/resources/projects/basic/archetype.properties
  286. 0  maven-archetype-bundles/maven-archetype-webapp/src/test/resources/projects/basic/goal.txt
  287. +73 −0 maven-archetype-bundles/pom.xml
  288. +37 −0 maven-archetype-bundles/src/site/apt/index.apt
  289. +33 −0 maven-archetype-bundles/src/site/site.xml
  290. +226 −336 pom.xml
  291. +50 −0 src/site/apt/index.apt
  292. +34 −0 src/site/site.xml
View
10 NOTICE.txt
@@ -1,5 +1,5 @@
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
-This product includes software developed by jchardet.sourceforge.net
-jchardet is using Mozilla 1.1 license.
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
+This product includes software developed by jchardet.sourceforge.net
+jchardet is using Mozilla 1.1 license.
View
127 archetype-common/pom.xml
@@ -1,4 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you 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.
+-->
+
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -8,9 +28,13 @@
<artifactId>maven-archetype</artifactId>
<version>2.0-alpha-5</version>
</parent>
+
<artifactId>archetype-common</artifactId>
- <name>Maven Archetype Common</name>
<packaging>jar</packaging>
+
+ <name>Maven Archetype Common</name>
+ <description>Core Archetype classes.</description>
+
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
@@ -66,10 +90,6 @@
<artifactId>velocity</artifactId>
</dependency>
<dependency>
- <groupId>dom4j</groupId>
- <artifactId>dom4j</artifactId>
- </dependency>
- <dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</dependency>
@@ -150,72 +170,52 @@
<plugin>
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId>
- <version>1.0-alpha-21</version>
+ <version>1.3</version>
+ <configuration>
+ <version>1.0.0</version>
+ <models>
+ <model>src/main/mdo/archetype-registry.mdo</model>
+ <model>src/main/mdo/archetype-descriptor.mdo</model>
+ <model>src/main/mdo/archetype-catalog.mdo</model>
+ <model>src/main/mdo/archetype.mdo</model>
+ </models>
+ </configuration>
<executions>
<execution>
- <id>archetype-common</id>
+ <id>default</id>
<goals>
<goal>java</goal>
- <goal>xsd</goal>
<goal>xpp3-reader</goal>
<goal>xpp3-writer</goal>
</goals>
- <configuration>
- <version>1.0.0</version>
- <model>src/main/mdo/archetype-common.mdo</model>
- </configuration>
</execution>
<execution>
- <id>archetype-registry</id>
+ <id>site-docs</id>
+ <phase>pre-site</phase>
<goals>
- <goal>java</goal>
- <goal>xsd</goal>
- <goal>xpp3-reader</goal>
- <goal>xpp3-writer</goal>
+ <goal>xdoc</goal>
</goals>
- <configuration>
- <version>1.0.0</version>
- <model>src/main/mdo/archetype-registry.mdo</model>
- </configuration>
</execution>
<execution>
- <id>archetype-descriptor</id>
+ <id>site-xsd</id>
+ <phase>pre-site</phase>
<goals>
- <goal>java</goal>
<goal>xsd</goal>
- <goal>xpp3-reader</goal>
- <goal>xpp3-writer</goal>
</goals>
<configuration>
- <version>1.0.0</version>
- <model>src/main/mdo/archetype-descriptor.mdo</model>
+ <outputDirectory>${basedir}/target/generated-site/resources/xsd</outputDirectory>
</configuration>
</execution>
<execution>
- <id>archetype-catalog</id>
- <goals>
- <goal>java</goal>
- <goal>xsd</goal>
- <goal>xpp3-reader</goal>
- <goal>xpp3-writer</goal>
- </goals>
+ <id>java-only</id>
<configuration>
- <version>1.0.0</version>
- <model>src/main/mdo/archetype-catalog.mdo</model>
+ <models>
+ <model>src/main/mdo/archetype-common.mdo</model>
+ </models>
</configuration>
- </execution>
- <execution>
- <id>archetype-old</id>
<goals>
<goal>java</goal>
- <goal>xsd</goal>
- <goal>xpp3-reader</goal>
- <goal>xpp3-writer</goal>
</goals>
- <configuration>
- <version>1.0.0</version>
- <model>src/main/mdo/archetype.mdo</model>
- </configuration>
</execution>
</executions>
</plugin>
@@ -392,6 +392,7 @@
</plugin>
</plugins>
</build>
+
<reporting>
<plugins>
<plugin>
@@ -403,22 +404,22 @@
</reporting>
<profiles>
- <profile>
- <id>internal-catalog</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <includes>
- <include>**/InternalCatalogFromWiki.java</include>
- <!--include>**/InternalCatalogArchetypesVerification.java</include-->
- </includes>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
+ <profile>
+ <id>internal-catalog</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>**/InternalCatalogFromWiki.java</include>
+ <!--include>**/InternalCatalogArchetypesVerification.java</include-->
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
</project>
View
10 archetype-common/src/main/java/org/apache/maven/archetype/ArchetypeCreationRequest.java
@@ -1,3 +1,5 @@
+package org.apache.maven.archetype;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -17,8 +19,6 @@
* under the License.
*/
-package org.apache.maven.archetype;
-
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.project.MavenProject;
@@ -56,11 +56,13 @@
private String postPhase;
- public String getPostPhase() {
+ public String getPostPhase()
+ {
return postPhase;
}
- public ArchetypeCreationRequest setPostPhase(String postPhase) {
+ public ArchetypeCreationRequest setPostPhase( String postPhase )
+ {
this.postPhase = postPhase;
return this;
View
4 archetype-common/src/main/java/org/apache/maven/archetype/ArchetypeCreationResult.java
@@ -1,3 +1,5 @@
+package org.apache.maven.archetype;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -17,8 +19,6 @@
* under the License.
*/
-package org.apache.maven.archetype;
-
/** @author Jason van Zyl */
public class ArchetypeCreationResult
{
View
64 archetype-common/src/main/java/org/apache/maven/archetype/ArchetypeGenerationRequest.java
@@ -1,3 +1,5 @@
+package org.apache.maven.archetype;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -17,8 +19,6 @@
* under the License.
*/
-package org.apache.maven.archetype;
-
import org.apache.maven.archetype.catalog.Archetype;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.settings.Mirror;
@@ -43,13 +43,13 @@
private ArtifactRepository localRepository;
- private List remoteArtifactRepositories;
-
+ private List remoteArtifactRepositories;
+
private Proxy activeProxy;
- private List servers = new ArrayList( );
+ private List servers = new ArrayList();
- private List mirrors = new ArrayList( );
+ private List mirrors = new ArrayList();
// Archetype definition
private String archetypeName;
@@ -73,24 +73,24 @@
private String packageName;
- private Properties properties = new Properties( );
+ private Properties properties = new Properties();
- public ArchetypeGenerationRequest( )
+ public ArchetypeGenerationRequest()
{
}
public ArchetypeGenerationRequest( Archetype archetype )
{
- this.archetypeGroupId = archetype.getGroupId( );
+ this.archetypeGroupId = archetype.getGroupId();
- this.archetypeArtifactId = archetype.getArtifactId( );
+ this.archetypeArtifactId = archetype.getArtifactId();
- this.archetypeVersion = archetype.getVersion( );
+ this.archetypeVersion = archetype.getVersion();
- this.archetypeRepository = archetype.getRepository( );
+ this.archetypeRepository = archetype.getRepository();
}
- public String getArchetypeGroupId( )
+ public String getArchetypeGroupId()
{
return archetypeGroupId;
}
@@ -102,7 +102,7 @@ public ArchetypeGenerationRequest setArchetypeGroupId( String archetypeGroupId )
return this;
}
- public String getArchetypeArtifactId( )
+ public String getArchetypeArtifactId()
{
return archetypeArtifactId;
}
@@ -114,7 +114,7 @@ public ArchetypeGenerationRequest setArchetypeArtifactId( String archetypeArtifa
return this;
}
- public String getArchetypeVersion( )
+ public String getArchetypeVersion()
{
return archetypeVersion;
}
@@ -126,7 +126,7 @@ public ArchetypeGenerationRequest setArchetypeVersion( String archetypeVersion )
return this;
}
- public String getArchetypeGoals( )
+ public String getArchetypeGoals()
{
return archetypeGoals;
}
@@ -138,7 +138,7 @@ public ArchetypeGenerationRequest setArchetypeGoals( String archetypeGoals )
return this;
}
- public String getArchetypeName( )
+ public String getArchetypeName()
{
return archetypeName;
}
@@ -150,7 +150,7 @@ public ArchetypeGenerationRequest setArchetypeName( String archetypeName )
return this;
}
- public String getArchetypeRepository( )
+ public String getArchetypeRepository()
{
return archetypeRepository;
}
@@ -162,7 +162,7 @@ public ArchetypeGenerationRequest setArchetypeRepository( String archetypeReposi
return this;
}
- public String getArtifactId( )
+ public String getArtifactId()
{
return artifactId;
}
@@ -174,7 +174,7 @@ public ArchetypeGenerationRequest setArtifactId( String artifactId )
return this;
}
- public String getGroupId( )
+ public String getGroupId()
{
return groupId;
}
@@ -186,7 +186,7 @@ public ArchetypeGenerationRequest setGroupId( String groupId )
return this;
}
- public String getVersion( )
+ public String getVersion()
{
return version;
}
@@ -198,7 +198,7 @@ public ArchetypeGenerationRequest setVersion( String version )
return this;
}
- public String getPackage( )
+ public String getPackage()
{
return packageName;
}
@@ -210,7 +210,7 @@ public ArchetypeGenerationRequest setPackage( String packageName )
return this;
}
- public Properties getProperties( )
+ public Properties getProperties()
{
return properties;
}
@@ -222,7 +222,7 @@ public ArchetypeGenerationRequest setProperties( Properties additionalProperties
return this;
}
- public ArtifactRepository getLocalRepository( )
+ public ArtifactRepository getLocalRepository()
{
return localRepository;
}
@@ -234,7 +234,7 @@ public ArchetypeGenerationRequest setLocalRepository( ArtifactRepository localRe
return this;
}
- public String getOutputDirectory( )
+ public String getOutputDirectory()
{
return outputDirectory;
}
@@ -246,7 +246,7 @@ public ArchetypeGenerationRequest setOutputDirectory( String outputDirectory )
return this;
}
- public boolean isInteractiveMode( )
+ public boolean isInteractiveMode()
{
return interactiveMode;
}
@@ -258,7 +258,7 @@ public ArchetypeGenerationRequest setInteractiveMode( boolean interactiveMode )
return this;
}
- public boolean isOffline( )
+ public boolean isOffline()
{
return offline;
}
@@ -270,7 +270,7 @@ public ArchetypeGenerationRequest setOffline( boolean offline )
return this;
}
- public TransferListener getTransferListener( )
+ public TransferListener getTransferListener()
{
return transferListener;
}
@@ -282,7 +282,7 @@ public ArchetypeGenerationRequest setTransferListener( TransferListener transfer
return this;
}
- public Proxy getActiveProxy( )
+ public Proxy getActiveProxy()
{
return activeProxy;
}
@@ -301,7 +301,7 @@ public ArchetypeGenerationRequest addMirror( Mirror mirror )
return this;
}
- public List getMirrors( )
+ public List getMirrors()
{
return mirrors;
}
@@ -313,11 +313,11 @@ public ArchetypeGenerationRequest addMirror( Server server )
return this;
}
- public List getServers( )
+ public List getServers()
{
return servers;
}
-
+
public List getRemoteArtifactRepositories()
{
return remoteArtifactRepositories;
View
6 archetype-common/src/main/java/org/apache/maven/archetype/ArchetypeGenerationResult.java
@@ -1,3 +1,5 @@
+package org.apache.maven.archetype;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -17,14 +19,12 @@
* under the License.
*/
-package org.apache.maven.archetype;
-
/** @author Jason van Zyl */
public class ArchetypeGenerationResult
{
private Exception cause;
- public Exception getCause( )
+ public Exception getCause()
{
return cause;
}
View
22 ...org/apache/maven/archetype/Archetype.java → ...che/maven/archetype/ArchetypeManager.java
@@ -1,3 +1,5 @@
+package org.apache.maven.archetype;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -16,19 +18,18 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.maven.archetype;
-
+import org.apache.maven.archetype.catalog.Archetype;
+import org.apache.maven.archetype.catalog.ArchetypeCatalog;
import org.apache.maven.artifact.DependencyResolutionRequiredException;
import java.io.File;
import java.io.IOException;
-import org.apache.maven.archetype.catalog.ArchetypeCatalog;
/** @author Jason van Zyl */
-public interface Archetype
+public interface ArchetypeManager
{
- String ROLE = Archetype.class.getName();
+ String ROLE = ArchetypeManager.class.getName();
/**
* A command to create an OldArchetype from an existing Maven project given the suppled
@@ -94,11 +95,10 @@
*
* @throws java.io.IOException
*/
- File archiveArchetype(
- File archetypeDirectory,
- File outputDirectory,
- String finalName )
+ File archiveArchetype( File archetypeDirectory, File outputDirectory, String finalName )
throws DependencyResolutionRequiredException, IOException;
- void updateLocalCatalog(org.apache.maven.archetype.catalog.Archetype archetype, String path);
- void updateLocalCatalog(org.apache.maven.archetype.catalog.Archetype archetype);
+
+ void updateLocalCatalog( Archetype archetype, String path );
+
+ void updateLocalCatalog( Archetype archetype );
}
View
52 ...che/maven/archetype/DefaultArchetype.java → ...en/archetype/DefaultArchetypeManager.java
@@ -1,3 +1,5 @@
+package org.apache.maven.archetype;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -17,8 +19,7 @@
* under the License.
*/
-package org.apache.maven.archetype;
-
+import org.apache.maven.archetype.catalog.Archetype;
import org.apache.maven.archetype.catalog.ArchetypeCatalog;
import org.apache.maven.archetype.creator.ArchetypeCreator;
import org.apache.maven.archetype.generator.ArchetypeGenerator;
@@ -26,6 +27,7 @@
import org.apache.maven.archetype.source.ArchetypeDataSourceException;
import org.apache.maven.artifact.DependencyResolutionRequiredException;
import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.util.IOUtil;
import java.io.File;
import java.io.FileInputStream;
@@ -40,9 +42,9 @@
* @author Jason van Zyl
* @plexus.component
*/
-public class DefaultArchetype
+public class DefaultArchetypeManager
extends AbstractLogEnabled
- implements Archetype
+ implements ArchetypeManager
{
/** @plexus.requirement role-hint="fileset" */
private ArchetypeCreator creator;
@@ -119,8 +121,11 @@ private void zipper( ZipOutputStream zos,
else
{
String fileName = files[i].getAbsolutePath().substring( offset + 1 );
-
- if(File.separatorChar != '/'){ fileName = fileName.replace('\\', '/'); }
+
+ if ( File.separatorChar != '/' )
+ {
+ fileName = fileName.replace( '\\', '/' );
+ }
ZipEntry e = new ZipEntry( fileName );
@@ -128,14 +133,7 @@ private void zipper( ZipOutputStream zos,
FileInputStream is = new FileInputStream( files[i] );
- byte[] buf = new byte[4096];
-
- int n;
-
- while ( ( n = is.read( buf ) ) > 0 )
- {
- zos.write( buf, 0, n );
- }
+ IOUtil.copy( is, zos );
is.close();
@@ -162,15 +160,15 @@ public ArchetypeCatalog getInternalCatalog()
public ArchetypeCatalog getDefaultLocalCatalog()
{
- return getLocalCatalog("${user.home}/.m2/archetype-catalog.xml");
+ return getLocalCatalog( "${user.home}/.m2/archetype-catalog.xml" );
}
public ArchetypeCatalog getLocalCatalog( String path )
{
try
{
- Properties properties=new Properties();
- properties.setProperty("file", path);
+ Properties properties = new Properties();
+ properties.setProperty( "file", path );
ArchetypeDataSource source = (ArchetypeDataSource) archetypeSources.get( "catalog" );
return source.getArchetypeCatalog( properties );
@@ -183,15 +181,15 @@ public ArchetypeCatalog getLocalCatalog( String path )
public ArchetypeCatalog getRemoteCatalog()
{
- return getRemoteCatalog("http://repo1.maven.org/maven2");
+ return getRemoteCatalog( "http://repo1.maven.org/maven2" );
}
public ArchetypeCatalog getRemoteCatalog( String url )
{
try
{
- Properties properties=new Properties();
- properties.setProperty("repository", url);
+ Properties properties = new Properties();
+ properties.setProperty( "repository", url );
ArchetypeDataSource source = (ArchetypeDataSource) archetypeSources.get( "remote-catalog" );
return source.getArchetypeCatalog( properties );
@@ -202,18 +200,20 @@ public ArchetypeCatalog getRemoteCatalog( String url )
}
}
- public void updateLocalCatalog(org.apache.maven.archetype.catalog.Archetype archetype) {
- updateLocalCatalog(archetype, "${user.home}/.m2/archetype-catalog.xml");
+ public void updateLocalCatalog( Archetype archetype )
+ {
+ updateLocalCatalog( archetype, "${user.home}/.m2/archetype-catalog.xml" );
}
- public void updateLocalCatalog(org.apache.maven.archetype.catalog.Archetype archetype, String path) {
+ public void updateLocalCatalog( Archetype archetype, String path )
+ {
try
{
- Properties properties=new Properties();
- properties.setProperty("file", path);
+ Properties properties = new Properties();
+ properties.setProperty( "file", path );
ArchetypeDataSource source = (ArchetypeDataSource) archetypeSources.get( "catalog" );
- source.updateCatalog(properties, archetype);
+ source.updateCatalog( properties, archetype );
}
catch ( ArchetypeDataSourceException e )
{
View
290 ...type-common/src/main/java/org/apache/maven/archetype/common/ArchetypeArtifactManager.java
@@ -1,145 +1,145 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.maven.archetype.common;
-
-import org.apache.maven.archetype.exception.UnknownArchetype;
-import org.apache.maven.archetype.metadata.ArchetypeDescriptor;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.model.Model;
-
-import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-
-import java.io.File;
-import java.io.IOException;
-
-import java.util.List;
-import java.util.zip.ZipFile;
-
-public interface ArchetypeArtifactManager
-{
- String ROLE = ArchetypeArtifactManager.class.getName ();
-
- Model getArchetypePom ( File jar )
- throws XmlPullParserException, UnknownArchetype, IOException;
-
- /**
- */
- File getArchetypeFile (
- final String groupId,
- final String artifactId,
- final String version,
- ArtifactRepository archetypeRepository,
- final ArtifactRepository localRepository,
- final List repositories
- )
- throws UnknownArchetype;
-
- /**
- */
- ClassLoader getArchetypeJarLoader ( File archetypeFile )
- throws UnknownArchetype;
-
- /**
- */
- ZipFile getArchetypeZipFile ( File archetypeFile )
- throws UnknownArchetype;
-
- /**
- */
- boolean isFileSetArchetype ( File archetypeFile );
-
- /**
- */
- boolean isFileSetArchetype (
- String groupId,
- String artifactId,
- String version,
- ArtifactRepository archetypeRepository,
- ArtifactRepository localRepository,
- List repositories
- );
-
- /**
- */
- boolean isOldArchetype ( File archetypeFile );
-
- /**
- */
- boolean isOldArchetype (
- String groupId,
- String artifactId,
- String version,
- ArtifactRepository archetypeRepository,
- ArtifactRepository localRepository,
- List repositories
- );
-
- /**
- */
- boolean exists (
- String archetypeGroupId,
- String archetypeArtifactId,
- String archetypeVersion,
- ArtifactRepository archetypeRepository,
- ArtifactRepository localRepository,
- List repos
- );
-
- /**
- */
- ArchetypeDescriptor getFileSetArchetypeDescriptor ( File archetypeFile )
- throws UnknownArchetype;
-
- /**
- */
- org.apache.maven.archetype.metadata.ArchetypeDescriptor getFileSetArchetypeDescriptor (
- String groupId,
- String artifactId,
- String version,
- ArtifactRepository archetypeRepository,
- ArtifactRepository localRepository,
- List repositories
- )
- throws UnknownArchetype;
-
- /**
- */
- List getFilesetArchetypeResources ( File archetypeFile )
- throws UnknownArchetype;
-
- /**
- */
- org.apache.maven.archetype.old.descriptor.ArchetypeDescriptor getOldArchetypeDescriptor (
- File archetypeFile
- )
- throws UnknownArchetype;
-
- /**
- */
- org.apache.maven.archetype.old.descriptor.ArchetypeDescriptor getOldArchetypeDescriptor (
- String groupId,
- String artifactId,
- String version,
- ArtifactRepository archetypeRepository,
- ArtifactRepository localRepository,
- List repositories
- )
- throws UnknownArchetype;
-}
+package org.apache.maven.archetype.common;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+import org.apache.maven.archetype.exception.UnknownArchetype;
+import org.apache.maven.archetype.metadata.ArchetypeDescriptor;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.model.Model;
+
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+
+import java.io.File;
+import java.io.IOException;
+
+import java.util.List;
+import java.util.zip.ZipFile;
+
+public interface ArchetypeArtifactManager
+{
+ String ROLE = ArchetypeArtifactManager.class.getName ();
+
+ Model getArchetypePom ( File jar )
+ throws XmlPullParserException, UnknownArchetype, IOException;
+
+ /**
+ */
+ File getArchetypeFile (
+ final String groupId,
+ final String artifactId,
+ final String version,
+ ArtifactRepository archetypeRepository,
+ final ArtifactRepository localRepository,
+ final List repositories
+ )
+ throws UnknownArchetype;
+
+ /**
+ */
+ ClassLoader getArchetypeJarLoader ( File archetypeFile )
+ throws UnknownArchetype;
+
+ /**
+ */
+ ZipFile getArchetypeZipFile ( File archetypeFile )
+ throws UnknownArchetype;
+
+ /**
+ */
+ boolean isFileSetArchetype ( File archetypeFile );
+
+ /**
+ */
+ boolean isFileSetArchetype (
+ String groupId,
+ String artifactId,
+ String version,
+ ArtifactRepository archetypeRepository,
+ ArtifactRepository localRepository,
+ List repositories
+ );
+
+ /**
+ */
+ boolean isOldArchetype ( File archetypeFile );
+
+ /**
+ */
+ boolean isOldArchetype (
+ String groupId,
+ String artifactId,
+ String version,
+ ArtifactRepository archetypeRepository,
+ ArtifactRepository localRepository,
+ List repositories
+ );
+
+ /**
+ */
+ boolean exists (
+ String archetypeGroupId,
+ String archetypeArtifactId,
+ String archetypeVersion,
+ ArtifactRepository archetypeRepository,
+ ArtifactRepository localRepository,
+ List repos
+ );
+
+ /**
+ */
+ ArchetypeDescriptor getFileSetArchetypeDescriptor ( File archetypeFile )
+ throws UnknownArchetype;
+
+ /**
+ */
+ org.apache.maven.archetype.metadata.ArchetypeDescriptor getFileSetArchetypeDescriptor (
+ String groupId,
+ String artifactId,
+ String version,
+ ArtifactRepository archetypeRepository,
+ ArtifactRepository localRepository,
+ List repositories
+ )
+ throws UnknownArchetype;
+
+ /**
+ */
+ List getFilesetArchetypeResources ( File archetypeFile )
+ throws UnknownArchetype;
+
+ /**
+ */
+ org.apache.maven.archetype.old.descriptor.ArchetypeDescriptor getOldArchetypeDescriptor (
+ File archetypeFile
+ )
+ throws UnknownArchetype;
+
+ /**
+ */
+ org.apache.maven.archetype.old.descriptor.ArchetypeDescriptor getOldArchetypeDescriptor (
+ String groupId,
+ String artifactId,
+ String version,
+ ArtifactRepository archetypeRepository,
+ ArtifactRepository localRepository,
+ List repositories
+ )
+ throws UnknownArchetype;
+}
View
174 archetype-common/src/main/java/org/apache/maven/archetype/common/ArchetypeFilesResolver.java
@@ -1,87 +1,87 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.maven.archetype.common;
-
-import org.apache.maven.archetype.metadata.FileSet;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-
-/** @author rafale */
-public interface ArchetypeFilesResolver
-{
- String ROLE = ArchetypeFilesResolver.class.getName();
-
- List getFilesWithExtension( List files,
- String extension );
-
- List getFilteredFiles( List files,
- String filtered );
-
-// List filterFiles( FileSet fileSet,
-// List archetypeResources );
-
- List filterFiles( String moduleOffset,
- FileSet fileSet,
- List archetypeResources );
-
- List findOtherResources( int level,
- List files,
- String languages );
-
- List findOtherResources( int level,
- List files,
- List sourcesFiles,
- String languages );
-
- List findOtherSources( int level,
- List files,
- String languages );
-
- List findResourcesMainFiles( List files,
- String languages );
-
- List findResourcesTestFiles( List files,
- String languages );
-
- List findSiteFiles( List files,
- String languages );
-
- List findSourcesMainFiles( List files,
- String languages );
-
- List findSourcesTestFiles( List files,
- String languages );
-
- List getPackagedFiles( List files,
- String packageName );
-
- String resolvePackage( File file,
- List languages )
- throws
- IOException;
-
-// List getUnfilteredFiles( List files,
-// String filtered );
-
- List getUnpackagedFiles( List files,
- String packageName );
-}
+package org.apache.maven.archetype.common;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+import org.apache.maven.archetype.metadata.FileSet;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+
+/** @author rafale */
+public interface ArchetypeFilesResolver
+{
+ String ROLE = ArchetypeFilesResolver.class.getName();
+
+ List getFilesWithExtension( List files,
+ String extension );
+
+ List getFilteredFiles( List files,
+ String filtered );
+
+// List filterFiles( FileSet fileSet,
+// List archetypeResources );
+
+ List filterFiles( String moduleOffset,
+ FileSet fileSet,
+ List archetypeResources );
+
+ List findOtherResources( int level,
+ List files,
+ String languages );
+
+ List findOtherResources( int level,
+ List files,
+ List sourcesFiles,
+ String languages );
+
+ List findOtherSources( int level,
+ List files,
+ String languages );
+
+ List findResourcesMainFiles( List files,
+ String languages );
+
+ List findResourcesTestFiles( List files,
+ String languages );
+
+ List findSiteFiles( List files,
+ String languages );
+
+ List findSourcesMainFiles( List files,
+ String languages );
+
+ List findSourcesTestFiles( List files,
+ String languages );
+
+ List getPackagedFiles( List files,
+ String packageName );
+
+ String resolvePackage( File file,
+ List languages )
+ throws
+ IOException;
+
+// List getUnfilteredFiles( List files,
+// String filtered );
+
+ List getUnpackagedFiles( List files,
+ String packageName );
+}
View
154 ...type-common/src/main/java/org/apache/maven/archetype/common/ArchetypeRegistryManager.java
@@ -1,77 +1,77 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.maven.archetype.common;
-
-import org.apache.maven.archetype.registry.ArchetypeRegistry;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.Reader;
-import java.util.List;
-
-public interface ArchetypeRegistryManager
-{
- String ROLE = ArchetypeRegistryManager.class.getName();
-
- List getFilteredExtensions( String archetypeFilteredExtentions,
- File archetypeRegistryFile )
- throws
- IOException;
-
- List getLanguages( String archetypeLanguages,
- File archetypeRegistryFile )
- throws
- IOException;
-
- ArchetypeRegistry readArchetypeRegistry( Reader reader )
- throws
- IOException,
- XmlPullParserException;
-
- ArchetypeRegistry readArchetypeRegistry( File archetypeRegistryFile )
- throws
- IOException,
- XmlPullParserException;
-
-// ArchetypeRegistry readArchetypeRegistry()
-// throws
-// IOException,
-// XmlPullParserException;
-
-// List getRepositories(
-// List pomRemoteRepositories,
-// String remoteRepositories,
-// File archetypeRegistryFile
-// )
-// throws
-// IOException,
-// XmlPullParserException;
-
- void writeArchetypeRegistry( File archetypeRegistryFile,
- ArchetypeRegistry archetypeRegistry )
- throws
- IOException;
-
- ArchetypeRegistry getDefaultArchetypeRegistry();
-
- ArtifactRepository createRepository( String url, String repositoryId );
-}
+package org.apache.maven.archetype.common;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+import org.apache.maven.archetype.registry.ArchetypeRegistry;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.Reader;
+import java.util.List;
+
+public interface ArchetypeRegistryManager
+{
+ String ROLE = ArchetypeRegistryManager.class.getName();
+
+ List getFilteredExtensions( String archetypeFilteredExtentions,
+ File archetypeRegistryFile )
+ throws
+ IOException;
+
+ List getLanguages( String archetypeLanguages,
+ File archetypeRegistryFile )
+ throws
+ IOException;
+
+ ArchetypeRegistry readArchetypeRegistry( Reader reader )
+ throws
+ IOException,
+ XmlPullParserException;
+
+ ArchetypeRegistry readArchetypeRegistry( File archetypeRegistryFile )
+ throws
+ IOException,
+ XmlPullParserException;
+
+// ArchetypeRegistry readArchetypeRegistry()
+// throws
+// IOException,
+// XmlPullParserException;
+
+// List getRepositories(
+// List pomRemoteRepositories,
+// String remoteRepositories,
+// File archetypeRegistryFile
+// )
+// throws
+// IOException,
+// XmlPullParserException;
+
+ void writeArchetypeRegistry( File archetypeRegistryFile,
+ ArchetypeRegistry archetypeRegistry )
+ throws
+ IOException;
+
+ ArchetypeRegistry getDefaultArchetypeRegistry();
+
+ ArtifactRepository createRepository( String url, String repositoryId );
+}
View
184 archetype-common/src/main/java/org/apache/maven/archetype/common/Constants.java
@@ -1,92 +1,92 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.maven.archetype.common;
-
-import java.util.Arrays;
-import java.util.List;
-
-public interface Constants
-{
- String ARCHETYPE_ARTIFACT_ID = "archetype.artifactId";
-
- String ARCHETYPE_GROUP_ID = "archetype.groupId";
-
- String ARCHETYPE_VERSION = "archetype.version";
-
- String ARCHETYPE_REPOSITORY = "archetype.repository";
-
- String ARCHETYPE_DESCRIPTOR = "META-INF/maven/archetype-metadata.xml";
-
- String ARCHETYPE_POST_GENERATION_GOALS = "archetype.goals";
-
- String ARCHETYPE_POM = "pom.xml";
-
- String ARCHETYPE_RESOURCES = "archetype-resources";
-
- String ARCHETYPE_SUFFIX = "-archetype";
-
- String ARTIFACT_ID = "artifactId";
-
- String ARCHETYPE_FILTERED_EXTENSIONS = "archetype.filteredExtensions";
-
- String ARCHETYPE_LANGUAGES = "archetype.languages";
-
- List DEFAULT_FILTERED_EXTENSIONS =
- Arrays.asList(
- new String[]
- {
- "java", "xml", "txt", "groovy", "cs", "mdo", "aj", "jsp", "gsp", "vm", "html",
- "xhtml", "properties", ".classpath", ".project"
- }
- );
-
- List DEFAULT_LANGUAGES =
- Arrays.asList( new String[]{"java", "groovy", "csharp", "aspectj"} );
-
- String GROUP_ID = "groupId";
-
- String MAIN = "main";
-
- String OLD_ARCHETYPE_DESCRIPTOR = "META-INF/maven/archetype.xml";
-
- String OLDER_ARCHETYPE_DESCRIPTOR = "META-INF/archetype.xml";
-
- String PACKAGE = "package";
-
- /*String PACKAGE_NAME = "packageName";*/
-
- String PACKAGE_IN_PATH_FORMAT = "packageInPathFormat";
-
- String PARENT_ARTIFACT_ID = "parentArtifactId";
-
- String POM_PATH = Constants.ARCHETYPE_RESOURCES + "/" + Constants.ARCHETYPE_POM;
-
- String RESOURCES = "resources";
-
- String SITE = "site";
-
- String SRC = "src";
-
- String TEST = "test";
-
- String TMP = ".tmp";
-
- String VERSION = "version";
-}
+package org.apache.maven.archetype.common;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+import java.util.Arrays;
+import java.util.List;
+
+public interface Constants
+{
+ String ARCHETYPE_ARTIFACT_ID = "archetype.artifactId";
+
+ String ARCHETYPE_GROUP_ID = "archetype.groupId";
+
+ String ARCHETYPE_VERSION = "archetype.version";
+
+ String ARCHETYPE_REPOSITORY = "archetype.repository";
+
+ String ARCHETYPE_DESCRIPTOR = "META-INF/maven/archetype-metadata.xml";
+
+ String ARCHETYPE_POST_GENERATION_GOALS = "archetype.goals";
+
+ String ARCHETYPE_POM = "pom.xml";
+
+ String ARCHETYPE_RESOURCES = "archetype-resources";
+
+ String ARCHETYPE_SUFFIX = "-archetype";
+
+ String ARTIFACT_ID = "artifactId";
+
+ String ARCHETYPE_FILTERED_EXTENSIONS = "archetype.filteredExtensions";
+
+ String ARCHETYPE_LANGUAGES = "archetype.languages";
+
+ List DEFAULT_FILTERED_EXTENSIONS =
+ Arrays.asList(
+ new String[]
+ {
+ "java", "xml", "txt", "groovy", "cs", "mdo", "aj", "jsp", "gsp", "vm", "html",
+ "xhtml", "properties", ".classpath", ".project"
+ }
+ );
+
+ List DEFAULT_LANGUAGES =
+ Arrays.asList( new String[]{ "java", "groovy", "csharp", "aspectj" } );
+
+ String GROUP_ID = "groupId";
+
+ String MAIN = "main";
+
+ String OLD_ARCHETYPE_DESCRIPTOR = "META-INF/maven/archetype.xml";
+
+ String OLDER_ARCHETYPE_DESCRIPTOR = "META-INF/archetype.xml";
+
+ String PACKAGE = "package";
+
+ /*String PACKAGE_NAME = "packageName";*/
+
+ String PACKAGE_IN_PATH_FORMAT = "packageInPathFormat";
+
+ String PARENT_ARTIFACT_ID = "parentArtifactId";
+
+ String POM_PATH = Constants.ARCHETYPE_RESOURCES + "/" + Constants.ARCHETYPE_POM;
+
+ String RESOURCES = "resources";
+
+ String SITE = "site";
+
+ String SRC = "src";
+
+ String TEST = "test";
+
+ String TMP = ".tmp";
+
+ String VERSION = "version";
+}
View
703 ...mmon/src/main/java/org/apache/maven/archetype/common/DefaultArchetypeArtifactManager.java
@@ -1,3 +1,5 @@
+package org.apache.maven.archetype.common;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -17,8 +19,6 @@
* under the License.
*/
-package org.apache.maven.archetype.common;
-
import org.apache.maven.archetype.downloader.DownloadException;
import org.apache.maven.archetype.downloader.DownloadNotFoundException;
import org.apache.maven.archetype.downloader.Downloader;
@@ -27,17 +27,17 @@
import org.apache.maven.archetype.metadata.io.xpp3.ArchetypeDescriptorXpp3Reader;
import org.apache.maven.archetype.old.descriptor.ArchetypeDescriptorBuilder;
import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.repository.metadata.RepositoryMetadataManager;
import org.apache.maven.model.Model;
import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.ReaderFactory;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
-import java.io.InputStreamReader;
import java.io.Reader;
import java.net.MalformedURLException;
@@ -58,7 +58,8 @@
*/
public class DefaultArchetypeArtifactManager
extends AbstractLogEnabled
- implements ArchetypeArtifactManager {
+ implements ArchetypeArtifactManager
+{
/**
* @plexus.requirement
*/
@@ -69,641 +70,545 @@
*/
private PomManager pomManager;
- /**
- * @plexus.requirement
- */
- private RepositoryMetadataManager repositoryMetadataManager;
-
private Map archetypeCache = new TreeMap();
- public File getArchetypeFile(
- final String groupId,
- final String artifactId,
- final String version,
- ArtifactRepository archetypeRepository,
- final ArtifactRepository localRepository,
- final List repositories
- )
- throws UnknownArchetype {
- try {
- File archetype = getArchetype(
- groupId,
- artifactId,
- version );
- if( archetype == null ) {
+ public File getArchetypeFile( final String groupId, final String artifactId, final String version,
+ ArtifactRepository archetypeRepository, final ArtifactRepository localRepository,
+ final List repositories )
+ throws UnknownArchetype
+ {
+ try
+ {
+ File archetype = getArchetype( groupId, artifactId, version );
+
+ if ( archetype == null )
+ {
archetype =
- downloader.download(
- groupId,
- artifactId,
- version,
- archetypeRepository,
- localRepository,
- repositories
- );
- setArchetype(
- groupId,
- artifactId,
- version,
- archetype );
+ downloader.download( groupId, artifactId, version, archetypeRepository, localRepository,
+ repositories );
+
+ setArchetype( groupId, artifactId, version, archetype );
}
return archetype;
}
- catch( DownloadNotFoundException ex ) {
+ catch ( DownloadNotFoundException ex )
+ {
throw new UnknownArchetype( ex );
}
- catch( DownloadException ex ) {
+ catch ( DownloadException ex )
+ {
throw new UnknownArchetype( ex );
}
}
public ClassLoader getArchetypeJarLoader( File archetypeFile )
- throws UnknownArchetype {
- try {
+ throws UnknownArchetype
+ {
+ try
+ {
URL[] urls = new URL[1];
urls[0] = archetypeFile.toURI().toURL();
return new URLClassLoader( urls );
}
- catch( MalformedURLException e ) {
+ catch ( MalformedURLException e )
+ {
throw new UnknownArchetype( e );
}
}
public Model getArchetypePom( File jar )
- throws XmlPullParserException, UnknownArchetype, IOException {
- String pomFileName = null;
+ throws XmlPullParserException, UnknownArchetype, IOException
+ {
ZipFile zipFile = null;
- try {
+ try
+ {
+ String pomFileName = null;
zipFile = getArchetypeZipFile( jar );
Enumeration enumeration = zipFile.entries();
- while( enumeration.hasMoreElements() ) {
+ while ( enumeration.hasMoreElements() )
+ {
ZipEntry el = (ZipEntry) enumeration.nextElement();
String entry = el.getName();
- if( entry.startsWith( "META-INF" ) && entry.endsWith( "pom.xml" ) ) {
+ if ( entry.startsWith( "META-INF" ) && entry.endsWith( "pom.xml" ) )
+ {
pomFileName = entry;
}
}
- if( pomFileName == null ) {
+ if ( pomFileName == null )
+ {
return null;
}
- ZipEntry pom =
- zipFile.getEntry( StringUtils.replace( pomFileName, File.separator, "/" ) );
- if( pom == null ) {
+ ZipEntry pom = zipFile.getEntry( StringUtils.replace( pomFileName, File.separator, "/" ) );
+ if ( pom == null )
+ {
pom = zipFile.getEntry( StringUtils.replace( pomFileName, "/", File.separator ) );
}
- if( pom == null ) {
+ if ( pom == null )
+ {
return null;
}
return pomManager.readPom( zipFile.getInputStream( pom ) );
}
- finally {
+ finally
+ {
closeZipFile( zipFile );
}
}
public ZipFile getArchetypeZipFile( File archetypeFile )
- throws UnknownArchetype {
- try {
+ throws UnknownArchetype
+ {
+ try
+ {
return new ZipFile( archetypeFile );
}
- catch( ZipException e ) {
+ catch ( ZipException e )
+ {
throw new UnknownArchetype( e );
}
- catch( IOException e ) {
+ catch ( IOException e )
+ {
throw new UnknownArchetype( e );
}
}
- public boolean isFileSetArchetype( File archetypeFile ) {
+ public boolean isFileSetArchetype( File archetypeFile )
+ {
ZipFile zipFile = null;
- try {
+ try
+ {
zipFile = getArchetypeZipFile( archetypeFile );
return isFileSetArchetype( zipFile );
}
- catch( XmlPullParserException e ) {