This is an automated email from the ASF dual-hosted git repository.

elharo pushed a commit to branch guice
in repository https://gitbox.apache.org/repos/asf/maven-changes-plugin.git

commit 702e8042ce2a1510fcd7cf82c6d782f114839382
Author: Elliotte Rusty Harold <elh...@ibiblio.org>
AuthorDate: Fri Nov 22 04:58:58 2024 -0500

    @Component --> @Inject
---
 .../maven/plugins/changes/ChangesValidatorMojo.java     | 17 ++++++++++-------
 .../changes/schema/DefaultChangesSchemaValidator.java   |  5 -----
 2 files changed, 10 insertions(+), 12 deletions(-)

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 469c3be..5dd2d76 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 @@ import org.xml.sax.SAXParseException;
 @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 ead9eb2..64e334d 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
@@ -88,11 +88,6 @@ public class DefaultChangesSchemaValidator implements 
ChangesSchemaValidator {
         return schema;
     }
 
-    /**
-     * @param uriSchema
-     * @return Schema
-     * @throws Exception
-     */
     private Schema compileJAXPSchema(String uriSchema) throws IOException, 
SAXException, NullPointerException {
         InputStream in = null;
         try {

Reply via email to