Just upgrade your maven plugin version to 3.3 or 3.4
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-plugin-plugin</artifactId> <version>3.3</version> </plugin> </plugins> </build>
will not fix any problem (as some claim).
You must add a minimum of default-descriptor execution with the correct phase. Thus, the minimum configuration of assembly information is as follows:
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-plugin-plugin</artifactId> <version>3.1</version> <executions> <execution> <id>default-descriptor</id> <phase>process-classes</phase> </execution> </executions> </plugin> </plugins> </build>
regardless of maven-plugin-plugin version. (this can be 3.1, 3.2, 3.3 3.4 (do not check the rest)).
will give:
... [INFO] --- maven-plugin-plugin:3.2:descriptor (default-descriptor) @ example-maven-plugin --- [WARNING] Using platform encoding (UTF-8 actually) to read mojo metadata, ie build is platform dependent! [INFO] Applying mojo extractor for language: java-annotations [INFO] Mojo extractor for language: java-annotations found 1 mojo descriptors. [INFO] Applying mojo extractor for language: java [INFO] Mojo extractor for language: java found 0 mojo descriptors. [INFO] Applying mojo extractor for language: bsh [INFO] Mojo extractor for language: bsh found 0 mojo descriptors. ... [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------
Alternatively, if you do not want your pump to have built-in tags, you can use javadocs on your Mojo. For example:
@Mojo(name = "run123") public class MyMojo extends AbstractMojo { }
will give:
... [INFO] --- maven-plugin-plugin:3.2:descriptor (default-descriptor) @ example-maven-plugin --- [WARNING] Using platform encoding (UTF-8 actually) to read mojo metadata, ie build is platform dependent! [INFO] Applying mojo extractor for language: java-annotations [INFO] Mojo extractor for language: java-annotations found 0 mojo descriptors. [INFO] Applying mojo extractor for language: java [INFO] Mojo extractor for language: java found 1 mojo descriptors. [INFO] Applying mojo extractor for language: bsh [INFO] Mojo extractor for language: bsh found 0 mojo descriptors. ... [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------
Please refer to this guide for more information http://maven.apache.org/plugin-tools/maven-plugin-plugin/examples/using-annotations.html
randomUser56789 Mar 20 '16 at 0:21 2016-03-20 00:21
source share