Frequently Asked Questions
- What packaging should I use:
maven-archetype
orjar
? What is the difference? -
maven-archetype
packaging is available since 2.0-alpha-1: it should be used instead ofjar
, 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: seemaven-archetype
packaging documentation for more information. - 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 insettings.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 idarchetype
orcentral
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 thesettings.xml
) are tried. - 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.
- How do I get files like
.gitignore
included into my archetype? -
First make sure you set
addDefaultExcludes
tofalse
in themaven-resources-plugin
so that the archetype-plugin gets to see these files.Then set
useDefaultExcludes
tofalse
in themaven-archetype-plugin
.