Maven - Plugin (Mojo)

Card Puncher Data Processing

About

A plugin (in Maven 2.0) groups together goals by code. It's an independent unit of code for Maven.

It look like a dependency.

In Maven, there are:

  • Build plugins. They will be executed during the build and then, they should be configured in the element of the pom.xml file.
  • Reporting plugins. They will be executed during the site generation and they should be configured in the element.

Example

Configure the Java compiler to allow JDK 5.0 sources.

The below compiler plugin is already used as part of the build process and this just changes the configuration.

<build>
	<plugins>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-compiler-plugin</artifactId>
			<version>2.5.1</version>
			<configuration>
				<source>1.5</source>
				<target>1.5</target>
			</configuration>
			<executions>
				<execution>
					<phase>package</phase>
					<!-- bind to the packaging phase -->
					<goals>
						<goal>compile</goal>
					</goals>
				</execution>
			</executions>
		</plugin>
	</plugins>
</build>

where:

Management

List

See the Plugins List

Configuration

To find out

Development





Discover More
Card Puncher Data Processing
Maven

is a build tool. It is declarative build tool whereas ant is a procedural build tool. You can then change the build process by changing the process not the declaration. Most of the project declaration...
Card Puncher Data Processing
Maven - Archetype Plugin - Project (Pattern|Model)

Archetype is a plugin. An archetype is defined as an original pattern or model from which all other things of the same kind are made. In Maven, an archetype is a template of a project which is combined...
Card Puncher Data Processing
Maven - Eclipse

Eclipse can refer to the: maven plugin in or the eclipse plugin Eclipse is a phase in order to generate a project file Eclipse plugins for Maven...
Card Puncher Data Processing
Maven - Goal

A goal is the execution part of a plugin. An individual plugin may have multiple goals. Each goal may have a separate configuration. If you are familiar with Ant, a goal is similar to a task. A goal...
Card Puncher Data Processing
Maven - GroupId

GroupId is the first coordinate of an artifact that indicates the unique identifier of the organization or group that created the project. It's the Maven jargon for the package name. org.apache.maven.plugins...
Card Puncher Data Processing
Maven - JRE (Including it in your distribution)

A JRE is just a dependency Therefore you can upload it to a repository and use it in your build. With a file named jre-1.7.80-windows-x64.zip, we will get the following artifact coordinates: ...
Maven Execution Id
Maven - Plugin Execution

A plugin execution where: where: executionId see Default ??? default in the POM model default-cli from the command line default-goalName mojo bound to the build lifecycle...
Card Puncher Data Processing
Maven - Prefix (Plugin Alias)

A prefix is a named alias for a plugin. The prefix assignation is done automatically if the plugin naming convention is used: -maven-plugin or maven--plugin (if the plugin is part of the...
Card Puncher Data Processing
Maven - Project

A project in the Maven sense contains all little pieces that come into play to give code life. Ie: configuration files, the developers involved and the roles they play, the defect tracking system,...
Card Puncher Data Processing
Maven - Test

Test is a phase that: execute the tests. test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed The Maven lifecycle...



Share this page:
Follow us:
Task Runner