O'Reilly logo

Apache Maven 2 Effective Implementation by Maria Odea Ching, Brett Porter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing a new archetype

Aside from the archetypes included by default, we can also create our own custom archetype. In this section, we will learn how to do that.

An archetype consists of the following files:

  • The archetype descriptor (archetype.xml): This is where the specific files for the Maven directories are configured. For example, if we want App.java to be in the source directory, then this is where we specify that.
  • The archetype's pom.xml: Each archetype is also treated like a regular Maven project. In fact, they are just a JAR with resources in a special place.
  • The template directory structure: This will be copied into the generated project (remember the src/main/java/... directory layout created by the Maven Quickstart Archetype earlier). ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required