Install Maven Archetype

后端 未结 4 1366
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-09 11:28

I have created a Maven archetype from an existing project. I have even installed the archetype in my local repository and used it to create a new project. Everything went pe

4条回答
  •  佛祖请我去吃肉
    2020-12-09 11:35

    Hi it is a late response, but I had the same problem that I didn't find a clear instruction how to share an archetype. So I hope that the following will help someone who struggles as lot as I did:

    • Develop your archetype: Either alone or with mvn archetype:create-from-project. There are enough instructions in the internet which explain how to do that.
    • Enter the distribution-management element in your pom.xml where the nexus-repository you want to publish/share your archetype must be defined. The link with the maven/settings.xml for the connection properties and so on is made with the id element and not with the url element.
    • call "mvn clean install" with all options you want to install the archetype in your local maven repository
    • call "mvn deploy" and maven will do the rest and update your remote archetype-catalog.xml by itself!
    • to test that the archetype is really recognized call "mvn archetype:generate -Dfilter=[your archetype artifactid]" and it should be in the list.

提交回复
热议问题