Fork me on GitHub
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 an authenticated repository?

The server id used to download the artifact is [archetypeArtifactId]-repo: you have to define corresponding server configuration in settings.xml with this id.

[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]