Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
elharo committed Nov 22, 2024
1 parent 863ca19 commit 702e804
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -40,19 +41,14 @@
@Mojo(name = "changes-validate", threadSafe = true)
public class ChangesValidatorMojo extends AbstractChangesMojo {

/**
*/
@Component(role = ChangesSchemaValidator.class, hint = "default")
private ChangesSchemaValidator changesSchemaValidator;

/**
* The changes xsd version.
*/
@Parameter(property = "changes.xsdVersion", defaultValue = "1.0.0")
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;
Expand All @@ -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()
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,6 @@ public Schema getSchema(String schemaPath) throws SAXException, IOException {
return schema;
}

/**
* @param uriSchema
* @return Schema
* @throws Exception
*/
private Schema compileJAXPSchema(String uriSchema) throws IOException, SAXException, NullPointerException {
InputStream in = null;
try {
Expand Down

0 comments on commit 702e804

Please sign in to comment.