diff --git a/pom.xml b/pom.xml index 913a4f32..9e852d1d 100644 --- a/pom.xml +++ b/pom.xml @@ -392,18 +392,6 @@ under the License. - - org.codehaus.plexus - plexus-component-metadata - 2.2.0 - - - - generate-metadata - - - - org.codehaus.gmaven diff --git a/src/main/java/org/apache/maven/plugins/announcement/AnnouncementMojo.java b/src/main/java/org/apache/maven/plugins/announcement/AnnouncementMojo.java index 4fd7a8f3..65b75577 100644 --- a/src/main/java/org/apache/maven/plugins/announcement/AnnouncementMojo.java +++ b/src/main/java/org/apache/maven/plugins/announcement/AnnouncementMojo.java @@ -18,6 +18,8 @@ */ package org.apache.maven.plugins.announcement; +import javax.inject.Inject; + import java.io.File; import java.io.FileOutputStream; import java.io.OutputStreamWriter; @@ -28,7 +30,6 @@ import java.util.Map; import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.changes.ChangesXML; @@ -77,7 +78,7 @@ public class AnnouncementMojo extends AbstractAnnouncementMojo { private static final String GIT_HUB = "GitHub"; /** - * The name of the file which will contain the generated announcement. If no value is specified the plugin will use + * The name of the file which will contain the generated announcement. If no value is specified, the plugin will use * the name of the template. * * @since 2.4 @@ -229,18 +230,6 @@ public class AnnouncementMojo extends AbstractAnnouncementMojo { @Parameter private String urlDownload; - /** - * Velocity Component. - */ - @Component - private VelocityComponent velocity; - - /** - * Component used to decrypt server information. - */ - @Component - private SettingsDecrypter settingsDecrypter; - /** * Version of the artifact. */ @@ -320,9 +309,6 @@ public class AnnouncementMojo extends AbstractAnnouncementMojo { /** * The maximum number of issues to fetch from JIRA. - *

- * Note: In versions 2.0-beta-3 and earlier this parameter was called "nbEntries". - *

*/ @Parameter(property = "changes.maxEntries", defaultValue = "25", required = true) private int maxEntries; @@ -346,9 +332,6 @@ public class AnnouncementMojo extends AbstractAnnouncementMojo { /** * Include issues from JIRA with these status ids. Multiple status ids can be specified as a comma separated list of * ids. - *

- * Note: In versions 2.0-beta-3 and earlier this parameter was called "statusId". - *

*/ @Parameter(property = "changes.statusIds", defaultValue = "Closed") private String statusIds; @@ -467,10 +450,26 @@ public class AnnouncementMojo extends AbstractAnnouncementMojo { @Parameter(defaultValue = "false") private boolean includeOpenIssues; - private ReleaseUtils releaseUtils = new ReleaseUtils(getLog()); + private final ReleaseUtils releaseUtils = new ReleaseUtils(getLog()); private ChangesXML xml; + /** + * Velocity Component. + */ + private VelocityComponent velocity; + + /** + * Component used to decrypt server information. + */ + private final SettingsDecrypter settingsDecrypter; + + @Inject + public AnnouncementMojo(VelocityComponent velocity, SettingsDecrypter settingsDecrypter) { + this.velocity = velocity; + this.settingsDecrypter = settingsDecrypter; + } + // =======================================// // announcement-generate execution // // =======================================// @@ -881,14 +880,6 @@ public void setUrlDownload(String urlDownload) { this.urlDownload = urlDownload; } - public VelocityComponent getVelocity() { - return velocity; - } - - public void setVelocity(VelocityComponent velocity) { - this.velocity = velocity; - } - public String getVersion() { return version; } diff --git a/src/main/java/org/apache/maven/plugins/changes/ChangesReport.java b/src/main/java/org/apache/maven/plugins/changes/ChangesReport.java index b43c2294..faac3dcf 100644 --- a/src/main/java/org/apache/maven/plugins/changes/ChangesReport.java +++ b/src/main/java/org/apache/maven/plugins/changes/ChangesReport.java @@ -18,6 +18,8 @@ */ package org.apache.maven.plugins.changes; +import javax.inject.Inject; + import java.io.File; import java.io.FileWriter; import java.io.IOException; @@ -35,7 +37,6 @@ import org.apache.commons.collections.map.CaseInsensitiveMap; import org.apache.commons.io.input.XmlStreamReader; -import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.changes.model.Release; @@ -126,12 +127,6 @@ public class ChangesReport extends AbstractChangesReport { @Parameter private Map issueLinkTemplatePerSystem; - /** - * @since 2.2 - */ - @Component - private MavenFileFilter mavenFileFilter; - /** * Format to use for publishDate. The value will be available with the following expression ${publishDate} * @@ -195,6 +190,13 @@ public class ChangesReport extends AbstractChangesReport { private CaseInsensitiveMap caseInsensitiveIssueLinkTemplatePerSystem; + private MavenFileFilter mavenFileFilter; + + @Inject + public ChangesReport(MavenFileFilter mavenFileFilter) { + this.mavenFileFilter = mavenFileFilter; + } + /* --------------------------------------------------------------------- */ /* Public methods */ /* --------------------------------------------------------------------- */ diff --git a/src/main/java/org/apache/maven/plugins/changes/ChangesValidatorMojo.java b/src/main/java/org/apache/maven/plugins/changes/ChangesValidatorMojo.java index 469c3bef..5dd2d76c 100644 --- a/src/main/java/org/apache/maven/plugins/changes/ChangesValidatorMojo.java +++ b/src/main/java/org/apache/maven/plugins/changes/ChangesValidatorMojo.java @@ -18,11 +18,12 @@ */ package org.apache.maven.plugins.changes; +import javax.inject.Inject; + import java.io.File; import java.util.List; import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.changes.schema.ChangesSchemaValidator; @@ -40,11 +41,6 @@ @Mojo(name = "changes-validate", threadSafe = true) public class ChangesValidatorMojo extends AbstractChangesMojo { - /** - */ - @Component(role = ChangesSchemaValidator.class, hint = "default") - private ChangesSchemaValidator changesSchemaValidator; - /** * The changes xsd version. */ @@ -52,7 +48,7 @@ public class ChangesValidatorMojo extends AbstractChangesMojo { private String changesXsdVersion; /** - * Mojo failure if validation failed. If not and validation failed only a warning will be logged. + * Mojo failure if validation failed. If not and validation failed, only a warning will be logged. */ @Parameter(property = "changes.validate.failed", defaultValue = "false") private boolean failOnError; @@ -63,6 +59,13 @@ public class ChangesValidatorMojo extends AbstractChangesMojo { @Parameter(property = "changes.xmlPath", defaultValue = "src/changes/changes.xml") private File xmlPath; + private ChangesSchemaValidator changesSchemaValidator; + + @Inject + public ChangesValidatorMojo(ChangesSchemaValidator changesSchemaValidator) { + this.changesSchemaValidator = changesSchemaValidator; + } + /** * @see org.apache.maven.plugin.Mojo#execute() */ diff --git a/src/main/java/org/apache/maven/plugins/changes/schema/DefaultChangesSchemaValidator.java b/src/main/java/org/apache/maven/plugins/changes/schema/DefaultChangesSchemaValidator.java index 9b4a6877..066c99c8 100644 --- a/src/main/java/org/apache/maven/plugins/changes/schema/DefaultChangesSchemaValidator.java +++ b/src/main/java/org/apache/maven/plugins/changes/schema/DefaultChangesSchemaValidator.java @@ -18,6 +18,8 @@ */ package org.apache.maven.plugins.changes.schema; +import javax.inject.Named; +import javax.inject.Singleton; import javax.xml.transform.stream.StreamSource; import javax.xml.validation.Schema; import javax.xml.validation.SchemaFactory; @@ -31,7 +33,6 @@ import java.util.Map; import org.apache.commons.io.input.XmlStreamReader; -import org.codehaus.plexus.component.annotations.Component; import org.xml.sax.SAXException; /** @@ -39,7 +40,8 @@ * @since 28 juil. 2008 * @version $Id$ */ -@Component(role = ChangesSchemaValidator.class, hint = "default") +@Named +@Singleton public class DefaultChangesSchemaValidator implements ChangesSchemaValidator { /** property schema */ diff --git a/src/main/java/org/apache/maven/plugins/github/GitHubReport.java b/src/main/java/org/apache/maven/plugins/github/GitHubReport.java index 0e390a32..8c40a344 100644 --- a/src/main/java/org/apache/maven/plugins/github/GitHubReport.java +++ b/src/main/java/org/apache/maven/plugins/github/GitHubReport.java @@ -18,6 +18,8 @@ */ package org.apache.maven.plugins.github; +import javax.inject.Inject; + import java.net.MalformedURLException; import java.util.HashMap; import java.util.List; @@ -25,7 +27,6 @@ import java.util.Map; import java.util.ResourceBundle; -import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.changes.AbstractChangesReport; @@ -64,12 +65,6 @@ public class GitHubReport extends AbstractChangesReport { githubColumns.put("Updated", IssuesReportHelper.COLUMN_UPDATED); } - /** - * Component used to decrypt server information. - */ - @Component - private SettingsDecrypter settingsDecrypter; - /** * Sets the column names that you want to show in the report. The columns will appear in the report in the same * order as you specify them here. Multiple values can be separated by commas. @@ -125,6 +120,20 @@ public class GitHubReport extends AbstractChangesReport { @Parameter(defaultValue = "false") private boolean onlyCurrentVersion; + /** + * Component used to decrypt server information. + */ + private SettingsDecrypter settingsDecrypter; + + @Inject + public GitHubReport(SettingsDecrypter settingsDecrypter) { + this.settingsDecrypter = settingsDecrypter; + } + + /* --------------------------------------------------------------------- */ + /* Public methods */ + /* --------------------------------------------------------------------- */ + @Override public String getOutputName() { return "github-report"; @@ -140,10 +149,6 @@ public String getDescription(Locale locale) { return getBundle(locale).getString("report.issues.description"); } - /* --------------------------------------------------------------------- */ - /* Public methods */ - /* --------------------------------------------------------------------- */ - /** * @see org.apache.maven.reporting.AbstractMavenReport#canGenerateReport() */