From 34371da4cc58a2d9f951aa9edf9ae5b1018e1700 Mon Sep 17 00:00:00 2001 From: Michael Osipov Date: Fri, 2 Dec 2022 22:50:59 +0100 Subject: [PATCH] Prepare for Doxia 2.0.0 This also fixes JXR-169 --- maven-jxr-plugin/pom.xml | 6 +++--- .../maven/plugin/jxr/AbstractJxrReport.java | 2 +- .../apache/maven/plugin/jxr/JxrReport.java | 8 ++++---- .../maven/plugin/jxr/JxrTestReport.java | 6 +++--- .../maven/plugin/jxr/JxrReportTest.java | 20 +++++++++---------- maven-jxr/pom.xml | 6 +++--- .../apache/maven/jxr/DirectoryIndexer.java | 14 +++++-------- pom.xml | 7 ++++--- 8 files changed, 33 insertions(+), 36 deletions(-) diff --git a/maven-jxr-plugin/pom.xml b/maven-jxr-plugin/pom.xml index 226b9ed7..d716a2d0 100644 --- a/maven-jxr-plugin/pom.xml +++ b/maven-jxr-plugin/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven.jxr jxr - 3.3.1-SNAPSHOT + 4.0.0-SNAPSHOT org.apache.maven.plugins @@ -89,12 +89,12 @@ under the License. org.apache.maven.reporting maven-reporting-api - 3.1.1 + 4.0.0-M3 org.apache.maven.reporting maven-reporting-impl - 3.2.0 + 4.0.0-M3 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 6d201abe..ab06f424 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 @@ -76,7 +76,7 @@ public abstract class AbstractJxrReport /** * 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 = "© {inceptionYear}–{currentYear} {organizationName}" ) private String bottom; // CHECKSTYLE_ON: LineLength 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 7bc724f8..ad298d69 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 @@ -87,14 +87,14 @@ protected List getSourceRoots() List 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() ); } @@ -108,14 +108,14 @@ protected List getSourceRoots( MavenProject project ) { List 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() ); } 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 99945d6f..2c8be847 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 @@ -65,14 +65,14 @@ protected List getSourceRoots() { List 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() ); } @@ -88,7 +88,7 @@ protected List getSourceRoots( MavenProject project ) 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() ); } 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 90b0a742..66b934f4 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 @@ -102,10 +102,10 @@ public void testJdk4Configuration() //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" ) ); @@ -141,10 +141,10 @@ public void testJdk6Configuration() //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" ) ); @@ -184,10 +184,10 @@ public void testJdk7Configuration() //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" ) ); @@ -260,11 +260,11 @@ public void testNoJavadocLink() //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\"" ), + 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 ); @@ -312,10 +312,10 @@ public void testNoJavadocDir() //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" ) ); } /** diff --git a/maven-jxr/pom.xml b/maven-jxr/pom.xml index 06a921bc..a3120faa 100644 --- a/maven-jxr/pom.xml +++ b/maven-jxr/pom.xml @@ -25,7 +25,7 @@ under the License. org.apache.maven.jxr jxr - 3.3.1-SNAPSHOT + 4.0.0-SNAPSHOT org.apache.maven @@ -89,8 +89,8 @@ under the License. org.apache.velocity - velocity - 1.7 + velocity-engine-core + 2.3 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 ea2710ec..17975c6d 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 @@ -257,22 +257,18 @@ private void setProperties( VelocityEngine engine ) if ( templateDirFile.isAbsolute() ) { // the property has been overridden: need to use a FileResourceLoader - engine.setProperty( "resource.loader", "file" ); - engine.setProperty( "file.resource.loader.class", + engine.setProperty( "resource.loaders", "file" ); + engine.setProperty( "resource.loader.file.class", "org.apache.velocity.runtime.resource.loader.FileResourceLoader" ); - engine.setProperty( "file.resource.loader.path", templateDirFile.toString() ); + engine.setProperty( "resource.loader.file.path", templateDirFile.toString() ); } else { // use of the default templates - engine.setProperty( "resource.loader", "classpath" ); - engine.setProperty( "classpath.resource.loader.class", + engine.setProperty( "resource.loaders", "classpath" ); + engine.setProperty( "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/pom.xml b/pom.xml index dfdac2a7..5feaec40 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,7 @@ under the License. org.apache.maven.jxr jxr - 3.3.1-SNAPSHOT + 4.0.0-SNAPSHOT pom Maven JXR Parent @@ -64,11 +64,12 @@ under the License. 8 - 3.12.1 + 1.7.36 + 4.0.0-M4 3.4.1 jxr-archives/jxr-LATEST None - 2022-08-16T10:28:45Z + 2022-12-02T21:53:00Z