This is an automated email from the ASF dual-hosted git repository. michaelo pushed a commit to branch doxia-2.0.0 in repository https://gitbox.apache.org/repos/asf/maven-jxr.git
commit fb3a79d0588842665eb3fbc45fe8e519941a39f0 Author: Michael Osipov <micha...@apache.org> AuthorDate: Fri Dec 2 22:50:59 2022 +0100 Prepare for Doxia 2.0.0 This also fixes JXR-169 --- maven-jxr-plugin/pom.xml | 6 +- .../src/it/JXR-100_parameterlink/verify.groovy | 6 +- .../apache/maven/plugin/jxr/AbstractJxrReport.java | 80 ++++++++++------------ .../org/apache/maven/plugin/jxr/JxrReport.java | 28 ++------ .../org/apache/maven/plugin/jxr/JxrTestReport.java | 30 ++------ .../maven/plugin/jxr/AbstractJxrTestCase.java | 35 +++++++++- .../org/apache/maven/plugin/jxr/JxrReportTest.java | 50 ++++++++------ .../apache/maven/plugin/jxr/JxrTestReportTest.java | 7 +- .../jxr/stubs/AggregateTestMavenProjectStub.java | 25 ++++--- .../DefaultConfigurationMavenProjectStub.java | 25 ++++--- .../ExcludeConfigurationMavenProjectStub.java | 22 ++++-- .../IncludeConfigurationMavenProjectStub.java | 22 ++++-- .../maven/plugin/jxr/stubs/JxrProjectStub.java | 23 +++++++ .../jxr/stubs/NoJavadocDirMavenProjectStub.java | 22 ++++-- ...NoJavadocLinkConfigurationMavenProjectStub.java | 28 +++++--- .../plugin/jxr/stubs/PomMavenProjectStub.java | 32 +++++---- .../jxr/stubs/TestSourceDirMavenProjectStub.java | 22 ++++-- .../aggregate-test-plugin-config.xml | 2 - .../default-configuration-plugin-config-4.xml | 2 - .../default-configuration-plugin-config-6.xml | 2 - .../default-configuration-plugin-config-7.xml | 2 - .../default-configuration-plugin-config-8.xml | 2 - .../default-configuration-plugin-config.xml | 2 - .../exception-test-plugin-config.xml | 2 - .../exclude-configuration-plugin-config.xml | 2 - .../include-configuration-plugin-config.xml | 2 - .../nojavadocdir-test-plugin-config.xml | 2 - .../nojavadoclink-configuration-plugin-config.xml | 2 - .../unit/pom-test/pom-test-plugin-config.xml | 1 - .../testsourcedir-test-plugin-config.xml | 2 - maven-jxr/pom.xml | 6 +- .../org/apache/maven/jxr/DirectoryIndexer.java | 14 ++-- .../org/apache/maven/jxr/JavaCodeTransform.java | 30 -------- pom.xml | 33 +-------- 34 files changed, 290 insertions(+), 281 deletions(-) diff --git a/maven-jxr-plugin/pom.xml b/maven-jxr-plugin/pom.xml index 47f4871..db2383a 100644 --- a/maven-jxr-plugin/pom.xml +++ b/maven-jxr-plugin/pom.xml @@ -88,12 +88,12 @@ under the License. <dependency> <groupId>org.apache.maven.reporting</groupId> <artifactId>maven-reporting-api</artifactId> - <version>3.1.1</version> + <version>4.0.0-M9</version> </dependency> <dependency> <groupId>org.apache.maven.reporting</groupId> <artifactId>maven-reporting-impl</artifactId> - <version>3.2.0</version> + <version>4.0.0-M13</version> </dependency> <!-- shared utils --> @@ -156,7 +156,7 @@ under the License. <dependency> <groupId>org.apache.maven.wagon</groupId> <artifactId>wagon-http-lightweight</artifactId> - <version>3.5.1</version> + <version>3.5.3</version> <scope>test</scope> </dependency> <dependency> diff --git a/maven-jxr-plugin/src/it/JXR-100_parameterlink/verify.groovy b/maven-jxr-plugin/src/it/JXR-100_parameterlink/verify.groovy index e959133..383a19b 100644 --- a/maven-jxr-plugin/src/it/JXR-100_parameterlink/verify.groovy +++ b/maven-jxr-plugin/src/it/JXR-100_parameterlink/verify.groovy @@ -16,6 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -assert new File( basedir, 'target/site/xref/com/mycompany/app/Foo.html' ).exists() +File file = new File( basedir, 'target/reports/xref/com/mycompany/app/Foo.html' ); -assert 4 == new File( basedir, '/target/site/xref/com/mycompany/app/Foo.html' ).text.count( '<a name="App" href="../../../com/mycompany/app/App.html#App">App</a>' ) +assert file.exists() + +assert 4 == file.text.count( '<a name="App" href="../../../com/mycompany/app/App.html#App">App</a>' ) diff --git a/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/AbstractJxrReport.java b/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/AbstractJxrReport.java index 569773a..108c41c 100644 --- a/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/AbstractJxrReport.java +++ b/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/AbstractJxrReport.java @@ -37,6 +37,7 @@ import org.apache.maven.jxr.JxrException; import org.apache.maven.jxr.pacman.FileManager; import org.apache.maven.jxr.pacman.PackageManager; import org.apache.maven.model.ReportPlugin; +import org.apache.maven.plugin.MojoExecution; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; import org.apache.maven.reporting.AbstractMavenReport; @@ -73,10 +74,7 @@ public abstract class AbstractJxrReport extends AbstractMavenReport { /** * String used at the bottom of the Xref HTML files. */ - @Parameter( - property = "bottom", - defaultValue = - "Copyright © {inceptionYear}–{currentYear} {organizationName}. All rights reserved.") + @Parameter(property = "bottom", defaultValue = "\u00A9 {inceptionYear}\u2013{currentYear} {organizationName}") private String bottom; // CHECKSTYLE_ON: LineLength @@ -111,12 +109,6 @@ public abstract class AbstractJxrReport extends AbstractMavenReport { @Parameter private ArrayList<String> includes; - /** - * The projects in the reactor for aggregation report. - */ - @Parameter(defaultValue = "${reactorProjects}", readonly = true) - protected List<MavenProject> reactorProjects; - /** * Whether to skip this execution. * @@ -202,23 +194,23 @@ public abstract class AbstractJxrReport extends AbstractMavenReport { } /** - * Creates the Xref for the Java files found in the given source directory and puts them in the given destination + * Creates the Xref for the Java files found in the given source directory and puts them in the given output * directory. * * @param locale The user locale to use for the Xref generation - * @param destinationDirectory The output directory + * @param outputDirectory The output directory * @param sourceDirs The source directories * @throws java.io.IOException * @throws org.apache.maven.jxr.JxrException */ - private void createXref(Locale locale, String destinationDirectory, List<String> sourceDirs) + private void createXref(Locale locale, File outputDirectory, List<String> sourceDirs) throws IOException, JxrException { FileManager fileManager = new FileManager(); PackageManager packageManager = new PackageManager(fileManager); JavaCodeTransform codeTransform = new JavaCodeTransform(packageManager, fileManager); JXR jxr = new JXR(packageManager, codeTransform); - jxr.setDest(Paths.get(destinationDirectory)); + jxr.setDest(outputDirectory.toPath()); jxr.setInputEncoding(getInputEncoding()); jxr.setLocale(locale); jxr.setOutputEncoding(getOutputEncoding()); @@ -242,11 +234,11 @@ public abstract class AbstractJxrReport extends AbstractMavenReport { } // and finally copy the stylesheet - copyRequiredResources(destinationDirectory); + copyRequiredResources(outputDirectory); } /** - * Returns the bottom text to be displayed at the lower part of the generated JXR reports. + * Returns the bottom text to be displayed at the lower part of the generated JXR report. */ private String getBottomText() { int currentYear = Calendar.getInstance().get(Calendar.YEAR); @@ -258,12 +250,12 @@ public abstract class AbstractJxrReport extends AbstractMavenReport { if (inceptionYear != null) { if (inceptionYear.equals(year)) { - theBottom = StringUtils.replace(theBottom, "{inceptionYear}–", ""); + theBottom = StringUtils.replace(theBottom, "{inceptionYear}\u2013", ""); } else { theBottom = StringUtils.replace(theBottom, "{inceptionYear}", inceptionYear); } } else { - theBottom = StringUtils.replace(theBottom, "{inceptionYear}–", ""); + theBottom = StringUtils.replace(theBottom, "{inceptionYear}\u2013", ""); } if (project.getOrganization() == null) { @@ -293,28 +285,28 @@ public abstract class AbstractJxrReport extends AbstractMavenReport { } /** - * Copy some required resources (like the stylesheet) to the given directory + * Copy some required resources (like the stylesheet) to the given target directory * - * @param dir the directory to copy the resources to + * @param targetDirectory the directory to copy the resources to */ - private void copyRequiredResources(String dir) { + private void copyRequiredResources(File targetDirectory) { if (stylesheet != null && !stylesheet.isEmpty()) { File stylesheetFile = new File(stylesheet); - File destStylesheetFile = new File(dir, "stylesheet.css"); + File targetStylesheetFile = new File(targetDirectory, "stylesheet.css"); try { if (stylesheetFile.isAbsolute()) { - FileUtils.copyFile(stylesheetFile, destStylesheetFile); + FileUtils.copyFile(stylesheetFile, targetStylesheetFile); } else { URL stylesheetUrl = this.getClass().getClassLoader().getResource(stylesheet); - FileUtils.copyURLToFile(stylesheetUrl, destStylesheetFile); + FileUtils.copyURLToFile(stylesheetUrl, targetStylesheetFile); } } catch (IOException e) { getLog().warn("An error occured while copying the stylesheet to the target directory", e); } } else { if (javadocTemplatesVersion.isAtLeast("1.8")) { - copyResources(dir, "jdk8/", "stylesheet.css"); + copyResources(targetDirectory, "jdk8/", "stylesheet.css"); } else if (javadocTemplatesVersion.isAtLeast("1.7")) { String[] jdk7Resources = { "stylesheet.css", @@ -323,14 +315,14 @@ public abstract class AbstractJxrReport extends AbstractMavenReport { "resources/titlebar.gif", "resources/titlebar_end.gif" }; - copyResources(dir, "jdk7/", jdk7Resources); + copyResources(targetDirectory, "jdk7/", jdk7Resources); } else if (javadocTemplatesVersion.isAtLeast("1.6")) { - copyResources(dir, "jdk6/", "stylesheet.css"); + copyResources(targetDirectory, "jdk6/", "stylesheet.css"); } else if (javadocTemplatesVersion.isAtLeast("1.4")) { - copyResources(dir, "jdk4/", "stylesheet.css"); + copyResources(targetDirectory, "jdk4/", "stylesheet.css"); } else { // Fallback to the original stylesheet - copyResources(dir, "", "stylesheet.css"); + copyResources(targetDirectory, "", "stylesheet.css"); } } } @@ -338,16 +330,16 @@ public abstract class AbstractJxrReport extends AbstractMavenReport { /** * Copy styles and related resources to the given directory * - * @param dir the directory to copy the resources to + * @param targetDirectory the target directory to copy the resources to * @param sourceDirectory resources subdirectory to copy from * @param files names of files to copy */ - private void copyResources(String dir, String sourceDirectory, String... files) { + private void copyResources(File targetDirectory, String sourceDirectory, String... files) { try { for (String file : files) { URL resourceUrl = this.getClass().getClassLoader().getResource(sourceDirectory + file); - File destResourceFile = new File(dir, file); - FileUtils.copyURLToFile(resourceUrl, destResourceFile); + File targetResourceFile = new File(targetDirectory, file); + FileUtils.copyURLToFile(resourceUrl, targetResourceFile); } } catch (IOException e) { getLog().warn("An error occured while copying the resource to the target directory", e); @@ -359,14 +351,18 @@ public abstract class AbstractJxrReport extends AbstractMavenReport { return project; } - /** - * Returns the Maven session. - * @return Maven session - */ protected MavenSession getSession() { return session; } + protected List<MavenProject> getReactorProjects() { + return reactorProjects; + } + + protected MojoExecution getMojoExecution() { + return mojoExecution; + } + /** * Returns the correct resource bundle according to the locale. * @@ -386,7 +382,7 @@ public abstract class AbstractJxrReport extends AbstractMavenReport { setJavadocTemplatesVersion(); try { - createXref(locale, getDestinationDirectory(), constructSourceDirs()); + createXref(locale, getPluginReportOutputDirectory(), constructSourceDirs()); } catch (JxrException | IOException e) { throw new MavenReportException("Error while generating the HTML source code of the project.", e); } @@ -450,7 +446,6 @@ public abstract class AbstractJxrReport extends AbstractMavenReport { @Override public boolean canGenerateReport() { if (skip) { - getLog().info("Skipping JXR."); return false; } @@ -528,11 +523,12 @@ public abstract class AbstractJxrReport extends AbstractMavenReport { } /** - * Abstract method that returns the target directory where the generated JXR reports will be put. + * Abstract method that returns the plugin report output directory where the generated JXR report will be put + * beneath {@link #getReportOutputDirectory()}. * - * @return a String that contains the target directory name + * @return a File for the plugin's report output directory */ - protected abstract String getDestinationDirectory(); + protected abstract File getPluginReportOutputDirectory(); /** * Abstract method that returns the specified source directories that will be included in the JXR report generation. diff --git a/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrReport.java b/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrReport.java index 6a348f2..def85f4 100644 --- a/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrReport.java +++ b/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrReport.java @@ -52,12 +52,6 @@ public class JxrReport extends AbstractJxrReport { @Parameter private String sourcePath; - /** - * Directory where the Xref files will be copied to. - */ - @Parameter(defaultValue = "${project.reporting.outputDirectory}/xref") - private String destDir; - /** * Directory where Javadoc is generated for this project. */ @@ -65,8 +59,8 @@ public class JxrReport extends AbstractJxrReport { private File javadocDir; @Override - protected String getDestinationDirectory() { - return destDir; + protected File getPluginReportOutputDirectory() { + return new File(getReportOutputDirectory(), "xref"); } @Override @@ -80,12 +74,12 @@ public class JxrReport extends AbstractJxrReport { List<String> l = new ArrayList<>(); - if (!"pom".equals(getProject().getPackaging().toLowerCase(Locale.US))) { + if (!"pom".equals(getProject().getPackaging().toLowerCase(Locale.ENGLISH))) { l.addAll(sourceDirs); } if (getProject().getExecutionProject() != null) { - if (!"pom".equals(getProject().getExecutionProject().getPackaging().toLowerCase(Locale.US))) { + if (!"pom".equals(getProject().getExecutionProject().getPackaging().toLowerCase(Locale.ENGLISH))) { l.addAll(getProject().getExecutionProject().getCompileSourceRoots()); } } @@ -97,12 +91,12 @@ public class JxrReport extends AbstractJxrReport { protected List<String> getSourceRoots(MavenProject project) { List<String> l = new ArrayList<>(); - if (!"pom".equals(project.getPackaging().toLowerCase(Locale.US))) { + if (!"pom".equals(project.getPackaging().toLowerCase(Locale.ENGLISH))) { l.addAll(project.getCompileSourceRoots()); } if (project.getExecutionProject() != null) { - if (!"pom".equals(project.getExecutionProject().getPackaging().toLowerCase(Locale.US))) { + if (!"pom".equals(project.getExecutionProject().getPackaging().toLowerCase(Locale.ENGLISH))) { l.addAll(project.getExecutionProject().getCompileSourceRoots()); } } @@ -129,14 +123,4 @@ public class JxrReport extends AbstractJxrReport { protected File getJavadocDir() { return javadocDir; } - - @Override - public void setReportOutputDirectory(File reportOutputDirectory) { - if ((reportOutputDirectory != null) - && (!reportOutputDirectory.getAbsolutePath().endsWith("xref"))) { - this.destDir = new File(reportOutputDirectory, "xref").getAbsolutePath(); - } else { - this.destDir = reportOutputDirectory.getAbsolutePath(); - } - } } diff --git a/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrTestReport.java b/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrTestReport.java index 1f9d158..a4a1709 100644 --- a/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrTestReport.java +++ b/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrTestReport.java @@ -30,8 +30,8 @@ import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; /** - * Creates an html-based, cross referenced version of Java source code - * for a project's test sources. + * Creates an html-based, cross referenced version of Java test source code + * for a project. * * @author <a href="mailto:bellingard.no-s...@gmail.com">Fabrice Bellingard</a> * @author <a href="mailto:br...@apache.org">Brett Porter</a> @@ -45,12 +45,6 @@ public class JxrTestReport extends AbstractJxrReport { @Parameter(defaultValue = "${project.testCompileSourceRoots}", required = true, readonly = true) private List<String> sourceDirs; - /** - * Directory where the Xref files will be copied to. - */ - @Parameter(defaultValue = "${project.reporting.outputDirectory}/xref-test") - private String destDir; - /** * Directory where Test Javadoc is generated for this project. */ @@ -61,12 +55,12 @@ public class JxrTestReport extends AbstractJxrReport { protected List<String> getSourceRoots() { List<String> l = new ArrayList<>(); - if (!"pom".equals(getProject().getPackaging().toLowerCase(Locale.US))) { + if (!"pom".equals(getProject().getPackaging().toLowerCase(Locale.ENGLISH))) { l.addAll(sourceDirs); } if (getProject().getExecutionProject() != null) { - if (!"pom".equals(getProject().getExecutionProject().getPackaging().toLowerCase(Locale.US))) { + if (!"pom".equals(getProject().getExecutionProject().getPackaging().toLowerCase(Locale.ENGLISH))) { l.addAll(getProject().getExecutionProject().getTestCompileSourceRoots()); } } @@ -79,7 +73,7 @@ public class JxrTestReport extends AbstractJxrReport { List<String> l = new ArrayList<>(); if (project.getExecutionProject() != null) { - if (!"pom".equals(project.getExecutionProject().getPackaging().toLowerCase(Locale.US))) { + if (!"pom".equals(project.getExecutionProject().getPackaging().toLowerCase(Locale.ENGLISH))) { l.addAll(project.getExecutionProject().getTestCompileSourceRoots()); } } @@ -88,8 +82,8 @@ public class JxrTestReport extends AbstractJxrReport { } @Override - protected String getDestinationDirectory() { - return destDir; + protected File getPluginReportOutputDirectory() { + return new File(getReportOutputDirectory(), "xref-test"); } @Override @@ -111,14 +105,4 @@ public class JxrTestReport extends AbstractJxrReport { protected File getJavadocDir() { return testJavadocDir; } - - @Override - public void setReportOutputDirectory(File reportOutputDirectory) { - if ((reportOutputDirectory != null) - && (!reportOutputDirectory.getAbsolutePath().endsWith("xref-test"))) { - this.destDir = new File(reportOutputDirectory, "xref-test").getAbsolutePath(); - } else { - this.destDir = reportOutputDirectory.getAbsolutePath(); - } - } } diff --git a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/AbstractJxrTestCase.java b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/AbstractJxrTestCase.java index b865c5a..8a9ec5e 100644 --- a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/AbstractJxrTestCase.java +++ b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/AbstractJxrTestCase.java @@ -21,8 +21,14 @@ package org.apache.maven.plugin.jxr; import java.io.File; import java.io.IOException; import java.nio.file.Files; +import java.util.Collections; +import java.util.List; +import org.apache.maven.model.Plugin; import org.apache.maven.plugin.LegacySupport; +import org.apache.maven.plugin.MojoExecution; +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.plugin.descriptor.PluginDescriptor; import org.apache.maven.plugin.testing.AbstractMojoTestCase; import org.apache.maven.plugin.testing.ArtifactStubFactory; import org.apache.maven.plugin.testing.stubs.MavenProjectStub; @@ -112,8 +118,17 @@ public abstract class AbstractJxrTestCase extends AbstractMojoTestCase { repoSession.setLocalRepositoryManager(new SimpleLocalRepositoryManagerFactory() .newInstance(repoSession, new LocalRepository(artifactStubFactory.getWorkingDir()))); + List<MavenProject> reactorProjects = + mojo.getReactorProjects() != null ? mojo.getReactorProjects() : Collections.emptyList(); + + setVariableValueToObject(mojo, "mojoExecution", getMockMojoExecution()); setVariableValueToObject(mojo, "session", legacySupport.getSession()); - setVariableValueToObject(mojo, "remoteRepositories", mojo.getProject().getRemoteArtifactRepositories()); + setVariableValueToObject(mojo, "repoSession", legacySupport.getRepositorySession()); + setVariableValueToObject(mojo, "reactorProjects", reactorProjects); + setVariableValueToObject( + mojo, "remoteProjectRepositories", mojo.getProject().getRemoteProjectRepositories()); + setVariableValueToObject( + mojo, "siteDirectory", new File(mojo.getProject().getBasedir(), "src/site")); return mojo; } @@ -139,4 +154,22 @@ public abstract class AbstractJxrTestCase extends AbstractMojoTestCase { protected String readFile(File xrefTestDir, String fileName) throws IOException { return new String(Files.readAllBytes(xrefTestDir.toPath().resolve(fileName))); } + + private MojoExecution getMockMojoExecution() { + MojoDescriptor md = new MojoDescriptor(); + md.setGoal(getGoal()); + + MojoExecution me = new MojoExecution(md); + + PluginDescriptor pd = new PluginDescriptor(); + Plugin p = new Plugin(); + p.setGroupId("org.apache.maven.plugins"); + p.setArtifactId("maven-jxr-plugin"); + pd.setPlugin(p); + md.setPluginDescriptor(pd); + + return me; + } + + protected abstract String getGoal(); } diff --git a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/JxrReportTest.java b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/JxrReportTest.java index 2a614b6..268328d 100644 --- a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/JxrReportTest.java +++ b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/JxrReportTest.java @@ -43,7 +43,7 @@ public class JxrReportTest extends AbstractJxrTestCase { FileUtils.copyDirectory(new File(resourcesDir, "javadoc-files"), outputDir); - generateReport("jxr", "default-configuration/default-configuration-plugin-config.xml"); + generateReport(getGoal(), "default-configuration/default-configuration-plugin-config.xml"); // check if xref files were generated assertTrue(new File(xrefDir, "allclasses-frame.html").exists()); @@ -80,7 +80,7 @@ public class JxrReportTest extends AbstractJxrTestCase { FileUtils.copyDirectory(new File(resourcesDir, "javadoc-files"), outputDir); - generateReport("jxr", "default-configuration/default-configuration-plugin-config-4.xml"); + generateReport(getGoal(), "default-configuration/default-configuration-plugin-config-4.xml"); // check if xref files were generated assertTrue(new File(xrefDir, "allclasses-frame.html").exists()); @@ -95,10 +95,10 @@ public class JxrReportTest extends AbstractJxrTestCase { // check if there's a link to the javadoc files String str = readFile(xrefDir, "def/configuration/AppSample.html"); - assertTrue(str.toLowerCase(Locale.US).contains("/apidocs/def/configuration/appsample.html\"")); + assertTrue(str.toLowerCase(Locale.ENGLISH).contains("/apidocs/def/configuration/appsample.html\"")); str = readFile(xrefDir, "def/configuration/App.html"); - assertTrue(str.toLowerCase(Locale.US).contains("/apidocs/def/configuration/app.html\"")); + assertTrue(str.toLowerCase(Locale.ENGLISH).contains("/apidocs/def/configuration/app.html\"")); // check if encoding is UTF-8, the default value assertTrue(str.contains("text/html; charset=UTF-8")); @@ -117,7 +117,7 @@ public class JxrReportTest extends AbstractJxrTestCase { FileUtils.copyDirectory(new File(resourcesDir, "javadoc-files"), outputDir); - generateReport("jxr", "default-configuration/default-configuration-plugin-config-6.xml"); + generateReport(getGoal(), "default-configuration/default-configuration-plugin-config-6.xml"); // check if xref files were generated assertTrue(new File(xrefDir, "allclasses-frame.html").exists()); @@ -132,10 +132,10 @@ public class JxrReportTest extends AbstractJxrTestCase { // check if there's a link to the javadoc files String str = readFile(xrefDir, "def/configuration/AppSample.html"); - assertTrue(str.toLowerCase(Locale.US).contains("/apidocs/def/configuration/appsample.html\"")); + assertTrue(str.toLowerCase(Locale.ENGLISH).contains("/apidocs/def/configuration/appsample.html\"")); str = readFile(xrefDir, "def/configuration/App.html"); - assertTrue(str.toLowerCase(Locale.US).contains("/apidocs/def/configuration/app.html\"")); + assertTrue(str.toLowerCase(Locale.ENGLISH).contains("/apidocs/def/configuration/app.html\"")); // check if encoding is UTF-8, the default value assertTrue(str.contains("text/html; charset=UTF-8")); @@ -154,7 +154,7 @@ public class JxrReportTest extends AbstractJxrTestCase { FileUtils.copyDirectory(new File(resourcesDir, "javadoc-files"), outputDir); - generateReport("jxr", "default-configuration/default-configuration-plugin-config-7.xml"); + generateReport(getGoal(), "default-configuration/default-configuration-plugin-config-7.xml"); // check if xref files were generated assertTrue(new File(xrefDir, "allclasses-frame.html").exists()); @@ -173,10 +173,10 @@ public class JxrReportTest extends AbstractJxrTestCase { // check if there's a link to the javadoc files String str = readFile(xrefDir, "def/configuration/AppSample.html"); - assertTrue(str.toLowerCase(Locale.US).contains("/apidocs/def/configuration/appsample.html\"")); + assertTrue(str.toLowerCase(Locale.ENGLISH).contains("/apidocs/def/configuration/appsample.html\"")); str = readFile(xrefDir, "def/configuration/App.html"); - assertTrue(str.toLowerCase(Locale.US).contains("/apidocs/def/configuration/app.html\"")); + assertTrue(str.toLowerCase(Locale.ENGLISH).contains("/apidocs/def/configuration/app.html\"")); // check if encoding is UTF-8, the default value assertTrue(str.contains("text/html; charset=UTF-8")); @@ -195,7 +195,7 @@ public class JxrReportTest extends AbstractJxrTestCase { FileUtils.copyDirectory(new File(resourcesDir, "javadoc-files"), outputDir); - generateReport("jxr", "default-configuration/default-configuration-plugin-config-8.xml"); + generateReport(getGoal(), "default-configuration/default-configuration-plugin-config-8.xml"); // check if xref files were generated assertTrue(new File(xrefDir, "allclasses-frame.html").exists()); @@ -225,7 +225,7 @@ public class JxrReportTest extends AbstractJxrTestCase { * @throws Exception */ public void testNoJavadocLink() throws Exception { - generateReport("jxr", "nojavadoclink-configuration/nojavadoclink-configuration-plugin-config.xml"); + generateReport(getGoal(), "nojavadoclink-configuration/nojavadoclink-configuration-plugin-config.xml"); File xrefDir = new File(getBasedir(), "target/test/unit/nojavadoclink-configuration/target/site/xref"); @@ -245,10 +245,11 @@ public class JxrReportTest extends AbstractJxrTestCase { // check if there's a link to the javadoc files String str = readFile(xrefDir, "nojavadoclink/configuration/AppSample.html"); - assertEquals(str.toLowerCase(Locale.US).indexOf("/apidocs/nojavadoclink/configuration/appsample.html\""), -1); + assertEquals( + str.toLowerCase(Locale.ENGLISH).indexOf("/apidocs/nojavadoclink/configuration/appsample.html\""), -1); str = readFile(xrefDir, "nojavadoclink/configuration/App.html"); - assertEquals(str.toLowerCase(Locale.US).indexOf("/apidocs/nojavadoclink/configuration/app.html\""), -1); + assertEquals(str.toLowerCase(Locale.ENGLISH).indexOf("/apidocs/nojavadoclink/configuration/app.html\""), -1); str = readFile(xrefDir, "nojavadoclink/configuration/sample/Sample.html"); assertEquals(str.toLowerCase().indexOf("/apidocs/nojavadoclink/configuration/sample/sample.html\""), -1); @@ -263,7 +264,7 @@ public class JxrReportTest extends AbstractJxrTestCase { * @throws Exception */ public void testAggregate() throws Exception { - generateReport("jxr", "aggregate-test/aggregate-test-plugin-config.xml"); + generateReport(getGoal(), "aggregate-test/aggregate-test-plugin-config.xml"); File xrefDir = new File(getBasedir(), "target/test/unit/aggregate-test/target/site/xref"); @@ -286,16 +287,16 @@ public class JxrReportTest extends AbstractJxrTestCase { * @throws Exception */ public void testNoJavadocDir() throws Exception { - generateReport("jxr", "nojavadocdir-test/nojavadocdir-test-plugin-config.xml"); + generateReport(getGoal(), "nojavadocdir-test/nojavadocdir-test-plugin-config.xml"); File xrefDir = new File(getBasedir(), "target/test/unit/nojavadocdir-test/target/site/xref"); // check if there's a link to the javadoc files String str = readFile(xrefDir, "nojavadocdir/test/AppSample.html"); - assertTrue(str.toLowerCase(Locale.US).contains("/apidocs/nojavadocdir/test/appsample.html")); + assertTrue(str.toLowerCase(Locale.ENGLISH).contains("/apidocs/nojavadocdir/test/appsample.html")); str = readFile(xrefDir, "nojavadocdir/test/App.html"); - assertTrue(str.toLowerCase(Locale.US).contains("/apidocs/nojavadocdir/test/app.html")); + assertTrue(str.toLowerCase(Locale.ENGLISH).contains("/apidocs/nojavadocdir/test/app.html")); } /** @@ -304,7 +305,7 @@ public class JxrReportTest extends AbstractJxrTestCase { * @throws Exception */ public void testExclude() throws Exception { - generateReport("jxr", "exclude-configuration/exclude-configuration-plugin-config.xml"); + generateReport(getGoal(), "exclude-configuration/exclude-configuration-plugin-config.xml"); Path xrefDir = new File(getBasedir(), "target/test/unit/exclude-configuration/target/site/xref").toPath(); @@ -321,7 +322,7 @@ public class JxrReportTest extends AbstractJxrTestCase { * @throws Exception */ public void testInclude() throws Exception { - generateReport("jxr", "include-configuration/include-configuration-plugin-config.xml"); + generateReport(getGoal(), "include-configuration/include-configuration-plugin-config.xml"); Path xrefDir = new File(getBasedir(), "target/test/unit/include-configuration/target/site/xref").toPath(); @@ -334,7 +335,7 @@ public class JxrReportTest extends AbstractJxrTestCase { public void testExceptions() { try { - generateReport("jxr", "default-configuration/exception-test-plugin-config.xml"); + generateReport(getGoal(), "default-configuration/exception-test-plugin-config.xml"); fail("Must throw exception"); } catch (Exception e) { @@ -348,8 +349,13 @@ public class JxrReportTest extends AbstractJxrTestCase { * @throws Exception */ public void testPom() throws Exception { - generateReport("jxr", "pom-test/pom-test-plugin-config.xml"); + generateReport(getGoal(), "pom-test/pom-test-plugin-config.xml"); assertFalse(new File(getBasedir(), "target/test/unit/pom-test").exists()); } + + @Override + protected String getGoal() { + return "jxr"; + } } diff --git a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/JxrTestReportTest.java b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/JxrTestReportTest.java index 4acbc6b..921c582 100644 --- a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/JxrTestReportTest.java +++ b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/JxrTestReportTest.java @@ -30,7 +30,7 @@ public class JxrTestReportTest extends AbstractJxrTestCase { * @throws Exception */ public void testSourceDir() throws Exception { - generateReport("test-jxr", "testsourcedir-test/testsourcedir-test-plugin-config.xml"); + generateReport(getGoal(), "testsourcedir-test/testsourcedir-test-plugin-config.xml"); File xrefTestDir = new File(getBasedir(), "target/test/unit/testsourcedir-test/target/site/xref-test"); @@ -52,4 +52,9 @@ public class JxrTestReportTest extends AbstractJxrTestCase { str = readFile(xrefTestDir, "testsourcedir/test/AppTest.html"); assertFalse(str.toLowerCase().contains("/apidocs/testsourcedir/test/App.html\"".toLowerCase())); } + + @Override + protected String getGoal() { + return "test-jxr"; + } } diff --git a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/AggregateTestMavenProjectStub.java b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/AggregateTestMavenProjectStub.java index 572e9c5..9c7e1fa 100644 --- a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/AggregateTestMavenProjectStub.java +++ b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/AggregateTestMavenProjectStub.java @@ -18,7 +18,9 @@ */ package org.apache.maven.plugin.jxr.stubs; -import java.io.FileReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; import java.util.ArrayList; import java.util.List; @@ -26,24 +28,21 @@ import org.apache.maven.artifact.Artifact; import org.apache.maven.model.Model; import org.apache.maven.model.ReportPlugin; import org.apache.maven.model.io.xpp3.MavenXpp3Reader; -import org.apache.maven.plugin.testing.stubs.MavenProjectStub; /** * @author <a href="mailto:och...@apache.org">Maria Odea Ching</a> */ -public class AggregateTestMavenProjectStub extends MavenProjectStub { +public class AggregateTestMavenProjectStub extends JxrProjectStub { private List<ReportPlugin> reportPlugins = new ArrayList<>(); public AggregateTestMavenProjectStub() { MavenXpp3Reader pomReader = new MavenXpp3Reader(); Model model = null; - try { - model = pomReader.read(new FileReader( - getBasedir() + "/src/test/resources/unit/aggregate-test/aggregate-test-plugin-config.xml")); + try (InputStream is = new FileInputStream(new File(getBasedir() + "/" + getPOM()))) { + model = pomReader.read(is); setModel(model); } catch (Exception ignored) { - } setArtifactId(model.getArtifactId()); @@ -54,7 +53,7 @@ public class AggregateTestMavenProjectStub extends MavenProjectStub { String basedir = getBasedir().getAbsolutePath(); List<String> compileSourceRoots = new ArrayList<>(); - compileSourceRoots.add(basedir + "/src/test/resources/unit/aggregate-test/aggregate/test"); + compileSourceRoots.add(basedir + "/aggregate/test"); setCompileSourceRoots(compileSourceRoots); // set the report plugins @@ -70,4 +69,14 @@ public class AggregateTestMavenProjectStub extends MavenProjectStub { public List<ReportPlugin> getReportPlugins() { return reportPlugins; } + + @Override + public File getBasedir() { + return new File(super.getBasedir() + "/aggregate-test"); + } + + @Override + protected String getPOM() { + return "aggregate-test-plugin-config.xml"; + } } diff --git a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/DefaultConfigurationMavenProjectStub.java b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/DefaultConfigurationMavenProjectStub.java index d221948..eab947e 100644 --- a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/DefaultConfigurationMavenProjectStub.java +++ b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/DefaultConfigurationMavenProjectStub.java @@ -18,7 +18,9 @@ */ package org.apache.maven.plugin.jxr.stubs; -import java.io.FileReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; import java.util.ArrayList; import java.util.List; @@ -26,24 +28,21 @@ import org.apache.maven.artifact.Artifact; import org.apache.maven.model.Model; import org.apache.maven.model.ReportPlugin; import org.apache.maven.model.io.xpp3.MavenXpp3Reader; -import org.apache.maven.plugin.testing.stubs.MavenProjectStub; /** * @author <a href="mailto:och...@apache.org">Maria Odea Ching</a> */ -public class DefaultConfigurationMavenProjectStub extends MavenProjectStub { +public class DefaultConfigurationMavenProjectStub extends JxrProjectStub { private List<ReportPlugin> reportPlugins = new ArrayList<>(); public DefaultConfigurationMavenProjectStub() { MavenXpp3Reader pomReader = new MavenXpp3Reader(); Model model = null; - try { - model = pomReader.read(new FileReader(getBasedir() - + "/src/test/resources/unit/default-configuration/default-configuration-plugin-config.xml")); + try (InputStream is = new FileInputStream(new File(getBasedir() + "/" + getPOM()))) { + model = pomReader.read(is); setModel(model); } catch (Exception ignored) { - } setArtifactId(model.getArtifactId()); @@ -54,7 +53,7 @@ public class DefaultConfigurationMavenProjectStub extends MavenProjectStub { String basedir = getBasedir().getAbsolutePath(); List<String> compileSourceRoots = new ArrayList<>(); - compileSourceRoots.add(basedir + "/src/test/resources/unit/default-configuration/def/configuration"); + compileSourceRoots.add(basedir + "/def/configuration"); setCompileSourceRoots(compileSourceRoots); // set the report plugins @@ -69,4 +68,14 @@ public class DefaultConfigurationMavenProjectStub extends MavenProjectStub { public List<ReportPlugin> getReportPlugins() { return reportPlugins; } + + @Override + public File getBasedir() { + return new File(super.getBasedir() + "/default-configuration"); + } + + @Override + protected String getPOM() { + return "default-configuration-plugin-config.xml"; + } } diff --git a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/ExcludeConfigurationMavenProjectStub.java b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/ExcludeConfigurationMavenProjectStub.java index 9866204..4ce55f7 100644 --- a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/ExcludeConfigurationMavenProjectStub.java +++ b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/ExcludeConfigurationMavenProjectStub.java @@ -18,7 +18,9 @@ */ package org.apache.maven.plugin.jxr.stubs; -import java.io.FileReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; import java.util.ArrayList; import java.util.List; @@ -37,12 +39,10 @@ public class ExcludeConfigurationMavenProjectStub extends JxrProjectStub { MavenXpp3Reader pomReader = new MavenXpp3Reader(); Model model = null; - try { - model = pomReader.read(new FileReader(getBasedir() - + "/src/test/resources/unit/exclude-configuration/exclude-configuration-plugin-config.xml")); + try (InputStream is = new FileInputStream(new File(getBasedir() + "/" + getPOM()))) { + model = pomReader.read(is); setModel(model); } catch (Exception ignored) { - } setArtifactId(model.getArtifactId()); @@ -53,7 +53,7 @@ public class ExcludeConfigurationMavenProjectStub extends JxrProjectStub { String basedir = getBasedir().getAbsolutePath(); List<String> compileSourceRoots = new ArrayList<>(); - compileSourceRoots.add(basedir + "/src/test/resources/unit/exclude-configuration/exclude/configuration"); + compileSourceRoots.add(basedir + "/exclude/configuration"); setCompileSourceRoots(compileSourceRoots); // set the report plugins @@ -68,4 +68,14 @@ public class ExcludeConfigurationMavenProjectStub extends JxrProjectStub { public List<ReportPlugin> getReportPlugins() { return reportPlugins; } + + @Override + public File getBasedir() { + return new File(super.getBasedir() + "/exclude-configuration"); + } + + @Override + protected String getPOM() { + return "exclude-configuration-plugin-config.xml"; + } } diff --git a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/IncludeConfigurationMavenProjectStub.java b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/IncludeConfigurationMavenProjectStub.java index 5130359..617f6fa 100644 --- a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/IncludeConfigurationMavenProjectStub.java +++ b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/IncludeConfigurationMavenProjectStub.java @@ -18,7 +18,9 @@ */ package org.apache.maven.plugin.jxr.stubs; -import java.io.FileReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; import java.util.ArrayList; import java.util.List; @@ -37,12 +39,10 @@ public class IncludeConfigurationMavenProjectStub extends JxrProjectStub { MavenXpp3Reader pomReader = new MavenXpp3Reader(); Model model = null; - try { - model = pomReader.read(new FileReader(getBasedir() - + "/src/test/resources/unit/include-configuration/include-configuration-plugin-config.xml")); + try (InputStream is = new FileInputStream(new File(getBasedir() + "/" + getPOM()))) { + model = pomReader.read(is); setModel(model); } catch (Exception ignored) { - } setArtifactId(model.getArtifactId()); @@ -53,7 +53,7 @@ public class IncludeConfigurationMavenProjectStub extends JxrProjectStub { String basedir = getBasedir().getAbsolutePath(); List<String> compileSourceRoots = new ArrayList<>(); - compileSourceRoots.add(basedir + "/src/test/resources/unit/include-configuration/include/configuration"); + compileSourceRoots.add(basedir + "/include/configuration"); setCompileSourceRoots(compileSourceRoots); // set the report plugins @@ -68,4 +68,14 @@ public class IncludeConfigurationMavenProjectStub extends JxrProjectStub { public List<ReportPlugin> getReportPlugins() { return reportPlugins; } + + @Override + public File getBasedir() { + return new File(super.getBasedir() + "/include-configuration"); + } + + @Override + protected String getPOM() { + return "include-configuration-plugin-config.xml"; + } } diff --git a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/JxrProjectStub.java b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/JxrProjectStub.java index 12bf7d4..57b40ca 100644 --- a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/JxrProjectStub.java +++ b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/JxrProjectStub.java @@ -18,16 +18,34 @@ */ package org.apache.maven.plugin.jxr.stubs; +import java.io.File; import java.util.Collections; import java.util.List; +import org.apache.maven.RepositoryUtils; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy; import org.apache.maven.artifact.repository.MavenArtifactRepository; import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; import org.apache.maven.plugin.testing.stubs.MavenProjectStub; +import org.eclipse.aether.repository.RemoteRepository; public abstract class JxrProjectStub extends MavenProjectStub { + /** + * @return the POM file name + */ + protected abstract String getPOM(); + + @Override + public File getBasedir() { + return new File(super.getBasedir() + "/src/test/resources/unit/"); + } + + @Override + public File getFile() { + return new File(getBasedir(), getPOM()); + } + @Override public List<ArtifactRepository> getRemoteArtifactRepositories() { ArtifactRepository repository = new MavenArtifactRepository( @@ -39,4 +57,9 @@ public abstract class JxrProjectStub extends MavenProjectStub { return Collections.singletonList(repository); } + + @Override + public List<RemoteRepository> getRemoteProjectRepositories() { + return RepositoryUtils.toRepos(getRemoteArtifactRepositories()); + } } diff --git a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/NoJavadocDirMavenProjectStub.java b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/NoJavadocDirMavenProjectStub.java index 1e1368b..8c75f11 100644 --- a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/NoJavadocDirMavenProjectStub.java +++ b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/NoJavadocDirMavenProjectStub.java @@ -18,7 +18,9 @@ */ package org.apache.maven.plugin.jxr.stubs; -import java.io.FileReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; import java.util.ArrayList; import java.util.List; @@ -37,12 +39,10 @@ public class NoJavadocDirMavenProjectStub extends JxrProjectStub { MavenXpp3Reader pomReader = new MavenXpp3Reader(); Model model = null; - try { - model = pomReader.read(new FileReader( - getBasedir() + "/src/test/resources/unit/nojavadocdir-test/nojavadocdir-test-plugin-config.xml")); + try (InputStream is = new FileInputStream(new File(getBasedir() + "/" + getPOM()))) { + model = pomReader.read(is); setModel(model); } catch (Exception ignored) { - } setArtifactId(model.getArtifactId()); @@ -53,7 +53,7 @@ public class NoJavadocDirMavenProjectStub extends JxrProjectStub { String basedir = getBasedir().getAbsolutePath(); List<String> compileSourceRoots = new ArrayList<>(); - compileSourceRoots.add(basedir + "/src/test/resources/unit/nojavadocdir-test/nojavadocdir/test"); + compileSourceRoots.add(basedir + "/nojavadocdir/test"); setCompileSourceRoots(compileSourceRoots); // set the report plugins @@ -68,4 +68,14 @@ public class NoJavadocDirMavenProjectStub extends JxrProjectStub { public List<ReportPlugin> getReportPlugins() { return reportPlugins; } + + @Override + public File getBasedir() { + return new File(super.getBasedir() + "/nojavadocdir-test"); + } + + @Override + protected String getPOM() { + return "nojavadocdir-test-plugin-config.xml"; + } } diff --git a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/NoJavadocLinkConfigurationMavenProjectStub.java b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/NoJavadocLinkConfigurationMavenProjectStub.java index 342d8d6..8f89038 100644 --- a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/NoJavadocLinkConfigurationMavenProjectStub.java +++ b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/NoJavadocLinkConfigurationMavenProjectStub.java @@ -18,7 +18,9 @@ */ package org.apache.maven.plugin.jxr.stubs; -import java.io.FileReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; import java.util.ArrayList; import java.util.List; @@ -26,26 +28,21 @@ import org.apache.maven.artifact.Artifact; import org.apache.maven.model.Model; import org.apache.maven.model.ReportPlugin; import org.apache.maven.model.io.xpp3.MavenXpp3Reader; -import org.apache.maven.plugin.testing.stubs.MavenProjectStub; /** * @author <a href="mailto:och...@apache.org">Maria Odea Ching</a> */ -public class NoJavadocLinkConfigurationMavenProjectStub extends MavenProjectStub { +public class NoJavadocLinkConfigurationMavenProjectStub extends JxrProjectStub { List<ReportPlugin> reportPlugins; public NoJavadocLinkConfigurationMavenProjectStub() { MavenXpp3Reader pomReader = new MavenXpp3Reader(); Model model = null; - try { - model = pomReader.read( - new FileReader( - getBasedir() - + "/src/test/resources/unit/nojavadoclink-configuration/nojavadoclink-configuration-plugin-config.xml")); + try (InputStream is = new FileInputStream(new File(getBasedir() + "/" + getPOM()))) { + model = pomReader.read(is); setModel(model); } catch (Exception ignored) { - } setArtifactId(model.getArtifactId()); @@ -56,8 +53,7 @@ public class NoJavadocLinkConfigurationMavenProjectStub extends MavenProjectStub String basedir = getBasedir().getAbsolutePath(); List<String> compileSourceRoots = new ArrayList<>(); - compileSourceRoots.add( - basedir + "/src/test/resources/unit/nojavadoclink-configuration/nojavadoclink/configuration"); + compileSourceRoots.add(basedir + "/nojavadoclink/configuration"); setCompileSourceRoots(compileSourceRoots); // set the report plugins @@ -72,4 +68,14 @@ public class NoJavadocLinkConfigurationMavenProjectStub extends MavenProjectStub public List<ReportPlugin> getReportPlugins() { return reportPlugins; } + + @Override + public File getBasedir() { + return new File(super.getBasedir() + "/nojavadoclink-configuration"); + } + + @Override + protected String getPOM() { + return "nojavadoclink-configuration-plugin-config.xml"; + } } diff --git a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/PomMavenProjectStub.java b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/PomMavenProjectStub.java index cadb456..6682ba3 100644 --- a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/PomMavenProjectStub.java +++ b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/PomMavenProjectStub.java @@ -19,30 +19,29 @@ package org.apache.maven.plugin.jxr.stubs; import java.io.File; -import java.io.FileReader; +import java.io.FileInputStream; +import java.io.InputStream; import java.util.ArrayList; import java.util.List; import org.apache.maven.model.Build; import org.apache.maven.model.Model; import org.apache.maven.model.io.xpp3.MavenXpp3Reader; -import org.apache.maven.plugin.testing.stubs.MavenProjectStub; /** * @author <a href="mailto:vincent.sive...@gmail.com">Vincent Siveton</a> */ -public class PomMavenProjectStub extends MavenProjectStub { +public class PomMavenProjectStub extends JxrProjectStub { private Build build; public PomMavenProjectStub() { MavenXpp3Reader pomReader = new MavenXpp3Reader(); - Model model; + Model model = null; - try { - model = pomReader.read(new FileReader(new File(getBasedir(), "pom-test-plugin-config.xml"))); + try (InputStream is = new FileInputStream(new File(getBasedir() + "/" + getPOM()))) { + model = pomReader.read(is); setModel(model); - } catch (Exception e) { - throw new RuntimeException(e); + } catch (Exception ignored) { } setGroupId(model.getGroupId()); @@ -54,11 +53,11 @@ public class PomMavenProjectStub extends MavenProjectStub { Build build = new Build(); build.setFinalName(model.getArtifactId()); - build.setDirectory(super.getBasedir() + "/target/test/unit/pom-test/target"); + build.setDirectory(getBasedir() + "/target"); build.setSourceDirectory(getBasedir() + "/src/main/java"); - build.setOutputDirectory(super.getBasedir() + "/target/test/unit/pom-test/target/classes"); + build.setOutputDirectory(getBasedir() + "/target/classes"); build.setTestSourceDirectory(getBasedir() + "/src/test/java"); - build.setTestOutputDirectory(super.getBasedir() + "/target/test/unit/pom-test/target/test-classes"); + build.setTestOutputDirectory(getBasedir() + "/target/test-classes"); setBuild(build); List<String> compileSourceRoots = new ArrayList<>(); @@ -84,10 +83,13 @@ public class PomMavenProjectStub extends MavenProjectStub { this.build = build; } - /** - * @see org.apache.maven.plugin.testing.stubs.MavenProjectStub#getBasedir() - */ + @Override public File getBasedir() { - return new File(super.getBasedir() + "/src/test/resources/unit/pom-test"); + return new File(super.getBasedir() + "/pom-test"); + } + + @Override + protected String getPOM() { + return "pom-test-plugin-config.xml"; } } diff --git a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/TestSourceDirMavenProjectStub.java b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/TestSourceDirMavenProjectStub.java index a286b60..3214caf 100644 --- a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/TestSourceDirMavenProjectStub.java +++ b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/stubs/TestSourceDirMavenProjectStub.java @@ -18,7 +18,9 @@ */ package org.apache.maven.plugin.jxr.stubs; -import java.io.FileReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; import java.util.ArrayList; import java.util.List; @@ -35,12 +37,10 @@ public class TestSourceDirMavenProjectStub extends JxrProjectStub { MavenXpp3Reader pomReader = new MavenXpp3Reader(); Model model = null; - try { - model = pomReader.read(new FileReader( - getBasedir() + "/src/test/resources/unit/testsourcedir-test/testsourcedir-test-plugin-config.xml")); + try (InputStream is = new FileInputStream(new File(getBasedir() + "/" + getPOM()))) { + model = pomReader.read(is); setModel(model); } catch (Exception ignored) { - } setArtifactId(model.getArtifactId()); @@ -51,11 +51,21 @@ public class TestSourceDirMavenProjectStub extends JxrProjectStub { String basedir = getBasedir().getAbsolutePath(); List<String> compileSourceRoots = new ArrayList<>(); - compileSourceRoots.add(basedir + "/src/test/resources/unit/testsourcedir-test"); + compileSourceRoots.add(basedir); setCompileSourceRoots(compileSourceRoots); Artifact artifact = new JxrPluginArtifactStub(getGroupId(), getArtifactId(), getVersion(), getPackaging()); artifact.setArtifactHandler(new DefaultArtifactHandlerStub()); setArtifact(artifact); } + + @Override + public File getBasedir() { + return new File(super.getBasedir() + "/testsourcedir-test"); + } + + @Override + protected String getPOM() { + return "testsourcedir-test-plugin-config.xml"; + } } diff --git a/maven-jxr-plugin/src/test/resources/unit/aggregate-test/aggregate-test-plugin-config.xml b/maven-jxr-plugin/src/test/resources/unit/aggregate-test/aggregate-test-plugin-config.xml index 27bac58..73c0ab4 100644 --- a/maven-jxr-plugin/src/test/resources/unit/aggregate-test/aggregate-test-plugin-config.xml +++ b/maven-jxr-plugin/src/test/resources/unit/aggregate-test/aggregate-test-plugin-config.xml @@ -41,7 +41,6 @@ under the License. <value>${basedir}/src/test/resources/unit/aggregate-test/submodule1</value> <value>${basedir}/src/test/resources/unit/aggregate-test/submodule2</value> </sourceDirs> - <destDir>${basedir}/target/test/unit/aggregate-test/target/site/xref</destDir> <javadocDir>${basedir}/target/test/unit/aggregate-test/target/site/apidocs</javadocDir> <linkJavadoc>false</linkJavadoc> <bottom>Copyright 2006 Apache Foundation</bottom> @@ -51,7 +50,6 @@ under the License. <project implementation="org.apache.maven.plugin.jxr.stubs.AggregateSubmodule1MavenProjectStub"/> <project implementation="org.apache.maven.plugin.jxr.stubs.AggregateSubmodule2MavenProjectStub"/> </reactorProjects> - <localRepository>${localRepository}</localRepository> </configuration> </plugin> </plugins> diff --git a/maven-jxr-plugin/src/test/resources/unit/default-configuration/default-configuration-plugin-config-4.xml b/maven-jxr-plugin/src/test/resources/unit/default-configuration/default-configuration-plugin-config-4.xml index bf302a1..410f864 100644 --- a/maven-jxr-plugin/src/test/resources/unit/default-configuration/default-configuration-plugin-config-4.xml +++ b/maven-jxr-plugin/src/test/resources/unit/default-configuration/default-configuration-plugin-config-4.xml @@ -39,12 +39,10 @@ under the License. <sourceDirs> <value>${basedir}/src/test/resources/unit/default-configuration</value> </sourceDirs> - <destDir>${basedir}/target/test/unit/default-configuration/target/site/4/xref</destDir> <javadocDir>${basedir}/target/test/unit/default-configuration/target/site/4/apidocs</javadocDir> <linkJavadoc>true</linkJavadoc> <bottom>Copyright 2006 Apache Foundation</bottom> <javadocVersion>1.4</javadocVersion> - <localRepository>${localRepository}</localRepository> </configuration> </plugin> </plugins> diff --git a/maven-jxr-plugin/src/test/resources/unit/default-configuration/default-configuration-plugin-config-6.xml b/maven-jxr-plugin/src/test/resources/unit/default-configuration/default-configuration-plugin-config-6.xml index eac7aee..5d0184d 100644 --- a/maven-jxr-plugin/src/test/resources/unit/default-configuration/default-configuration-plugin-config-6.xml +++ b/maven-jxr-plugin/src/test/resources/unit/default-configuration/default-configuration-plugin-config-6.xml @@ -39,12 +39,10 @@ under the License. <sourceDirs> <value>${basedir}/src/test/resources/unit/default-configuration</value> </sourceDirs> - <destDir>${basedir}/target/test/unit/default-configuration/target/site/6/xref</destDir> <javadocDir>${basedir}/target/test/unit/default-configuration/target/site/6/apidocs</javadocDir> <linkJavadoc>true</linkJavadoc> <bottom>Copyright 2006 Apache Foundation</bottom> <javadocVersion>1.6</javadocVersion> - <localRepository>${localRepository}</localRepository> </configuration> </plugin> </plugins> diff --git a/maven-jxr-plugin/src/test/resources/unit/default-configuration/default-configuration-plugin-config-7.xml b/maven-jxr-plugin/src/test/resources/unit/default-configuration/default-configuration-plugin-config-7.xml index dbe4d6d..8620129 100644 --- a/maven-jxr-plugin/src/test/resources/unit/default-configuration/default-configuration-plugin-config-7.xml +++ b/maven-jxr-plugin/src/test/resources/unit/default-configuration/default-configuration-plugin-config-7.xml @@ -39,12 +39,10 @@ under the License. <sourceDirs> <value>${basedir}/src/test/resources/unit/default-configuration</value> </sourceDirs> - <destDir>${basedir}/target/test/unit/default-configuration/target/site/7/xref</destDir> <javadocDir>${basedir}/target/test/unit/default-configuration/target/site/7/apidocs</javadocDir> <linkJavadoc>true</linkJavadoc> <bottom>Copyright 2006 Apache Foundation</bottom> <javadocVersion>1.7</javadocVersion> - <localRepository>${localRepository}</localRepository> </configuration> </plugin> </plugins> diff --git a/maven-jxr-plugin/src/test/resources/unit/default-configuration/default-configuration-plugin-config-8.xml b/maven-jxr-plugin/src/test/resources/unit/default-configuration/default-configuration-plugin-config-8.xml index 9e33092..486776a 100644 --- a/maven-jxr-plugin/src/test/resources/unit/default-configuration/default-configuration-plugin-config-8.xml +++ b/maven-jxr-plugin/src/test/resources/unit/default-configuration/default-configuration-plugin-config-8.xml @@ -39,12 +39,10 @@ under the License. <sourceDirs> <value>${basedir}/src/test/resources/unit/default-configuration</value> </sourceDirs> - <destDir>${basedir}/target/test/unit/default-configuration/target/site/8/xref</destDir> <javadocDir>${basedir}/target/test/unit/default-configuration/target/site/8/apidocs</javadocDir> <linkJavadoc>true</linkJavadoc> <bottom>Copyright 2006 Apache Foundation</bottom> <javadocVersion>1.8</javadocVersion> - <localRepository>${localRepository}</localRepository> </configuration> </plugin> </plugins> diff --git a/maven-jxr-plugin/src/test/resources/unit/default-configuration/default-configuration-plugin-config.xml b/maven-jxr-plugin/src/test/resources/unit/default-configuration/default-configuration-plugin-config.xml index 1f4769d..a457dce 100644 --- a/maven-jxr-plugin/src/test/resources/unit/default-configuration/default-configuration-plugin-config.xml +++ b/maven-jxr-plugin/src/test/resources/unit/default-configuration/default-configuration-plugin-config.xml @@ -39,14 +39,12 @@ under the License. <sourceDirs> <value>${basedir}/src/test/resources/unit/default-configuration</value> </sourceDirs> - <destDir>${basedir}/target/test/unit/default-configuration/target/site/xref</destDir> <javadocDir>${basedir}/target/test/unit/default-configuration/target/site/apidocs</javadocDir> <linkJavadoc>true</linkJavadoc> <bottom>Copyright 2006 Apache Foundation</bottom> <templateDir>templates</templateDir> <stylesheet>stylesheet.css</stylesheet> <javadocVersion>3</javadocVersion> - <localRepository>${localRepository}</localRepository> </configuration> </plugin> </plugins> diff --git a/maven-jxr-plugin/src/test/resources/unit/default-configuration/exception-test-plugin-config.xml b/maven-jxr-plugin/src/test/resources/unit/default-configuration/exception-test-plugin-config.xml index cd37da4..06039de 100644 --- a/maven-jxr-plugin/src/test/resources/unit/default-configuration/exception-test-plugin-config.xml +++ b/maven-jxr-plugin/src/test/resources/unit/default-configuration/exception-test-plugin-config.xml @@ -40,13 +40,11 @@ under the License. <sourceDirs> <value>${basedir}/src/test/resources/unit/default-configuration</value> </sourceDirs> - <destDir>${basedir}/target/test/unit/default-configuration/target/site/xref</destDir> <javadocDir>${basedir}/target/test/unit/default-configuration/target/site/apidocs</javadocDir> <linkJavadoc>true</linkJavadoc> <bottom>Copyright 2006 Apache Foundation</bottom> <templateDir>temp</templateDir> <stylesheet>stylesheet.css</stylesheet> - <localRepository>${localRepository}</localRepository> </configuration> </plugin> </plugins> diff --git a/maven-jxr-plugin/src/test/resources/unit/exclude-configuration/exclude-configuration-plugin-config.xml b/maven-jxr-plugin/src/test/resources/unit/exclude-configuration/exclude-configuration-plugin-config.xml index d136487..ff9bef7 100644 --- a/maven-jxr-plugin/src/test/resources/unit/exclude-configuration/exclude-configuration-plugin-config.xml +++ b/maven-jxr-plugin/src/test/resources/unit/exclude-configuration/exclude-configuration-plugin-config.xml @@ -40,7 +40,6 @@ under the License. <sourceDirs> <value>${basedir}/src/test/resources/unit/exclude-configuration</value> </sourceDirs> - <destDir>${basedir}/target/test/unit/exclude-configuration/target/site/xref</destDir> <javadocDir>${basedir}/target/test/unit/exclude-configuration/target/site/apidocs</javadocDir> <linkJavadoc>true</linkJavadoc> <bottom>Copyright 2006 Apache Foundation</bottom> @@ -49,7 +48,6 @@ under the License. <excludes> <exclude>**/AppSample.java</exclude> </excludes> - <localRepository>${localRepository}</localRepository> </configuration> </plugin> </plugins> diff --git a/maven-jxr-plugin/src/test/resources/unit/include-configuration/include-configuration-plugin-config.xml b/maven-jxr-plugin/src/test/resources/unit/include-configuration/include-configuration-plugin-config.xml index d0cfaed..2cda959 100644 --- a/maven-jxr-plugin/src/test/resources/unit/include-configuration/include-configuration-plugin-config.xml +++ b/maven-jxr-plugin/src/test/resources/unit/include-configuration/include-configuration-plugin-config.xml @@ -40,7 +40,6 @@ under the License. <sourceDirs> <value>${basedir}/src/test/resources/unit/include-configuration</value> </sourceDirs> - <destDir>${basedir}/target/test/unit/include-configuration/target/site/xref</destDir> <javadocDir>${basedir}/target/test/unit/include-configuration/target/site/apidocs</javadocDir> <linkJavadoc>true</linkJavadoc> <bottom>Copyright 2006 Apache Foundation</bottom> @@ -49,7 +48,6 @@ under the License. <includes> <include>**/App.java</include> </includes> - <localRepository>${localRepository}</localRepository> </configuration> </plugin> </plugins> diff --git a/maven-jxr-plugin/src/test/resources/unit/nojavadocdir-test/nojavadocdir-test-plugin-config.xml b/maven-jxr-plugin/src/test/resources/unit/nojavadocdir-test/nojavadocdir-test-plugin-config.xml index 0c3a0b2..fed568a 100644 --- a/maven-jxr-plugin/src/test/resources/unit/nojavadocdir-test/nojavadocdir-test-plugin-config.xml +++ b/maven-jxr-plugin/src/test/resources/unit/nojavadocdir-test/nojavadocdir-test-plugin-config.xml @@ -40,13 +40,11 @@ under the License. <sourceDirs> <value>${basedir}/src/test/resources/unit/nojavadocdir-test</value> </sourceDirs> - <destDir>${basedir}/target/test/unit/nojavadocdir-test/target/site/xref</destDir> <javadocDir>${basedir}/target/test/unit/nojavadocdir-test/target/site/apidocs</javadocDir> <linkJavadoc>true</linkJavadoc> <bottom>Copyright 2006 Apache Foundation</bottom> <javadocVersion>1.4</javadocVersion> <stylesheet>stylesheet.css</stylesheet> - <localRepository>${localRepository}</localRepository> </configuration> </plugin> </plugins> diff --git a/maven-jxr-plugin/src/test/resources/unit/nojavadoclink-configuration/nojavadoclink-configuration-plugin-config.xml b/maven-jxr-plugin/src/test/resources/unit/nojavadoclink-configuration/nojavadoclink-configuration-plugin-config.xml index ba569bc..b66627d 100644 --- a/maven-jxr-plugin/src/test/resources/unit/nojavadoclink-configuration/nojavadoclink-configuration-plugin-config.xml +++ b/maven-jxr-plugin/src/test/resources/unit/nojavadoclink-configuration/nojavadoclink-configuration-plugin-config.xml @@ -40,13 +40,11 @@ under the License. <sourceDirs> <value>${basedir}/src/test/resources/unit/nojavadoclink-configuration</value> </sourceDirs> - <destDir>${basedir}/target/test/unit/nojavadoclink-configuration/target/site/xref</destDir> <javadocDir>${basedir}/target/test/unit/nojavadoclink-configuration/target/site/apidocs</javadocDir> <linkJavadoc>false</linkJavadoc> <bottom>Copyright 2006 Apache Foundation</bottom> <javadocVersion>1.4</javadocVersion> <stylesheet>stylesheet.css</stylesheet> - <localRepository>${localRepository}</localRepository> </configuration> </plugin> </plugins> diff --git a/maven-jxr-plugin/src/test/resources/unit/pom-test/pom-test-plugin-config.xml b/maven-jxr-plugin/src/test/resources/unit/pom-test/pom-test-plugin-config.xml index 257aa0b..ae65ab4 100644 --- a/maven-jxr-plugin/src/test/resources/unit/pom-test/pom-test-plugin-config.xml +++ b/maven-jxr-plugin/src/test/resources/unit/pom-test/pom-test-plugin-config.xml @@ -41,7 +41,6 @@ under the License. <configuration> <project implementation="org.apache.maven.plugin.jxr.stubs.PomMavenProjectStub"/> <outputDirectory>${basedir}/target/test/unit/pom-test/target/site/</outputDirectory> - <localRepository>${localRepository}</localRepository> </configuration> </plugin> </plugins> diff --git a/maven-jxr-plugin/src/test/resources/unit/testsourcedir-test/testsourcedir-test-plugin-config.xml b/maven-jxr-plugin/src/test/resources/unit/testsourcedir-test/testsourcedir-test-plugin-config.xml index 23bccd9..7583499 100644 --- a/maven-jxr-plugin/src/test/resources/unit/testsourcedir-test/testsourcedir-test-plugin-config.xml +++ b/maven-jxr-plugin/src/test/resources/unit/testsourcedir-test/testsourcedir-test-plugin-config.xml @@ -40,11 +40,9 @@ under the License. <sourceDirs> <value>${basedir}/src/test/resources/unit/testsourcedir-test/src/test/java</value> </sourceDirs> - <destDir>${basedir}/target/test/unit/testsourcedir-test/target/site/xref-test</destDir> <bottom>Copyright 2006 Apache Foundation</bottom> <javadocVersion>1.4</javadocVersion> <stylesheet>stylesheet.css</stylesheet> - <localRepository>${localRepository}</localRepository> </configuration> </plugin> </plugins> diff --git a/maven-jxr/pom.xml b/maven-jxr/pom.xml index 994ee68..b604f68 100644 --- a/maven-jxr/pom.xml +++ b/maven-jxr/pom.xml @@ -42,8 +42,8 @@ under the License. </dependency> <dependency> <groupId>org.apache.velocity</groupId> - <artifactId>velocity</artifactId> - <version>1.7</version> + <artifactId>velocity-engine-core</artifactId> + <version>2.3</version> </dependency> <dependency> @@ -64,7 +64,7 @@ under the License. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> - <!-- + <!-- The following has to be excluded from checkstyle. Otherwise it will fail based on the license of the file until a better solution exists. diff --git a/maven-jxr/src/main/java/org/apache/maven/jxr/DirectoryIndexer.java b/maven-jxr/src/main/java/org/apache/maven/jxr/DirectoryIndexer.java index fa25b9e..fb6f085 100644 --- a/maven-jxr/src/main/java/org/apache/maven/jxr/DirectoryIndexer.java +++ b/maven-jxr/src/main/java/org/apache/maven/jxr/DirectoryIndexer.java @@ -236,21 +236,17 @@ public class DirectoryIndexer { Path templateDirFile = Paths.get(getTemplateDir()); if (templateDirFile.isAbsolute()) { // the property has been overridden: need to use a FileResourceLoader - engine.setProperty("resource.loader", "file"); + engine.setProperty("resource.loaders", "file"); engine.setProperty( - "file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.FileResourceLoader"); - engine.setProperty("file.resource.loader.path", templateDirFile.toString()); + "resource.loader.file.class", "org.apache.velocity.runtime.resource.loader.FileResourceLoader"); + engine.setProperty("resource.loader.file.path", templateDirFile.toString()); } else { // use of the default templates - engine.setProperty("resource.loader", "classpath"); + engine.setProperty("resource.loaders", "classpath"); engine.setProperty( - "classpath.resource.loader.class", + "resource.loader.classpath.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); } - // avoid "unable to find resource 'VM_global_library.vm' in any resource loader." - engine.setProperty("velocimacro.library", ""); - // engine.setProperty( Log.class.getName(), log ); - // engine.setProperty( "runtime.log.logsystem.class", VelocityLogger.class.getName() ); } /* diff --git a/maven-jxr/src/main/java/org/apache/maven/jxr/JavaCodeTransform.java b/maven-jxr/src/main/java/org/apache/maven/jxr/JavaCodeTransform.java index 3740e09..f70b804 100644 --- a/maven-jxr/src/main/java/org/apache/maven/jxr/JavaCodeTransform.java +++ b/maven-jxr/src/main/java/org/apache/maven/jxr/JavaCodeTransform.java @@ -18,36 +18,6 @@ */ package org.apache.maven.jxr; -/* - * CodeViewer.java - * CoolServlets.com - * March 2000 - * - * Copyright (C) 2000 CoolServlets.com - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2) Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3) Neither the name CoolServlets.com nor the names of its contributors may be - * used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY COOLSERVLETS.COM AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL COOLSERVLETS.COM OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileOutputStream; diff --git a/pom.xml b/pom.xml index e907b35..11d3044 100644 --- a/pom.xml +++ b/pom.xml @@ -76,8 +76,8 @@ under the License. <properties> <javaVersion>8</javaVersion> - <sitePluginVersion>3.12.1</sitePluginVersion> <slf4jVersion>1.7.36</slf4jVersion> + <sitePluginVersion>4.0.0-M13</sitePluginVersion> <javadocPluginVersion>3.6.3</javadocPluginVersion> <maven.site.path>jxr-archives/jxr-LATEST</maven.site.path> <checkstyle.violation.ignore>None</checkstyle.violation.ignore> @@ -111,40 +111,9 @@ under the License. <artifactId>junit</artifactId> <version>4.13.2</version> </dependency> - - <!-- override transitive dependency with security issues --> - <dependency> - <groupId>commons-beanutils</groupId> - <artifactId>commons-beanutils</artifactId> - <version>1.9.4</version> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>2.15.1</version> - </dependency> </dependencies> </dependencyManagement> - <build> - <pluginManagement> - <!-- use the same plugin version in project and in IT tests --> - <!-- additionally versions upgrade will be tracked --> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-javadoc-plugin</artifactId> - <version>${javadocPluginVersion}</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-site-plugin</artifactId> - <version>${sitePluginVersion}</version> - </plugin> - </plugins> - </pluginManagement> - </build> - <profiles> <profile> <id>reporting</id>