Maven-checkstyle-plugin은 컴파일 단계에서 라이프 사이클에 포함됩니다 .FailOneError 구성이 활성화되었습니다 .xml 보고서를 생성하고 빌드를 중단합니다. 내 사용자 정의 .xsl 파일을 사용하여 html 버전을 가져오고 싶습니다. 그것을 위해, 나는 xml-maven-plugin을 사용하지만 자동 실행을 위해 구성 할 수 없으며 수명주기에 통합 할 수 없다.maven과 함께 html checkstyle 보고서 생성
나는 구현해야이 단계 :
1) 휴식을 구축) 받는다는-checkstyle-플러그인
3) 플러그인은 XML 보고서
4 오류를 발견하고 생성 코드를 분석
2) "MVN 설치"를 실행 아래
는 5) XML-받는다는 - 플러그인 automacilly 내 pom.xml 파일의
파트를보고 .HTML 생성
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle.version}</version>
<executions>
<execution>
<id>compile</id>
<goals>
<goal>check</goal>
</goals>
<phase>compile</phase>
<configuration>
<configLocation>checkstyle/checkstyle.xml</configLocation>
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<failsOnError>false</failsOnError>
<includeTestSourceDirectory>false</includeTestSourceDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xml-maven-plugin</artifactId>
<version>${xml.maven.version}</version>
<executions>
<execution>
<goals>
<goal>transform</goal>
</goals>
</execution>
</executions>
<configuration>
<transformationSets>
<transformationSet>
<dir>target\</dir>
<stylesheet>checkstyle\checkstyle-author.xsl</stylesheet>
<includes>checkstyle-result.xml</includes>
<fileMappers>
<fileMapper
implementation="org.codehaus.plexus.components.io.filemappers.RegExpFileMapper">
<pattern>\.xml$</pattern>
<replacement>.html</replacement>
</fileMapper>
</fileMappers>
</transformationSet>
</transformationSets>
</configuration>
</plugin>
</plugins>
</build>