Maven

Installation

brew install maven

New Project

See: Creating a Project.

mvn archetype:generate \
    -DgroupId=com.cfclrk.$ProjectName \
    -DartifactId=$ProjectName \
    -DarchetypeArtifactId=maven-archetype-quickstart \
    -DarchetypeVersion=1.4 \
    -DinteractiveMode=false

Download Single Dependency

mvn org.apache.maven.plugins:maven-dependency-plugin:3.2.0:get \
    -Dartifact=com.amazonaws:aws-java-sdk-ec2:1.11.281

Versions

Show Dependency Version

For a Maven plugin:

mvn help:describe \
    -Dplugin=org.apache.maven.plugins:maven-deploy-plugin

For an application dependency:

mvn help:describe \
    -DgroupId=org.apache.maven.plugins \
    -DartifactId=maven-help-plugin

Show Outdated Dependencies

Uses the versions-maven-plugin.

mvn versions:display-dependency-updates
mvn versions:display-plugin-updates

Effective POM

The effective pom is the current POM combined with it's parents all the way up to the super pom.

mvn help:effective-pom

Archetypes

By default, I think maven uses the archetype catalog here: https://repo.maven.apache.org/maven2/archetype-catalog.xml

List Archetypes

mvn archetype:generate