2012-09-25 3 views
0

다음과 같은 문제점이 있습니다. Jenkins와 함께 빌드 할 때 checkstyle ant 태스크를 실행 중이며 해당 보고서가 생성되지만, 빌드가 완료되면 거기에 메시지가 표시됩니다. 오류 보고서를 찾을 수 없으므로 구문 분석하는 동안 오류가 발생했습니다. 나는 옳은 것으로 출판 될 보고서의 경로를 설정했다는 것을 확인했다. (xxx가 존재하지 않지만 이전 버전의 경로가 존재한다는 메시지를 약간 다르게 바꿀 때). 어떤 생각이 잘못된 것일까 요? Jenkins는 checkstyle 보고서를 게시하기 위해 어떤 형식을 기대합니까? 다음 build.xml을 사용하고 있습니다.Jenkins에서 checkstyle 보고서 게시

<taskdef 
    classpath="libs/checkstyle-5.6-all.jar" 
    resource="checkstyletask.properties" /> 

<target name="checkstyle" > 

     <checkstyle 
      config="checkstyle.xml" 
      failOnViolation="false" > 

      <fileset 
       dir="src" 
       includes="**/*.java" /> 

      <formatter type="plain" /> 

      <formatter type="xml" /> 

      <formatter 
       toFile="checkstyle-result.xml" 
       type="xml" /> 
     </checkstyle> 

     <style 
      style="checkstyle-noframes.xsl" 
      in="checkstyle-result.xml" 
      out="checkstyle-result.html" /> 
    </target> 

config는 sun-checkstyle 구성입니다.

도움 주셔서 감사합니다.

답변

1

**/checkstyle-result.xml을 Jenkins 작업 구성의 결과 파일 위치로 지정하십시오. 결과 파일의 전체 빌드 작업 공간을 살펴볼 것입니다. 일을 처리하면 파일 glob을 강화할 수 있습니다.

위의 방법으로 문제가 해결되지 않으면 Jenkins의 오류 메시지와 checkstyle-results.xml의 위치를 ​​작업의 작업 영역 디렉토리와 관련하여 게시하십시오.

+0

보고서의 기본 경로 (**/checkstyle-result.xml)가 실제로 작동하므로 보고서를 검색해야하는 경로로 아무 것도 쓰지 않았습니다. DI는 이전에이를 /checkstyle- result.xml,하지만 분명히 잘못되었습니다 :/도움을 주셔서 감사합니다 :) – asenovm

1
checkstyle plugin website에서

다음 빌드 작업 공간에 checkstyle-result.xml 파일

Checkstyle 플러그인 스캔 발견 경고의 수를보고합니다.

플러그인은 checkstyle-result.xml XML 형식의 파일을 찾아야합니다. 질문에 플러그인을 어떻게 구성했는지는 언급하지 않았지만 checkstyle-result.html을 찾고 있다면 문제가 될 수 있습니다.

관련 문제