Adding Mojo Plugin to Your Project

Related to

The following would be added to the pom.xml file.


The groupId, artifactId and version can be found from the Full Name in the documentation:

If you are trying to use a different plugin, google “<artifactId>maven-versions-plugin</artifactId>”. Other plugins are available at

With this plugin you can run the following to change the version.

mvn versions:set -DnewVersion=1.0.8

If you wish to use, ‘mvn versions:compare-dependencies’, you will get an error “One or more required plugin parameters are invalid/missing for ‘versions:compare-dependencies’. There are two options. Inside the plugin tags of the pom.xml file, add the configuration and remotePom tags to define the remote pom file or specify from the command line via:

mvn versions:compare-dependencies -DremotePom=com.mycompany.myapp:my-app:1.0.3

You will need the pom to compare in a central maven repository.

You can backup your pom.xml file by running the mvn version command above. Then, try

mvn verions:use-latest-versions

Compare the pom.xml files using a diff tool (Like Notepad++).

Here is a command line (Unix) to add a dependency to the pom.xml file.

sed 's/<dependencies>/<dependencies>\r\n<!--ghost-->\r\n<dependency>\r\n<groupId>org.ghost4j<\/groupId>\r\n<artifactId>ghost4j<\/artifactId>\r\n<version>0.5.0<\/version>\r\n<\/dependency>\r\n<!--ghost-->/g' pom.xml > pom2.xml

1 thought on “Adding Mojo Plugin to Your Project

  1. Pingback: Maven: Add license header to source - Antonio Musarra's Blog | Antonio Musarra's Blog

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s