Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is MOJO in Maven?

People also ask

What is Codehaus mojo?

org.codehaus.mojo » exec-maven-pluginApache. A plugin to allow execution of system and Java programs.

What is the default language for a Maven mojo?

Maven plugins can be written in Java or any of a number of scripting languages.

What is Maven plugin descriptor?

The Maven Plugin Plugin is used to create a Maven plugin descriptor for any Mojo's found in the source tree, to include in the JAR. It is also used to generate report files for the Mojos as well as the artifact metadata and generating a generic help goal.

What are the correct types of Maven plugins?

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.


Yes, from http://maven.apache.org/plugin-developers/index.html:

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.

In short, a mojo is a maven goal, to extend functionality not already found in maven.


As written here:

A Maven Plugin is a Maven artifact which contains a plugin descriptor and one or more Mojos. A Mojo can be thought of as a goal in Maven, and every goal corresponds to a Mojo. The compiler:compile goal corresponds to the CompilerMojo class in the Maven Compiler Plugin, and the jar:jar goal corresponds to the JarMojo class in the Maven Jar Plugin. When you write your own plugin, you are simply grouping together a set of related Mojos (or goals) in a single plugin artifact.

A Mojo simply associates with a Maven goal, so we can say a Mojo is much more than just a goal in Maven.


The Maven site says Mojo is the combination of "Maven" + "POJO (Plain Old Java Object)". So then, MOJO = Maven Old Java Object.

But another, different answer at Maven: The Complete Reference which I think is from the same group of people that are managing the Maven site suggest Mojo is meant to mean Magical POJO.


  • MOJO (Maven Old Java Object) is a goal in Maven.

  • In maven, everything is done by plugin, a plugin has one or more related mojos i.e. goals.

  • Mojo is single unit of task in maven.

for example : elicpse:eclipse the eclipse plugin with eclipse goal is a MOJO