This is an automated email from the ASF dual-hosted git repository. slachiewicz pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-site.git
commit 0d3c6fe06ba57d1899e58c36803e77dfb6ca97b5 Author: Sylwester Lachiewicz <[email protected]> AuthorDate: Sat Oct 31 18:04:34 2026 +0000 Refresh the archetype guides --- .../introduction/introduction-to-archetypes.md | 19 ++---------- .../guides/mini/guide-creating-archetypes.md | 36 +++++++++++++++++----- 2 files changed, 31 insertions(+), 24 deletions(-) diff --git a/content/markdown/guides/introduction/introduction-to-archetypes.md b/content/markdown/guides/introduction/introduction-to-archetypes.md index aab31a5b..180d3317 100644 --- a/content/markdown/guides/introduction/introduction-to-archetypes.md +++ b/content/markdown/guides/introduction/introduction-to-archetypes.md @@ -39,24 +39,9 @@ Please refer to [Archetype Plugin page](/archetype/maven-archetype-plugin/). ## Provided Archetypes -Maven provides several Archetype artifacts: - -| Archetype ArtifactIds | Description | -|:----------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| maven-archetype-archetype | An archetype to generate a sample archetype project. | -| maven-archetype-j2ee-simple | An archetype to generate a simplifed sample J2EE application. | -| maven-archetype-plugin | An archetype to generate a sample Maven plugin. | -| maven-archetype-plugin-site | An archetype to generate a sample Maven plugin site. | -| maven-archetype-portlet | An archetype to generate a sample JSR-268 Portlet. | -| maven-archetype-quickstart | An archetype to generate a sample Maven project. | -| maven-archetype-simple | An archetype to generate a simple Maven project. | -| maven-archetype-site | An archetype to generate a sample Maven site which demonstrates some of the supported document types like APT, XDoc, and FML and demonstrates how to i18n your site. | -| maven-archetype-site-simple | An archetype to generate a sample Maven site. | -| maven-archetype-webapp | An archetype to generate a sample Maven Webapp project. | - -For more information on these archetypes, please refer to the [Maven Archetype Bundles page](/archetypes/index.html). +For the list of archetypes that Maven provides, see [Maven Archetype Bundles](https://maven.apache.org/archetypes/). ## What makes up an Archetype? -Archetypes are packaged up in a JAR and they consist of the archetype metadata which describes the contents of archetype, and a set of [Velocity](http://velocity.apache.org/) templates which make up the prototype project. If you would like to know how to make your own archetypes, please refer to our [Guide to creating archetypes](../mini/guide-creating-archetypes.html). +Archetypes are packaged up in a JAR and they consist of the archetype metadata which describes the contents of archetype, and a set of [Velocity](https://velocity.apache.org/) templates which make up the prototype project. If you would like to know how to make your own archetypes, please refer to our [Guide to creating archetypes](../mini/guide-creating-archetypes.html). diff --git a/content/markdown/guides/mini/guide-creating-archetypes.md b/content/markdown/guides/mini/guide-creating-archetypes.md index b38633fe..decd7054 100644 --- a/content/markdown/guides/mini/guide-creating-archetypes.md +++ b/content/markdown/guides/mini/guide-creating-archetypes.md @@ -127,20 +127,42 @@ An example for a prototype `pom.xml` is: <packaging>jar</packaging> <name>${artifactId}</name> - <url>http://www.myorganization.org</url> + <url>https://www.myorganization.org</url> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <maven.compiler.release>17</maven.compiler.release> + </properties> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.junit</groupId> + <artifactId>junit-bom</artifactId> + <version>5.11.0</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> <dependencies> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.12</version> - <scope>test</scope> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-api</artifactId> + <scope>test</scope> </dependency> </dependencies> </project> ``` -## 4. Install the archetype and run the archetype plugin +The `junit-bom` import in `dependencyManagement` sets the version of every JUnit artifact, so the dependencies do not declare one. + +## 4. Test the archetype + +Before you install the archetype, add at least one integration test. Each test is a directory in `src/test/resources/projects/` of the archetype project, containing an `archetype.properties` file with the values for the generation and a `goal.txt` file with the Maven goals to run in the generated project. It can also contain a `reference/` directory with the expected project, and a `verify.groovy` script. The `archetype:integration-test` goal, which the `maven-archetype` packaging runs d [...] + +## 5. Install the archetype and run the archetype plugin Now you are ready to install the archetype: @@ -173,4 +195,4 @@ mvn archetype:generate -DarchetypeArtifactId=maven-archetype-archetype ``` -Afterwhich, you can now customize the contents of the `archetype-resources` directory, and `archetype-metadata.xml`, then, proceed to Step#4 (Install the archetype and run the archetype plugin). +Afterwhich, you can now customize the contents of the `archetype-resources` directory, and `archetype-metadata.xml`, then test, install and try out the archetype as described in the previous steps.
