Fork me on GitHub

Maven Archetype Packaging

This is 'maven-archetype' packaging configuration for archetype projects. It provides maven-archetype-plugin bindings to default lifecycle:

in addition to classical resource/jar/install/deploy. See Archetype Packaging Reference for details.

Usage

Declaring maven-archetype packaging to your pom is not the only step required:

  • to be available from an the archetype project, the packaging must be added as an extension,
  • to ensure a reproducible build, the archetype plugin version needs to be locked down in pluginManagement section.

Typical pom.xml contains:

  1. <project>
  2. ...
  3. <packaging>maven-archetype</packaging>
  4. ...
  5. <build>
  6. <extensions>
  7. <extension>
  8. <groupId>org.apache.maven.archetype</groupId>
  9. <artifactId>archetype-packaging</artifactId>
  10. <version>3.3.1</version>
  11. </extension>
  12. </extensions>
  13.  
  14. <pluginManagement>
  15. <plugins>
  16. <plugin>
  17. <groupId>org.apache.maven.plugins</groupId>
  18. <artifactId>maven-archetype-plugin</artifactId>
  19. <version>3.3.1</version>
  20. </plugin>
  21. </plugins>
  22. </pluginManagement>
  23. </build>
  24. </project>