• Home
  • LLMs
  • Python
  • Docker
  • Kubernetes
  • Java
  • Maven
  • All
  • About
Maven | Maven Help Plugin
  1. Maven Help Plugin
  2. The help goal
  3. The describe goal
  4. Troubleshooting

  1. Maven Help Plugin
    The Maven Help Plugin provides goals aimed at helping developers make sense of the build environment. It includes the ability to view the effective POM and settings files after inheritance and active profiles have been applied, as well as describe particular plugin goals to provide usage information.

    Plugin Coordinates:
    • Group Id: org.apache.maven.plugins
    • Artifact Id: maven-help-plugin
    • Version: 3.5.1

    Plugin Prefix: help

    The help plugin provides the following goals:
    • help: Displays help information about the maven-help-plugin itself.

    • describe: Displays detailed information about Maven plugins and their goals (Mojos - Maven Plain Old Java Objects).

    • system: Displays system properties and environment variables available to Maven.

    • effective-pom: Displays the effective POM as XML after all inheritance and profile activation.

    • effective-settings: Displays the calculated settings as XML for the current project context.

    • active-profiles: Lists all profiles that are currently active for the build.

    • all-profiles: Lists all available profiles in the current project hierarchy.

    • evaluate: Evaluates Maven expressions interactively, useful for debugging property resolution.
  2. The help goal
    The help goal provides general information about the help plugin, including available goals and their parameters.

    Use the detail parameter to get detailed information about all goals and their configuration options:
    # Display basic plugin information
    $ mvn help:help
    
    # Display detailed information about all goals and parameters
    $ mvn help:help -Ddetail=true
    If you need to use the plugin's full coordinates instead of its prefix, you can do that as follows:
    # Display basic plugin information
    $ mvn org.apache.maven.plugins:maven-help-plugin:3.5.1:help
    
    # Display detailed information about all goals and parameters
    $ mvn org.apache.maven.plugins:maven-help-plugin:3.5.1:help -Ddetail=true
    You can also use the Maven help plugin to describe the help plugin:
    # Basic plugin description using help plugin
    $ mvn help:describe -Dplugin="org.apache.maven.plugins:maven-help-plugin:3.5.1"
    
    # Detailed plugin description with all parameters
    $ mvn help:describe -Dplugin="org.apache.maven.plugins:maven-help-plugin:3.5.1" -Ddetail=true
    To get specific information about a goal, use the goal parameter:
    # Help for the 'help' goal
    $ mvn org.apache.maven.plugins:maven-help-plugin:3.5.1:help -Dgoal=help -Ddetail=true
    
    # Help for the 'help' goal using the help plugin
    $ mvn help:describe -Dplugin="org.apache.maven.plugins:maven-help-plugin:3.5.1" -Dgoal=help -Ddetail=true
    Note: When using the plugin's help goal directly, you don't need to specify the version if the plugin is already configured in your POM or if you want to use the latest version.
  3. The describe goal
    The describe goal provides detailed information about Maven plugins and their goals. This is one of the most useful goals for understanding any Maven plugin, including third-party plugins.

    Required Parameters: You must specify one of the following:
    • A 'cmd' parameter (for lifecycle phases or plugin:goal combinations)
    • A 'plugin' parameter (using plugin prefix or coordinates)
    • Both 'groupId' and 'artifactId' parameters

    Getting Help About the describe Goal Itself:
    $ mvn help:describe -Dplugin=help -Dgoal=describe -Ddetail=true
    $ mvn help:help -Dgoal=describe -Ddetail=true
    Usage Examples:
    • Describe a Lifecycle Phase:
      mvn help:describe -Dcmd=<phase-name>
      $ mvn help:describe -Dcmd=install
      $ mvn help:describe -Dcmd=compile
      $ mvn help:describe -Dcmd=package
    • Describe a Plugin Goal:
      mvn help:describe -Dcmd=<plugin-prefix:goal-name>
      $ mvn help:describe -Dcmd="help:describe"
      $ mvn help:describe -Dcmd="compiler:compile"
      $ mvn help:describe -Dcmd="surefire:test"
    • Describe Plugin by Prefix:
      mvn help:describe -Dplugin=<plugin-prefix>
      $ mvn help:describe -Dplugin=help
      $ mvn help:describe -Dplugin=compiler
      $ mvn help:describe -Dplugin=surefire
    • Describe Plugin by Group:Artifact:
      mvn help:describe -Dplugin=<group-id:artifact-id>
      $ mvn help:describe -Dplugin="org.apache.maven.plugins:maven-help-plugin"
      $ mvn help:describe -Dplugin="org.apache.maven.plugins:maven-compiler-plugin"
    • Describe Specific Plugin Version:
      mvn help:describe -Dplugin=<group-id:artifact-id:version>
      $ mvn help:describe -Dplugin="org.apache.maven.plugins:maven-help-plugin:3.5.1"
      $ mvn help:describe -Dplugin="org.springframework.boot:spring-boot-maven-plugin:2.7.0"
    • Describe Using Separate Parameters:
      mvn help:describe -DgroupId=<group-id> -DartifactId=<artifact-id>
      $ mvn help:describe -DgroupId="org.apache.maven.plugins" -DartifactId="maven-help-plugin"
    • Describe with Version Parameter:
      mvn help:describe -DgroupId=<group-id> -DartifactId=<artifact-id> -Dversion=<version>
      $ mvn help:describe -DgroupId="org.apache.maven.plugins" -DartifactId="maven-help-plugin" -Dversion="3.5.1"
    Common Parameters:
    • -Ddetail=true: Shows detailed parameter information for all goals, including default values and parameter types
    • -Dgoal=<goal-name>: Focuses on a specific goal within the plugin
    • -Dfull=true: Shows complete plugin information (deprecated, use -Ddetail=true)
    • -Dplugin=<plugin-name>: Lists all available goals for a plugin
    • -Dcmd=<phase-name>: Focuses on a specific lifecycle phase within the plugin
  4. Troubleshooting
    • Troubleshooting Build Issues
      The help plugin provides several goals useful for troubleshooting build problems:
      • Use mvn help:effective-pom to view the final POM after parent POM inheritance and profile activation. This shows the complete configuration Maven uses for the build
      • Use mvn help:active-profiles to verify which profiles are currently active. Profile activation can be affected by system properties, environment variables, or file presence
      • Use mvn help:system to check system properties and environment variables available to Maven during the build

    • Property Resolution and Evaluation
      The evaluate goal helps verify how Maven resolves property expressions.
      It is useful for debugging property resolution issues, especially in projects with complex inheritance or profile-based property overrides.

      Evaluation Modes:
      • Interactive mode: Maven prompts for expressions like: ${project.groupId}
      • Non-interactive mode: mvn help:evaluate -Dexpression=project.groupId -q -DforceStdout

      $ mvn help:evaluate
      [INFO] No artifact parameter specified, using 'mtitek.maven.samples:mtitek-maven-samples:jar:1.0.0-SNAPSHOT' as project.
      [INFO] Enter the Maven expression i.e. ${project.groupId} or 0 to exit?:
      
      $ mvn help:evaluate -Dexpression=project.groupId -q -DforceStdout
      mtitek.maven.samples
      
      Option:
      • -q (quiet): suppresses Maven's standard logging output, showing only the requested information.
      • -DforceStdout: outputs only the evaluated expression value.
© 2025  mtitek