Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 950
Azad Avatar asked Dec 10 '11 14:12

Azad


1 Answers

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

like image 92
domi Avatar answered Sep 28 '22 07:09

domi