Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use my custom archetype with Maven?

I just create my custom archetype project, and I run perfectly the "mvn install" command.

In my local repository, my archetype project was added correctly via m2/repository/com/mycomp/archetype-project-name.
(but it was not created in the archetype folder : m2/repository/org/apache/maven/archetypes : maybe it's normal)

But now I can't use my new custom archetype with the "mvn archetype:generation" command :

  • with good parameters Maven tell me he doesn't find the archetype
  • without parameters, my archetype doesn't exist in the archetype list.

Should I execute the mvn deploy command too ? I tried this, but I haven't configure another internal repository yet and it fails.

Thank in advance for your help

like image 722
user1842947 Avatar asked Nov 21 '12 18:11

user1842947


1 Answers

I've found a solution : when I install my archetype I need to use the option archetype:update-locate-catalog like this :

mvn install archetype:update-local-catalog

Instead a simple "mvn install" command.

And now I find my new custom archetrype in the local catalog when I want generate a new custom project :

mvn archetype:generate -DarchetypeCatalog=local

like image 71
user1842947 Avatar answered Oct 10 '22 19:10

user1842947