Maven provides a –h
command-line flag to display various command-line parameters that it supports. However, there is a Help plugin that helps you get other information.
mvn help:effective-pom
project-with-profile
):mvn help:all-profiles
[INFO] --- maven-help-plugin:2.2:all-profiles (default-cli) @ project-with-profile --- [INFO] Listing Profiles for Project: com.packt.cookbook:project-with-profile:jar :1.0-SNAPSHOT Profile Id: dev (Active: false , Source: pom)
mvn –help:active-profiles
Active Profiles for Project 'com.packt.cookbook:project-with-profile:jar:1.0-SNAPSHOT': The following profiles are active:
mvn –Pdev help:active-profiles
Active Profiles for Project 'com.packt.cookbook:project-with-profile:jar:1.0-SNAPSHOT': The following profiles are active: - dev (source: com.packt.cookbook:project-with-profile:1.0-SNAPSHOT)
The Maven Help plugin provides different goals. These are also supported by IDEs, and are as follows:
effective-pom
: This displays the pom file that will be used by Maven after applying inheritance, interpolation, and profiles. This is useful to know the final pom file when it is needed for troubleshooting.all-profiles
: This goal displays all the profiles that are available for the project. It indicates whether the profiles are active or not.active-profiles
: This goal displays the list of active profiles. We explicitly enabled the dev
profile (which was not active by default), so it showed up in the list of active profiles.The Maven Help plugin provides a few other goals as well. A notable one is the describe
goal, which is used to get details of any plugin.
mvn help:describe -DgroupId=org.jacoco -DartifactId=jacoco-maven-plugin -Ddetail=true
3.144.17.128