Skip to content

Commit

Permalink
Merge pull request #1206 from uhafner/pmd-metrics
Browse files Browse the repository at this point in the history
Upgrade PMD to 7.7.0 and combine metrics into same plugin executions
  • Loading branch information
uhafner authored Oct 27, 2024
2 parents 2d13286 + f85e494 commit 474c0b0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 37 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/quality-monitor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ jobs:
"metric": "mutation",
"sourcePath": "src/main/java",
"pattern": "**/target/pit-reports/mutations.xml"
},
{
"id": "pit",
"name": "Test Strength",
"metric": "test-strength",
"sourcePath": "src/main/java",
"pattern": "**/target/pit-reports/mutations.xml"
}
]
}
Expand Down
8 changes: 4 additions & 4 deletions etc/pmd-java-configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
<exclude name="AccessorMethodGeneration"/>
<exclude name="LooseCoupling"/>
<exclude name="GuardLogStatement"/>
<exclude name="JUnit4TestShouldUseTestAnnotation"/>
<exclude name="UnitTestShouldUseTestAnnotation"/>
<exclude name="JUnit5TestShouldBePackagePrivate"/>
<exclude name="JUnitAssertionsShouldIncludeMessage"/>
<exclude name="JUnitTestContainsTooManyAsserts"/>
<exclude name="JUnitTestsShouldIncludeAssert"/>
<exclude name="UnitTestAssertionsShouldIncludeMessage"/>
<exclude name="UnitTestContainsTooManyAsserts"/>
<exclude name="UnitTestShouldIncludeAssert"/>
<exclude name="LiteralsFirstInComparisons"/>
<exclude name="UnusedPrivateMethod"/>
</rule>
Expand Down
8 changes: 4 additions & 4 deletions etc/pmd-tests-configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
<rule ref="category/java/bestpractices.xml">
<exclude name="AccessorMethodGeneration"/>
<exclude name="GuardLogStatement"/>
<exclude name="JUnit4TestShouldUseTestAnnotation"/>
<exclude name="UnitTestShouldUseTestAnnotation"/>
<exclude name="JUnit5TestShouldBePackagePrivate"/>
<exclude name="JUnitAssertionsShouldIncludeMessage"/>
<exclude name="JUnitTestContainsTooManyAsserts"/>
<exclude name="JUnitTestsShouldIncludeAssert"/>
<exclude name="UnitTestAssertionsShouldIncludeMessage"/>
<exclude name="UnitTestContainsTooManyAsserts"/>
<exclude name="UnitTestShouldIncludeAssert"/>
<exclude name="LiteralsFirstInComparisons"/>
<exclude name="LooseCoupling"/>
<exclude name="UnusedPrivateMethod"/>
Expand Down
34 changes: 5 additions & 29 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<maven-failsafe-plugin.version>3.5.1</maven-failsafe-plugin.version>
<maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>
<maven-pmd-plugin.version>3.25.0</maven-pmd-plugin.version>
<pmd.version>7.6.0</pmd.version>
<pmd.version>7.7.0</pmd.version>
<maven-checkstyle-plugin.version>3.6.0</maven-checkstyle-plugin.version>
<checkstyle.version>10.18.2</checkstyle.version>
<spotbugs-maven-plugin.version>4.8.6.4</spotbugs-maven-plugin.version>
Expand Down Expand Up @@ -775,14 +775,14 @@
</configuration>
<dependencies>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<groupId>edu.hm.hafner</groupId>
<artifactId>pmd-core</artifactId>
<version>${pmd.version}</version>
<version>${pmd.version}-metrics</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<groupId>edu.hm.hafner</groupId>
<artifactId>pmd-java</artifactId>
<version>${pmd.version}</version>
<version>${pmd.version}-metrics</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
Expand Down Expand Up @@ -832,29 +832,6 @@
<skip>${pmd.skip}</skip>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<configuration>
<linkXRef>false</linkXRef>
<targetJdk>${java.version}</targetJdk>
<skip>true</skip>
</configuration>
<dependencies>
<dependency>
<groupId>edu.hm.hafner</groupId>
<artifactId>pmd-core</artifactId>
<version>7.5.0-metrics</version>
</dependency>
<dependency>
<groupId>edu.hm.hafner</groupId>
<artifactId>pmd-java</artifactId>
<version>7.5.0-metrics</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>run-pmd-metrics</id>
<goals>
Expand All @@ -873,7 +850,6 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
Expand Down

0 comments on commit 474c0b0

Please sign in to comment.