IT TIP

Maven 체크 스타일 비활성화

itqueen 2020. 12. 10. 21:34
반응형

Maven 체크 스타일 비활성화


나는 maven 대상을 실행하고 싶지만 checkstyle 오류는 그것을 금지합니다. 지금 당장 체크 스타일 오류를 수정할 시간이 없습니다 (체크 스타일 규칙이 최근에 업데이트 되었기 때문에 지금은 모두 처리 할 수 ​​없습니다).

체크 스타일 작업을 비활성화하고 어쨌든 내 목표를 실행하는 방법이 있습니까?


해결책은 다음과 같습니다 mvn [target] -Dcheckstyle.skip.

이 솔루션은 임시적이며 pom 파일이나 버전 관리가 가능한 어떤 것도 편집 할 필요가 없기 때문에이 솔루션을 좋아합니다.


pom에서 checkstyle을 비활성화하려면 pom에 checkstyle 플러그인을 추가하고 실행 단계를 none으로 설정할 수 있습니다. 나에게 중요한 것은 부모 pom과 똑같은 id를 설정해야한다는 것입니다. 다른 경우에는 작동하지 않습니다.

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <executions>
                <execution>
                    <id>checkstyle-validation</id>
                    <phase>none</phase>
                </execution>
            </executions>
        </plugin>

RandomCoders 답변이 선호됩니다.

pom에서 checkstyle을 비활성화하려면 pom에 checkstyle 플러그인을 추가하고 검사를 방지하기 위해 skip 플래그를 설정할 수 있습니다.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-checkstyle-plugin</artifactId>
    <configuration>
        <skip>true</skip>
    </configuration>
</plugin>

한 줄로 :

    <properties>
        <checkstyle.skip>true</checkstyle.skip>
    </properties>

참고 URL : https://stackoverflow.com/questions/32308188/disable-maven-checkstyle

반응형