13

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

3
  • What is the exact error message? Have you specified the version? Nov 21, 2012 at 20:32
  • When I use all correct parameters with specified version, the message is : he didn't find the archetype. If I use the command without parameters I obtain an archetype list and there is not my own archetype Nov 21, 2012 at 22:17
  • Maybe I have to specify a parameter command like that : -DarchetypeCatalog=local to see my archetype, I will test it tomorrow. Nov 21, 2012 at 22:20

2 Answers 2

22

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

0

To install the archetype run the following maven command:-

mvn clean install archetype:update-local-catalog

This would basically create an xml file corresponding to the archetype catalog in your repository. Hereafter, you can go the Maven Archetypes setting in your IDE and select Add Local Cataglog option and provide this local catalog path. Now, it should be visible while you are creating the new maven project from your IDE.

0

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.