Maven snippets

February 26, 2013 by Michael

This post will contain some Maven snippets that i use and forget regularly (similar to my Git Post).

Download the sources of all dependencies of a project if available:

mvn dependency:sources

Download the JavaDoc for all dependencies if available:

mvn dependency:resolve -Dclassifier=javadoc -Dtype=jar

Check for updates of all direct dependencies:

mvn versions:display-dependency-updates

Skip signing of artifacts (i.e. for a local install of a snapshot)

mvn -Dgpg.skip=true install

If you need to branch from a tag and fix some bugs, i recommend to checkout the tag and then use

mvn release:branch -DbranchName=my-branch -DupdateBranchVersions=true -DupdateWorkingCopyVersions=false

This creates a new branch “my-branch” and updates the version to x.x.x-SNAPSHOT in the branch and leaves the working copy as is.

Run single tests or single methods in tests: Nice, official documentation right here

Execute a goal of a single, configured plugin with a given execution id:

mvn asciidoctor:process-asciidoc@generate-docs

List goals by the order they will execute

mvn fr.jcgay.maven.plugins:buildplan-maven-plugin:list

Group goals by phase

mvn fr.jcgay.maven.plugins:buildplan-maven-plugin:list-phase

Group goals by plugin

mvn fr.jcgay.maven.plugins:buildplan-maven-plugin:list-plugin

Last update: 2018/01/09

No comments yet

Post a Comment

Your email is never published nor shared. Required fields are marked *