PMD ruleset 검출을 지정된 레벨 이하는 무시하도록 하는 방법이 있나요?
조회수 1768회
환경: eclipse mars.3, JDK1.8
pom.xml
<!-- 생략 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.7</version>
<configuration>
<linkXref>true</linkXref>
<minimumTokens>100</minimumTokens>
<targetJdk>1.8</targetJdk>
<rulesets>
<ruleset>${project-physical-location}/pmd/ruleset.xml</ruleset>
</rulesets>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
<goal>cpd-check</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- 생략 -->
ruleset.xml
<?xml version="1.0"?>
<ruleset name="Custom ruleset" 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" xsi:noNamespaceSchemaLocation="http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
<description>ruleset</description>
<rule ref="rulesets/java/basic.xml">
<properties>
<property name="reportLevel" value="1" />
</properties>
</rule>
</ruleset>
위처럼 설정해놓고 eclipse-pmd 플러그인과 메이븐 pmd 플러그인 두 가지 방법으로 pmd 검출을 해봤습니다. 제가 기대한건 basic 룰 중 priority가 1인 룰만 적용될거라 생각했는데 제가 잘못이해한건 basic의 모든 룰이 다 검출되더라구요. (이클립스 플러그인, 메이븐 플러그인 둘 다)
basic에서 priority가 1인 룰이래봐야 DoubleCheckedLocking밖에 없긴 합니다만...
priotiry 기준으로 룰을 제한하거나 적용하는 방법이 이게 아닌가요?
댓글 입력