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
If you want to run single (integration) tests but the build fails because you didn’t run unit tests, add
-DfailIfNoTests=false |
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