Skip to content

Commit 9ca73d0

Browse files
authored
1 parent 40e50df commit 9ca73d0

File tree

6 files changed

+59
-68
lines changed

6 files changed

+59
-68
lines changed

pom.xml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -387,18 +387,6 @@ under the License.
387387
</execution>
388388
</executions>
389389
</plugin>
390-
<plugin>
391-
<groupId>org.codehaus.plexus</groupId>
392-
<artifactId>plexus-component-metadata</artifactId>
393-
<version>2.2.0</version>
394-
<executions>
395-
<execution>
396-
<goals>
397-
<goal>generate-metadata</goal>
398-
</goals>
399-
</execution>
400-
</executions>
401-
</plugin>
402390
<!-- workaround to remove timestamp inserted by Modello 1.0.1 into generated .java and .xsd -->
403391
<plugin>
404392
<groupId>org.codehaus.gmaven</groupId>

src/main/java/org/apache/maven/plugins/announcement/AnnouncementMojo.java

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
*/
1919
package org.apache.maven.plugins.announcement;
2020

21+
import javax.inject.Inject;
22+
2123
import java.io.File;
2224
import java.io.FileOutputStream;
2325
import java.io.OutputStreamWriter;
@@ -28,7 +30,6 @@
2830
import java.util.Map;
2931

