How to use my custom archetype with Maven?

后端 未结 2 732
名媛妹妹
名媛妹妹 2021-02-13 12:43

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

In my local repository, my archetype project was added corre

相关标签:
2条回答
  • 2021-02-13 13:22

    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 讨论(0)
  • 2021-02-13 13:30

    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 讨论(0)
提交回复
热议问题