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-pmd-plugin.git
commit dcb6020e7b85c1a8a2e536b7a4743ee7945b024a Author: Michael Osipov <micha...@apache.org> AuthorDate: Sat Dec 3 00:05:15 2022 +0100 Prepare for Doxia 2.0.0 --- pom.xml | 46 ++++++---------------- .../maven/plugins/pmd/CpdReportGenerator.java | 2 + .../maven/plugins/pmd/PmdReportGenerator.java | 6 +++ .../apache/maven/plugins/pmd/CpdReportTest.java | 2 - .../apache/maven/plugins/pmd/PmdReportTest.java | 8 ++-- 5 files changed, 24 insertions(+), 40 deletions(-) diff --git a/pom.xml b/pom.xml index 6722c47..0cd5b3d 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ under the License. </parent> <artifactId>maven-pmd-plugin</artifactId> - <version>3.20.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version> <packaging>maven-plugin</packaging> <name>Apache Maven PMD Plugin</name> @@ -86,15 +86,15 @@ under the License. <properties> <mavenVersion>3.2.5</mavenVersion> - <doxiaVersion>1.11.1</doxiaVersion> - <doxiaSitetoolsVersion>1.11.1</doxiaSitetoolsVersion> + <doxiaVersion>2.0.0-M4</doxiaVersion> + <doxiaSitetoolsVersion>2.0.0-M4</doxiaSitetoolsVersion> <javaVersion>8</javaVersion><!-- Because PMD 6.35.0+ requires Java 8 --> <pmdVersion>6.52.0</pmdVersion> <slf4jVersion>1.7.36</slf4jVersion> <aetherVersion>1.0.0.v20140518</aetherVersion> - <sitePluginVersion>3.12.1</sitePluginVersion> - <projectInfoReportsPluginVersion>3.4.1</projectInfoReportsPluginVersion> - <jxrPluginVersion>3.3.0</jxrPluginVersion> + <sitePluginVersion>4.0.0-M4</sitePluginVersion> + <projectInfoReportsPluginVersion>4.0.0-SNAPSHOT</projectInfoReportsPluginVersion> + <jxrPluginVersion>4.0.0-SNAPSHOT</jxrPluginVersion> <project.build.outputTimestamp>2022-09-01T09:45:10Z</project.build.outputTimestamp> </properties> @@ -118,6 +118,12 @@ under the License. <version>${mavenVersion}</version> <scope>provided</scope> </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-compat</artifactId> + <version>${mavenVersion}</version> + <scope>provided</scope> + </dependency> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-plugin-api</artifactId> @@ -191,43 +197,17 @@ under the License. <artifactId>doxia-sink-api</artifactId> <version>${doxiaVersion}</version> </dependency> - <dependency> - <groupId>org.apache.maven.doxia</groupId> - <artifactId>doxia-decoration-model</artifactId> - <version>${doxiaSitetoolsVersion}</version> - </dependency> <dependency> <groupId>org.apache.maven.doxia</groupId> <artifactId>doxia-site-renderer</artifactId> <version>${doxiaSitetoolsVersion}</version> - <!-- - Note: doxia-site-renderer needs to be defined AFTER pmd: - doxia-site-renderer requires transitively dom4j 1.1 which provides a very old version of jaxen (same jar). - PMD requires a newer version of jaxen, which is not compatible. - --> - <exclusions> - <exclusion> - <groupId>org.apache.httpcomponents</groupId> - <artifactId>httpclient</artifactId> - </exclusion> - </exclusions> </dependency> <!-- shared --> - <dependency> - <groupId>org.apache.maven.reporting</groupId> - <artifactId>maven-reporting-api</artifactId> - <version>3.1.1</version> - </dependency> <dependency> <groupId>org.apache.maven.reporting</groupId> <artifactId>maven-reporting-impl</artifactId> - <version>3.2.0</version> - </dependency> - <dependency> - <groupId>org.apache.maven.shared</groupId> - <artifactId>maven-shared-utils</artifactId> - <version>3.3.4</version> + <version>4.0.0-M3</version> </dependency> <!-- plexus --> diff --git a/src/main/java/org/apache/maven/plugins/pmd/CpdReportGenerator.java b/src/main/java/org/apache/maven/plugins/pmd/CpdReportGenerator.java index 34a0702..1823055 100644 --- a/src/main/java/org/apache/maven/plugins/pmd/CpdReportGenerator.java +++ b/src/main/java/org/apache/maven/plugins/pmd/CpdReportGenerator.java @@ -165,6 +165,7 @@ public class CpdReportGenerator String code = duplication.getCodefragment(); sink.table(); + sink.tableRows( null, false ); sink.tableRow(); sink.tableHeaderCell(); sink.text( bundle.getString( "report.cpd.column.file" ) ); @@ -201,6 +202,7 @@ public class CpdReportGenerator sink.verbatim_(); sink.rawText( "</td>" ); sink.tableRow_(); + sink.tableRows_(); sink.table_(); } diff --git a/src/main/java/org/apache/maven/plugins/pmd/PmdReportGenerator.java b/src/main/java/org/apache/maven/plugins/pmd/PmdReportGenerator.java index e266cb5..623b7c9 100644 --- a/src/main/java/org/apache/maven/plugins/pmd/PmdReportGenerator.java +++ b/src/main/java/org/apache/maven/plugins/pmd/PmdReportGenerator.java @@ -166,6 +166,7 @@ public class PmdReportGenerator sink.sectionTitle_( level ); sink.table(); + sink.tableRows( null, false ); sink.tableRow(); sink.tableHeaderCell(); sink.text( bundle.getString( "report.pmd.column.rule" ) ); @@ -187,6 +188,7 @@ public class PmdReportGenerator private void endFileSection( int level ) { + sink.tableRows_(); sink.table_(); sink.section_( level ); } @@ -406,6 +408,7 @@ public class PmdReportGenerator } ); sink.table(); + sink.tableRows( null, false ); sink.tableRow(); sink.tableHeaderCell(); sink.text( bundle.getString( "report.pmd.suppressedViolations.column.filename" ) ); @@ -448,6 +451,7 @@ public class PmdReportGenerator sink.tableRow_(); } + sink.tableRows_(); sink.table_(); sink.section1_(); } @@ -471,6 +475,7 @@ public class PmdReportGenerator sink.sectionTitle1_(); sink.table(); + sink.tableRows( null, false ); sink.tableRow(); sink.tableHeaderCell(); sink.text( bundle.getString( "report.pmd.processingErrors.column.filename" ) ); @@ -485,6 +490,7 @@ public class PmdReportGenerator processSingleProcessingError( error ); } + sink.tableRows_(); sink.table_(); sink.section1_(); diff --git a/src/test/java/org/apache/maven/plugins/pmd/CpdReportTest.java b/src/test/java/org/apache/maven/plugins/pmd/CpdReportTest.java index efb3d58..1ba8e7c 100644 --- a/src/test/java/org/apache/maven/plugins/pmd/CpdReportTest.java +++ b/src/test/java/org/apache/maven/plugins/pmd/CpdReportTest.java @@ -23,7 +23,6 @@ import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; -import java.util.Locale; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; @@ -47,7 +46,6 @@ public class CpdReportTest throws Exception { super.setUp(); - Locale.setDefault( Locale.ENGLISH ); FileUtils.deleteDirectory( new File( getBasedir(), "target/test/unit" ) ); } diff --git a/src/test/java/org/apache/maven/plugins/pmd/PmdReportTest.java b/src/test/java/org/apache/maven/plugins/pmd/PmdReportTest.java index d53ba48..e94b930 100644 --- a/src/test/java/org/apache/maven/plugins/pmd/PmdReportTest.java +++ b/src/test/java/org/apache/maven/plugins/pmd/PmdReportTest.java @@ -26,7 +26,6 @@ import java.io.IOException; import java.net.ServerSocket; import java.net.URL; import java.nio.charset.StandardCharsets; -import java.util.Locale; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; @@ -55,7 +54,6 @@ public class PmdReportTest throws Exception { super.setUp(); - Locale.setDefault( Locale.ENGLISH ); FileUtils.deleteDirectory( new File( getBasedir(), "target/test/unit" ) ); } @@ -93,9 +91,9 @@ public class PmdReportTest assertTrue( str.contains( "pmd_rules_java_bestpractices.html#unusedprivatefield\">UnusedPrivateField</a>" ) ); // there should be the section Violations By Priority - assertTrue( str.contains( "Violations By Priority</h2>" ) ); - assertTrue( str.contains( "Priority 3</h3>" ) ); - assertTrue( str.contains( "Priority 4</h3>" ) ); + assertTrue( str.contains( "Violations By Priority</h1>" ) ); + assertTrue( str.contains( "Priority 3</h2>" ) ); + assertTrue( str.contains( "Priority 4</h2>" ) ); // the file App.java is mentioned 3 times: in prio 3, in prio 4 and in the files section assertEquals( 3, StringUtils.countMatches( str, "def/configuration/App.java" ) );