3032
import org.apache.maven.plugin.MojoExecutionException;
31-
import org.apache.maven.plugins.annotations.Component;
3233
import org.apache.maven.plugins.annotations.Mojo;
3334
import org.apache.maven.plugins.annotations.Parameter;
3435
import org.apache.maven.plugins.changes.ChangesXML;
@@ -77,7 +78,7 @@ public class AnnouncementMojo extends AbstractAnnouncementMojo {
7778
private static final String GIT_HUB = "GitHub";
7879

7980
/**
80-
* The name of the file which will contain the generated announcement. If no value is specified the plugin will use
81+
* The name of the file which will contain the generated announcement. If no value is specified, the plugin will use
8182
* the name of the template.
8283
*
8384
* @since 2.4
@@ -229,18 +230,6 @@ public class AnnouncementMojo extends AbstractAnnouncementMojo {
229230
@Parameter
230231
private String urlDownload;
231232

232-
/**
233-
* Velocity Component.
234-
*/
235-
@Component
236-
private VelocityComponent velocity;
237-
238-
/**
239-
* Component used to decrypt server information.
240-
*/
241-
@Component
242-
private SettingsDecrypter settingsDecrypter;
243-
244233
/**
245234
* Version of the artifact.
246235
*/
@@ -320,9 +309,6 @@ public class AnnouncementMojo extends AbstractAnnouncementMojo {
320309

321310
/**
322311
* The maximum number of issues to fetch from JIRA.
323-
* <p>
324-
* <b>Note:</b> In versions 2.0-beta-3 and earlier this parameter was called "nbEntries".
325-
* </p>
326312
*/
327313
@Parameter(property = "changes.maxEntries", defaultValue = "25", required = true)
328314
private int maxEntries;
@@ -346,9 +332,6 @@ public class AnnouncementMojo extends AbstractAnnouncementMojo {
346332
/**
347333
* Include issues from JIRA with these status ids. Multiple status ids can be specified as a comma separated list of
348334
* ids.
349-
* <p>
350-
* <b>Note:</b> In versions 2.0-beta-3 and earlier this parameter was called "statusId".
351-
* </p>
352335
*/
353336
@Parameter(property = "changes.statusIds", defaultValue = "Closed")
354337
private String statusIds;
@@ -467,10 +450,26 @@ public class AnnouncementMojo extends AbstractAnnouncementMojo {
467450
@Parameter(defaultValue = "false")
468451
private boolean includeOpenIssues;
469452

470-
private ReleaseUtils releaseUtils = new ReleaseUtils(getLog());
453+
private final ReleaseUtils releaseUtils = new ReleaseUtils(getLog());
471454

472455
private ChangesXML xml;
473456

457+
/**
458+
* Velocity Component.
459+
*/
460+
private VelocityComponent velocity;
461+
462+
/**
463+
* Component used to decrypt server information.
464+
*/
465+
private final SettingsDecrypter settingsDecrypter;
466+
467+
@Inject
468+
public AnnouncementMojo(VelocityComponent velocity, SettingsDecrypter settingsDecrypter) {
469+
this.velocity = velocity;
470+
this.settingsDecrypter = settingsDecrypter;
471+
}
472+
474473
// =======================================//
475474
// announcement-generate execution //
476475
// =======================================//
@@ -881,14 +880,6 @@ public void setUrlDownload(String urlDownload) {
881880
this.urlDownload = urlDownload;
882881
}
883882

884-
public VelocityComponent getVelocity() {
885-
return velocity;
886-
}
887-
888-
public void setVelocity(VelocityComponent velocity) {
889-
this.velocity = velocity;
890-
}
891-
892883
public String getVersion() {
893884
return version;
894885
}

src/main/java/org/apache/maven/plugins/changes/ChangesReport.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
*/
1919
package org.apache.maven.plugins.changes;
2020

21+
import javax.inject.Inject;
22+
2123
import java.io.File;
2224
import java.io.FileWriter;
2325
import java.io.IOException;
@@ -35,7 +37,6 @@
3537

3638
import org.apache.commons.collections.map.CaseInsensitiveMap;
3739
import org.apache.commons.io.input.XmlStreamReader;
38-
import org.apache.maven.plugins.annotations.Component;
3940
import org.apache.maven.plugins.annotations.Mojo;
4041
import org.apache.maven.plugins.annotations.Parameter;
4142
import org.apache.maven.plugins.changes.model.Release;
@@ -110,12 +111,6 @@ public class ChangesReport extends AbstractChangesReport {
110111
@Parameter
111112
private Map<String, String> issueLinkTemplatePerSystem;
112113

113-
/**
114-
* @since 2.2
115-
*/
116-
@Component
117-
private MavenFileFilter mavenFileFilter;
118-
119114
/**
120115
* Format to use for publishDate. The value will be available with the following expression ${publishDate}
121116
*
@@ -179,6 +174,13 @@ public class ChangesReport extends AbstractChangesReport {
179174

180175
private CaseInsensitiveMap caseInsensitiveIssueLinkTemplatePerSystem;
181176

177+
private MavenFileFilter mavenFileFilter;
178+
179+
@Inject
180+
public ChangesReport(MavenFileFilter mavenFileFilter) {
181+
this.mavenFileFilter = mavenFileFilter;
182+
}
183+
182184
/* --------------------------------------------------------------------- */
183185
/* Public methods */
184186
/* --------------------------------------------------------------------- */

src/main/java/org/apache/maven/plugins/changes/ChangesValidatorMojo.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@
1818
*/
1919
package org.apache.maven.plugins.changes;
2020

21+
import javax.inject.Inject;
22+
2123
import java.io.File;
2224
import java.util.List;
2325

2426
import org.apache.maven.plugin.MojoExecutionException;
25-
import org.apache.maven.plugins.annotations.Component;
2627
import org.apache.maven.plugins.annotations.Mojo;
2728
import org.apache.maven.plugins.annotations.Parameter;
2829
import org.apache.maven.plugins.changes.schema.ChangesSchemaValidator;
@@ -40,19 +41,14 @@
4041
@Mojo(name = "changes-validate", threadSafe = true)
4142
public class ChangesValidatorMojo extends AbstractChangesMojo {
4243

43-
/**
44-
*/
45-
@Component(role = ChangesSchemaValidator.class, hint = "default")
46-
private ChangesSchemaValidator changesSchemaValidator;
47-
4844
/**
4945
* The changes xsd version.
5046
*/
5147
@Parameter(property = "changes.xsdVersion", defaultValue = "1.0.0")
5248
private String changesXsdVersion;
5349

5450
/**
55-
* Mojo failure if validation failed. If not and validation failed only a warning will be logged.
51+
* Mojo failure if validation failed. If not and validation failed, only a warning will be logged.
5652
*/
5753
@Parameter(property = "changes.validate.failed", defaultValue = "false")
5854
private boolean failOnError;
@@ -63,6 +59,13 @@ public class ChangesValidatorMojo extends AbstractChangesMojo {
6359
@Parameter(property = "changes.xmlPath", defaultValue = "src/changes/changes.xml")
6460
private File xmlPath;
6561

62+
private ChangesSchemaValidator changesSchemaValidator;
63+
64+
@Inject
65+
public ChangesValidatorMojo(ChangesSchemaValidator changesSchemaValidator) {
66+
this.changesSchemaValidator = changesSchemaValidator;
67+
}
68+
6669
/**
6770
* @see org.apache.maven.plugin.Mojo#execute()
6871
*/

src/main/java/org/apache/maven/plugins/changes/schema/DefaultChangesSchemaValidator.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
*/
1919
package org.apache.maven.plugins.changes.schema;
2020

21+
import javax.inject.Named;
22+
import javax.inject.Singleton;
2123
import javax.xml.transform.stream.StreamSource;
2224
import javax.xml.validation.Schema;
2325
import javax.xml.validation.SchemaFactory;
@@ -31,15 +33,15 @@
3133
import java.util.Map;
3234

3335
import org.apache.commons.io.input.XmlStreamReader;
34-
import org.codehaus.plexus.component.annotations.Component;
3536
import org.xml.sax.SAXException;
3637

3738
/**
3839
* @author Olivier Lamy
3940
* @since 28 juil. 2008
4041
* @version $Id$
4142
*/
42-
@Component(role = ChangesSchemaValidator.class, hint = "default")
43+
@Named
44+
@Singleton
4345
public class DefaultChangesSchemaValidator implements ChangesSchemaValidator {
4446

4547
/** property schema */

src/main/java/org/apache/maven/plugins/github/GitHubReport.java

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@
1818
*/
1919
package org.apache.maven.plugins.github;
2020

21+
import javax.inject.Inject;
22+
2123
import java.net.MalformedURLException;
2224
import java.util.HashMap;
2325
import java.util.List;
2426
import java.util.Locale;
2527
import java.util.Map;
2628
import java.util.ResourceBundle;
2729

28-
import org.apache.maven.plugins.annotations.Component;
2930
import org.apache.maven.plugins.annotations.Mojo;
3031
import org.apache.maven.plugins.annotations.Parameter;
3132
import org.apache.maven.plugins.changes.AbstractChangesReport;
@@ -64,12 +65,6 @@ public class GitHubReport extends AbstractChangesReport {
6465
githubColumns.put("Updated", IssuesReportHelper.COLUMN_UPDATED);
6566
}
6667

67-
/**
68-
* Component used to decrypt server information.
69-
*/
70-
@Component
71-
private SettingsDecrypter settingsDecrypter;
72-
7368
/**
7469
* Sets the column names that you want to show in the report. The columns will appear in the report in the same
7570
* order as you specify them here. Multiple values can be separated by commas.
@@ -125,6 +120,20 @@ public class GitHubReport extends AbstractChangesReport {
125120
@Parameter(defaultValue = "false")
126121
private boolean onlyCurrentVersion;
127122

123+
/**
124+
* Component used to decrypt server information.
125+
*/
126+
private SettingsDecrypter settingsDecrypter;
127+
128+
@Inject
129+
public GitHubReport(SettingsDecrypter settingsDecrypter) {
130+
this.settingsDecrypter = settingsDecrypter;
131+
}
132+
133+
/* --------------------------------------------------------------------- */
134+
/* Public methods */
135+
/* --------------------------------------------------------------------- */
136+
128137
@Override
129138
public String getOutputName() {
130139
return "github-report";
@@ -140,10 +149,6 @@ public String getDescription(Locale locale) {
140149
return getBundle(locale).getString("report.issues.description");
141150
}
142151

143-
/* --------------------------------------------------------------------- */
144-
/* Public methods */
145-
/* --------------------------------------------------------------------- */
146-
147152
/**
148153
* @see org.apache.maven.reporting.AbstractMavenReport#canGenerateReport()
149154
*/

0 commit comments

Comments
 (0)