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

18
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 See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<ruleset name="mybraces" <ruleset name="mybraces" xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
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> <description>Excludes from default PMD rules.</description>
<rule ref="rulesets/java/unusedcode.xml"> <rule ref="rulesets/java/unusedcode.xml">
</rule> </rule>
</ruleset> <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> <build>
<!-- TODO spotbugs:check --> <!-- TODO spotbugs:check -->
<!-- TODO replace clirr:check with japicmp:cmp --> <!-- 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> <plugins>
<!-- <!--
@@ -534,6 +534,17 @@ under the License.
</configuration> </configuration>
</plugin> </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> </plugins>
</build> </build>

View File

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