Issue
I have created a architype from an existing project using the mvn archetype:create-from-project
command. I then use the mvn deploy to deploy the architype to my nexus repo. Now how can other developers use this architype ? I can use mvn archetype:generate -DarchetypeCatalog=local
to gain access to archetype install on my local machine, but once i used the mvn deploy, hwo can other developers do this ?
Solution
When you created the archetype, you assigned it a group and artefactid, so now you can run the following command. I'm also assuming that you've already deployed the artefact to nexus (although you mentioned that in your question) and that all the devs computers have maven configured to use your local nexus repository (this is important)
mvn org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:generate \
-B -DarchetypeGroupId=<archetype groupId> \
-DarchetypeArtifactId=<archetype artifactId> \
-DarchetypeVersion=<archetype version> \
-DgroupId=new_project_group_id \
-DartifactId=new_project_artefact_id \
-Dversion=1.0.0-SNAPSHOT
That is the command I run to create projects from the archetypes we have at work. You might want to know that the archetype plugin has a newer version available, but this command works, so we haven't changed it :).
Answered By - Augusto