Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public class ChangesReport extends AbstractChangesReport {
private File filteredOutputDirectory;

/**
* applying filtering filtering "a la" resources plugin
* apply filtering "a la" resources plugin
*
* @since 2.2
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import org.xml.sax.SAXParseException;

/**
* Goal which validate the <code>changes.xml</code> file.
* Goal which validates the <code>changes.xml</code> file.
*
* @author Olivier Lamy
* @version $Id$
Expand All @@ -48,13 +48,13 @@ 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 false and validation failed, only a warning will be logged.
*/
@Parameter(property = "changes.validate.failed", defaultValue = "false")
private boolean failOnError;

/**
* The path of the <code>changes.xml</code> file that will be converted into an HTML report.
* The path of the <code>changes.xml</code> file that will be validated.
*/
@Parameter(property = "changes.xmlPath", defaultValue = "src/changes/changes.xml")
private File xmlPath;
Expand Down Expand Up @@ -87,23 +87,22 @@ public void execute() throws MojoExecutionException {
logSchemaValidation(xmlValidationHandler.getErrors());
if (failOnError) {
throw new MojoExecutionException("changes.xml file " + xmlPath.getAbsolutePath()
+ " is not valid, see previous errors.");
+ " is not valid. See previous errors.");
} else {
getLog().info(" skip previous validation errors due to failOnError=false.");
}
}
} catch (SchemaValidatorException e) {
if (failOnError) {
throw new MojoExecutionException(
"failed to validate changes.xml file " + xmlPath.getAbsolutePath() + ": " + e.getMessage(),
e);
"changes.xml file is not valid: " + xmlPath.getAbsolutePath() + ": " + e.getMessage(), e);
}
}
}
}

private void logSchemaValidation(List<SAXParseException> errors) {
getLog().warn("failed to validate changes.xml file " + xmlPath.getAbsolutePath());
getLog().warn("changes.xml file is not valid: " + xmlPath.getAbsolutePath());
getLog().warn("validation errors: ");
for (SAXParseException error : errors) {
getLog().warn(error.getMessage());
Expand Down