Fork me on GitHub

Frequently Asked Questions

  1. What packaging should I use: maven-archetype or jar? What is the difference?
  2. How to generate a project from an archetype in a custom (potentially authenticated) repository?
  3. What is "Old Archetype 1.0.x"?
  4. How do I get files like .gitignore included into my archetype?
What packaging should I use: maven-archetype or jar? What is the difference?

maven-archetype packaging is available since 2.0-alpha-1: it should be used instead of jar, which was used for Old Archetype 1.0.x.

Using maven-archetype packaging helps identifying archetypes in repositories and adds archetype related bindings to build lifecycle: see maven-archetype packaging documentation for more information.

[top]


How to generate a project from an archetype in a custom (potentially authenticated) repository?

The server/repository id used to download the catalog is archetype: You have to define corresponding server configuration and repository in settings.xml with this id to generate a project based on the catalog In case of mirroring the mirror id of that mirror which matches repository id archetype or central is used for authentication. For resolving the actual archetype an artificial repository with id <archetype-artifactId>-repo is used in case the underlying Archetype Catalog Item contained a repository (leveraging its URL). As fallback all regular remote repositories (as defined in the settings.xml) are tried.

[top]


What is "Old Archetype 1.0.x"?

Old Archetype 1.0.x was using a archetype XML descriptor defined in /xsd/archetype-1.0.0.xsd: see old descriptor reference.

Archetype is now using archetype-descriptor XML descriptor defined in /xsd/archetype-descriptor-1.1.0.xsd: see Archetype descriptor reference.

For compatibility, old archetypes can still be used to generate new projects, but archetypes should be updated to the new descriptor format: in the future, old format will be removed.

[top]


How do I get files like .gitignore included into my archetype?

First make sure you set addDefaultExcludes to false in the maven-resources-plugin so that the archetype-plugin gets to see these files.

Then set useDefaultExcludes to false in the maven-archetype-plugin.

[top]