diff --git a/api/src/main/java/org/openjax/xml/api/OfflineValidationException.java b/api/src/main/java/org/openjax/xml/api/OfflineValidationException.java
deleted file mode 100644
index 24bc4c9..0000000
--- a/api/src/main/java/org/openjax/xml/api/OfflineValidationException.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Copyright (c) 2016 OpenJAX
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * You should have received a copy of The MIT License (MIT) along with this
- * program. If not, see .
- */
-
-package org.openjax.xml.api;
-
-/**
- * A {@link ValidationException} that signifies a validation exception due to an attempt to parse a remote document while offline.
- */
-public class OfflineValidationException extends ValidationException {
- /**
- * Creates a new {@link OfflineValidationException}.
- */
- public OfflineValidationException() {
- super();
- }
-
- /**
- * Creates a new {@link OfflineValidationException}.
- *
- * @param message The detail message.
- */
- public OfflineValidationException(final String message) {
- super(message);
- }
-
- /**
- * Creates a new {@link OfflineValidationException}.
- *
- * @param cause The cause.
- */
- public OfflineValidationException(final Exception cause) {
- super(cause);
- }
-
- /**
- * Creates a new {@link OfflineValidationException}.
- *
- * @param message The detail message.
- * @param cause The cause.
- */
- public OfflineValidationException(final String message, final Exception cause) {
- super(message, cause);
- }
-}
\ No newline at end of file
diff --git a/xml-maven-plugin/pom.xml b/xml-maven-plugin/pom.xml
index 45dbe51..c6a2171 100644
--- a/xml-maven-plugin/pom.xml
+++ b/xml-maven-plugin/pom.xml
@@ -140,6 +140,12 @@
${maven.version}
provided
+
+ org.apache.maven
+ maven-core
+ ${maven.version}
+ provided
+
org.apache.maven.plugin-tools
maven-plugin-annotations
diff --git a/xml-maven-plugin/src/main/java/org/openjax/xml/TransformMojo.java b/xml-maven-plugin/src/main/java/org/openjax/xml/TransformMojo.java
index c1946c9..8f9ac3f 100644
--- a/xml-maven-plugin/src/main/java/org/openjax/xml/TransformMojo.java
+++ b/xml-maven-plugin/src/main/java/org/openjax/xml/TransformMojo.java
@@ -28,6 +28,7 @@
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugin.logging.Log;
import org.apache.maven.plugins.annotations.Execute;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
@@ -58,6 +59,7 @@ public class TransformMojo extends XmlMojo {
public void execute(final LinkedHashSet uris) throws MojoExecutionException, MojoFailureException {
try {
if (uris.size() > 0) {
+ final Log log = getLog();
for (final URI uri : uris) { // [S]
final String outFileName = Strings.searchReplace(StringPaths.getName(uri.toString()), rename);
final File destFile = new File(destDir, outFileName);
@@ -68,10 +70,10 @@ public void execute(final LinkedHashSet uris) throws MojoExecutionException
final long lastModifiedSource;
final long lastModifiedTarget;
if (destFile.exists() && (lastModifiedSource = connection.getLastModified()) <= (lastModifiedTarget = destFile.lastModified()) && lastModifiedTarget < lastModifiedSource + Dates.MILLISECONDS_IN_DAY) {
- getLog().info("Pre-transformed: " + inFilePath);
+ log.info("Pre-transformed: " + inFilePath);
}
else {
- getLog().info(" Transforming: " + inFilePath + " -> " + CWD.relativize(destFile.getAbsoluteFile().toPath()));
+ log.info(" Transforming: " + inFilePath + " -> " + CWD.relativize(destFile.getAbsoluteFile().toPath()));
destFile.getParentFile().mkdirs();
Transformer.transform(stylesheet.toURI().toURL(), connection, destFile, parameters);
}
diff --git a/xml-maven-plugin/src/main/java/org/openjax/xml/ValidatorMojo.java b/xml-maven-plugin/src/main/java/org/openjax/xml/ValidatorMojo.java
index 0f0ea03..a3fd4e7 100644
--- a/xml-maven-plugin/src/main/java/org/openjax/xml/ValidatorMojo.java
+++ b/xml-maven-plugin/src/main/java/org/openjax/xml/ValidatorMojo.java
@@ -41,7 +41,7 @@
public class ValidatorMojo extends XmlMojo {
@Override
public void execute(final LinkedHashSet uris) throws MojoExecutionException, MojoFailureException {
- final File recordDir = new File(directory, "validator");
+ final File recordDir = new File(getProject().getBuild().getDirectory(), "validator");
recordDir.mkdirs();
try {
@@ -63,14 +63,14 @@ public void execute(final LinkedHashSet uris) throws MojoExecutionException
Validator.validate(url, new CachedInputSource(null, url.toString(), null, connection));
}
catch (final FileNotFoundException | SAXException e) {
- if (!offline || !(e instanceof SAXException) || !Validator.isRemoteAccessException((SAXException)e)) {
+ if (!getOffline() || !(e instanceof SAXException) || !Validator.isRemoteAccessException((SAXException)e)) {
final String message = e instanceof FileNotFoundException ? e.getClass().getSimpleName() + e.getMessage() : e.getMessage();
- final StringBuilder builder = new StringBuilder("\nURL: ").append(uri.toString());
- builder.append("\nReason: ").append(message).append('\n');
+ final StringBuilder b = new StringBuilder("\nURL: ").append(uri.toString());
+ b.append("\nReason: ").append(message).append('\n');
for (final Throwable t : e.getSuppressed()) // [A]
- builder.append(" ").append(t.getMessage()).append('\n');
+ b.append(" ").append(t.getMessage()).append('\n');
- final MojoFailureException exception = new MojoFailureException("Failed to validate xml.", "", builder.toString());
+ final MojoFailureException exception = new MojoFailureException("Failed to validate xml.", "", b.toString());
exception.initCause(e);
throw exception;
}
diff --git a/xml-maven-plugin/src/main/java/org/openjax/xml/XmlMojo.java b/xml-maven-plugin/src/main/java/org/openjax/xml/XmlMojo.java
index fdf4aa2..c839174 100644
--- a/xml-maven-plugin/src/main/java/org/openjax/xml/XmlMojo.java
+++ b/xml-maven-plugin/src/main/java/org/openjax/xml/XmlMojo.java
@@ -39,12 +39,6 @@ public abstract class XmlMojo extends PatternSetMojo {
@Parameter(defaultValue = "${httpProxy}", readonly = true)
private String httpProxy;
- @Parameter(defaultValue = "${project.build.directory}", required = true, readonly = true)
- protected String directory = null;
-
- @Parameter(defaultValue = "${settings.offline}", required = true, readonly = true)
- protected boolean offline;
-
@FilterParameter(FilterType.RESOURCE)
@Parameter(property = "resources")
private List resources;