1
0

Enable PMD check in default Maven goal

This commit is contained in:
Gary Gregory
2023-11-25 11:41:45 -05:00
parent 1b1879d35d
commit b9785548d6
3 changed files with 27 additions and 8 deletions

14
pmd.xml
View File

@@ -15,11 +15,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<ruleset name="mybraces"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<ruleset name="mybraces" xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
<description>Excludes from default PMD rules.</description>
<rule ref="rulesets/java/unusedcode.xml">
</rule>
<rule ref="category/java/errorprone.xml/EmptyCatchBlock">
<properties>
<property name="allowCommentedBlocks" value="true" />
</properties>
</rule>
<rule ref="category/java/bestpractices.xml/UnusedFormalParameter">
<properties>
<property name="violationSuppressRegex" value=".*'ignored'.*" />
</properties>
</rule>
</ruleset>

13
pom.xml
View File

@@ -197,7 +197,7 @@ under the License.
<build>
<!-- TODO spotbugs:check -->
<!-- TODO replace clirr:check with japicmp:cmp -->
<defaultGoal>clean verify apache-rat:check japicmp:cmp javadoc:javadoc checkstyle:check</defaultGoal>
<defaultGoal>clean verify apache-rat:check japicmp:cmp javadoc:javadoc checkstyle:check pmd:check</defaultGoal>
<plugins>
<!--
@@ -534,6 +534,17 @@ under the License.
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<configuration>
<targetJdk>1.8</targetJdk>
<rulesets>
<ruleset>${basedir}/pmd.xml</ruleset>
</rulesets>
</configuration>
</plugin>
</plugins>
</build>

View File

@@ -37,9 +37,9 @@ public class NoOpLog implements Log, Serializable {
/**
* Base constructor
*
* @param name unused.
* @param ignoredName unused.
*/
public NoOpLog(final String name) {
public NoOpLog(final String ignoredName) {
// no-op
}