What is the difference between maven-archetype-mojo and maven-archetype-plugin?

Snapshot from the output of the mvn archetype:generate > a.txt command mvn archetype:generate > a.txt :

 332: remote -> org.apache.maven.archetypes:maven-archetype-mojo (An archetype which contains a sample a sample Maven plugin.) 333: remote -> org.apache.maven.archetypes:maven-archetype-plugin (An archetype which contains a sample Maven plugin.) 

Run the following commands generated by almost identical pom files and Java source classes:

 mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app-plugin -DarchetypeArtifactId=maven-archetype-plugin -DinteractiveMode=false mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app-mojo -DarchetypeArtifactId=maven-archetype-mojo -DinteractiveMode=false 

What is the difference between maven-archetype-mojo and maven-archetype-plugin ? Will any of them generate a sample plugin project? Why do we have both?

+7
java maven maven-3 maven-plugin
source share
1 answer

There is no difference. Maven Mojo is a minimal Maven plugin.

What is Mojo? Mojo is a simple Maven Java object. Each mojo is an executable target in Maven, and the plugin is a distribution of one or more related mojo.

I think we don’t need both, just a mess in the Maven world :)

+2
source share

All Articles