Azad
Azad

Reputation: 399

Maven Archetype Installation

I wana configure a Java EE project with primefaces. I read somewhere that I can create a project structure with mvn arechetype:generate. When I used that I just saw 41 options while in that tutorial that command shows more than three hundred options. When I searched about it, I found that I should install new arechtypes in my Maven installation. but I don't know how! Do someone know how I can add (or install) my desired archetypes in my Maven installation?

Upvotes: 5

Views: 13112

Answers (2)

mantrid
mantrid

Reputation: 2840

use maven-archetype plugin, it may save you a little bit of pain

Upvotes: 0

domi
domi

Reputation: 2257

installing an archetype is no different then any other artifact, just use:

$> mvn install

after this your already able generate a new project from the new archetype (although you have to define all the details on the command line - e.g. groupId, artifactId, version...). But if you would like to have it also in the local archetype catalog, then use

$> mvn install archetype:update-local-catalog

If you already have other archetypes in your local repo which are not in your catalog, you can use 'archetype:crawl'.

saying this, please make sure to use 'maven-archetype' as your packaging type, this will ease the crawling of new archetypes. see also: http://maven.apache.org/archetype/maven-archetype-plugin/faq.html

Upvotes: 12

Related Questions