Skip to content

Commit 611ec4b

Browse files
authored
modulelist maven plugin refactoring (#4887)
Signed-off-by: Maxim Nesen <[email protected]>
1 parent 8fed3c6 commit 611ec4b

File tree

3 files changed

+53
-8
lines changed

3 files changed

+53
-8
lines changed

tools/jersey-doc-modulelist-maven-plugin/pom.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2222
<modelVersion>4.0.0</modelVersion>
2323

24+
<parent>
25+
<groupId>org.eclipse.ee4j</groupId>
26+
<artifactId>project</artifactId>
27+
<version>1.0.7</version>
28+
</parent>
29+
2430
<groupId>org.glassfish.jersey.tools.plugins</groupId>
2531
<artifactId>jersey-doc-modulelist-maven-plugin</artifactId>
2632
<packaging>maven-plugin</packaging>
@@ -53,6 +59,12 @@
5359
<artifactId>maven-dependency-tree</artifactId>
5460
<version>${maven.shared.version}</version>
5561
</dependency>
62+
<dependency>
63+
<groupId>org.apache.maven.plugin-tools</groupId>
64+
<artifactId>maven-plugin-annotations</artifactId>
65+
<version>3.6.1</version>
66+
<scope>provided</scope>
67+
</dependency>
5668
</dependencies>
5769

5870
<build>
@@ -74,6 +86,23 @@
7486
<fork>false</fork>
7587
</configuration>
7688
</plugin>
89+
<plugin>
90+
<groupId>org.apache.maven.plugins</groupId>
91+
<artifactId>maven-plugin-plugin</artifactId>
92+
<version>3.6.0</version>
93+
<configuration>
94+
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
95+
</configuration>
96+
<executions>
97+
<execution>
98+
<id>default-descriptor</id>
99+
<goals>
100+
<goal>descriptor</goal>
101+
</goals>
102+
<phase>process-classes</phase>
103+
</execution>
104+
</executions>
105+
</plugin>
77106
</plugins>
78107
</build>
79108

tools/jersey-doc-modulelist-maven-plugin/src/main/java/org/glassfish/jersey/tools/plugins/GenerateJerseyModuleListMojo.java

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -21,6 +21,10 @@
2121
import org.apache.maven.plugin.AbstractMojo;
2222
import org.apache.maven.plugin.MojoExecutionException;
2323
import org.apache.maven.plugin.logging.Log;
24+
import org.apache.maven.plugins.annotations.Component;
25+
import org.apache.maven.plugins.annotations.LifecyclePhase;
26+
import org.apache.maven.plugins.annotations.Mojo;
27+
import org.apache.maven.plugins.annotations.Parameter;
2428
import org.apache.maven.project.MavenProject;
2529

2630
import java.io.BufferedReader;
@@ -41,10 +45,11 @@
4145
* The plugins main MOJO class.
4246
* Walks through the maven dependency tree and creates the docbook output file.
4347
*
44-
* @goal generate
45-
* @phase process-sources
46-
* @aggregator
48+
* goal: generate
49+
* phase: process-sources
50+
* aggregator
4751
*/
52+
@Mojo(name = "generate", aggregator = true, defaultPhase = LifecyclePhase.PROCESS_SOURCES)
4853
public class GenerateJerseyModuleListMojo extends AbstractMojo {
4954

5055
/**
@@ -82,18 +87,21 @@ public class GenerateJerseyModuleListMojo extends AbstractMojo {
8287
* @required
8388
* @readonly
8489
*/
90+
@Parameter(defaultValue = "${project.basedir}")
8591
private MavenProject mavenProject;
8692

8793
/**
8894
* @component
8995
* @required
9096
* @readonly
9197
*/
98+
@Parameter( defaultValue = "${session}", readonly = true )
9299
private MavenSession mavenSession;
93100

94101
/**
95102
* @parameter default-value="modules.xml"
96103
*/
104+
@Parameter(defaultValue = "modules.xml")
97105
private String outputFileName;
98106

99107
/**
@@ -103,6 +111,7 @@ public class GenerateJerseyModuleListMojo extends AbstractMojo {
103111
*
104112
* @parameter
105113
*/
114+
@Parameter
106115
private String templateFileName;
107116

108117
/**
@@ -112,6 +121,7 @@ public class GenerateJerseyModuleListMojo extends AbstractMojo {
112121
*
113122
* @parameter
114123
*/
124+
@Parameter
115125
private String tableHeaderFileName;
116126

117127
/**
@@ -120,6 +130,7 @@ public class GenerateJerseyModuleListMojo extends AbstractMojo {
120130
*
121131
* @parameter
122132
*/
133+
@Parameter
123134
private String tableFooterFileName;
124135

125136
/**
@@ -129,11 +140,13 @@ public class GenerateJerseyModuleListMojo extends AbstractMojo {
129140
*
130141
* @parameter
131142
*/
143+
@Parameter
132144
private String tableRowFileName;
133145

134146
/**
135147
* @parameter default-value="false"
136148
*/
149+
@Parameter(defaultValue = "false")
137150
private boolean outputUnmatched;
138151

139152
private Configuration configuration;

tools/jersey-doc-modulelist-maven-plugin/src/main/java/org/glassfish/jersey/tools/plugins/HelpMojo.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -20,14 +20,17 @@
2020
import org.apache.maven.plugin.MojoExecutionException;
2121
import org.apache.maven.plugin.MojoFailureException;
2222
import org.apache.maven.plugin.logging.Log;
23+
import org.apache.maven.plugins.annotations.LifecyclePhase;
24+
import org.apache.maven.plugins.annotations.Mojo;
2325

2426
/**
2527
* Displays the plugin help message.
2628
*
27-
* @goal help
28-
* @phase process-sources
29-
* @aggregator
29+
* goal: help
30+
* phase: process-sources
31+
* aggregator
3032
*/
33+
@Mojo(name = "help", aggregator = true, defaultPhase = LifecyclePhase.PROCESS_SOURCES)
3134
public class HelpMojo extends AbstractMojo {
3235

3336
private Log log;

0 commit comments

Comments
 (0)