Skip to content

Instantly share code, notes, and snippets.

@imtiazShakil
Last active December 14, 2021 13:09
Show Gist options
  • Select an option

  • Save imtiazShakil/b6a1238862131028833546070bd8efb1 to your computer and use it in GitHub Desktop.

Select an option

Save imtiazShakil/b6a1238862131028833546070bd8efb1 to your computer and use it in GitHub Desktop.
Maven Tips & Tricks

Maven select profile

./mvnw clean install -P myprofie

Run Maven goals from another directory

./mvnw -f /location/to/different/pom/directory clean package

Maven select specific project (in a multi module project)

./mvnw clean install -pl 'child-project'

Maven skip specific project (in a multi module project)

./mvnw clean install -pl '!child-project'

Maven skip multiple projects (in a multi module project)

./mvnw clean install -pl '!child-project, !child2, !child3'

Maven skip all tests

./mvnw clean install -DskipTests

Maven print properties

./mvnw help:evaluate

[INFO] Enter the Maven expression i.e. ${project.groupId} or 0 to exit?:
${project.properties}

Maven print active profiles

./mvnw help:active-profiles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment