logo Maven Plugin Plugin

The Plugin Plugin is used to create a Maven plugin descriptor for any Mojo's found in the source tree, to include in the JAR. It is also used to generate Xdoc files for the Mojos as well as the artifact metadata and a generic help goal.

homepage: maven.apache.org/plugin-tools
fresh index:
last release: 2 months ago, first release: 2 decades ago
packaging: maven-plugin
get this artifact from: central
see this artifact on: search.maven.org


Display vulnerabilities (snyk): Vulnerability check

This chart shows how much is this artifact used as a dependency in other Maven artifacts in Central repository and GitHub:


select version:

Add this snippet into pom.xml inside tag <project><build><plugins>:




Switch to artifact.
goals:
plugin:addPluginArtifactMetadata (phase: package)

Inject any plugin-specific artifact metadata to the project's artifact, for subsequent installation and deployment. It is used: to add the latest metadata (which is plugin-specific) for shipping alongside the plugin's artifact to define plugin mapping in the group

plugin:descriptor (phase: process-classes)

Generate a plugin descriptor. Note: Since 3.0, for Java plugin annotations support, default phase defined by this goal is after the "compilation" of any scripts. This doesn't override the default binding coded at generate-resources phase in Maven core.

plugin:help

Display help information on maven-plugin-plugin. Call mvn plugin:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.

plugin:helpmojo (phase: generate-sources)

Generates a HelpMojo class.

plugin:report

Generates the Plugin's documentation report: plugin-info.html plugin overview page, and one goal-mojo.html per goal.

Often used code snippets:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-plugin-plugin</artifactId>
  <version>3.6.0</version>
  <executions>
    <execution>
      <id>default-descriptor</id>
      <phase>process-classes</phase>
    </execution>
  </executions>
</plugin>
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-plugin-plugin</artifactId>
  <version>3.5</version>
  <executions>
    <execution>
      <id>default-descriptor</id>
      <phase>process-classes</phase>
    </execution>
  </executions>
</plugin>
<plugin>
  <artifactId>maven-plugin-plugin</artifactId>
  <configuration>
    <goalPrefix>packager</goalPrefix>
  </configuration>
</plugin>
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-plugin-plugin</artifactId>
  <configuration>
    <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
  </configuration>
  <executions>
    <execution>
      <id>mojo-descriptor</id>
      <goals>
        <goal>descriptor</goal>
      </goals>
    </execution>
  </executions>
</plugin>
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-plugin-plugin</artifactId>
  <executions>
    <execution>
      <id>default-descriptor</id>
      <phase>process-classes</phase>
    </execution>
  </executions>
  <configuration>
    <goalPrefix>xar</goalPrefix>
  </configuration>
</plugin>

© Jiri Pinkas 2015 - 2022. All rights reserved! Admin login To submit bugs / feature requests please use this github page
related: JavaVids | Top Java Blogs | Java školení
Apache and Apache Maven are trademarks of the Apache Software Foundation. The Central Repository is a service mark of Sonatype, Inc.