Snippet from the output of running the 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.)
Running the following commands generated near-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
So what is the difference between maven-archetype-mojo
and maven-archetype-plugin
? Will either of these generate a sample plugin project? Why do we have both?
The Archetype Plugin allows the user to create a Maven project from an existing template called an archetype. It also allows the user to create an archetype from an existing project. This plugin requires Java 7.
An archetype to generate a simplifed sample J2EE application. An archetype to generate a sample a sample Maven plugin. An archetype to generate a sample Maven plugin. An archetype to generate a sample Maven plugin site.
maven-archetype-quickstart is an archetype which generates a sample Maven project: project. |-- pom. xml.
Introduction. In Maven, there are two kinds of plugins, build and reporting: Build plugins are executed during the build and configured in the <build/> element. Reporting plugins are executed during the site generation and configured in the <reporting/> element.
There is no difference. Maven Mojo is a minimal Maven Plugin.
What is a Mojo? A mojo is a Maven plain Old Java Object. Each mojo is an executable goal in Maven, and a plugin is a distribution of one or more related mojos.
I think we does not need both, just some mess in Maven world :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With