2012-09-25 48 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> 

配置是sun-checkstyle配置。

感謝您的任何幫助。

回答

1

嘗試在您的Jenkins作業配置中指定**/checkstyle-result.xml作爲結果文件位置;這將通過整個構建工作區查看結果文件。一旦你有事情可以工作,你可以收緊文件glob。

如果上述不起作用,請發送您從Jenkins處獲得的錯誤消息以及checkstyle-results.xml相對於作業工作區目錄的位置。

+0

報告(**/checkstyle-result.xml)的默認路徑實際上是工作的,所以我最終沒有寫任何東西作爲應該搜索報告的路徑:DI之前將它設置爲/checkstyle- result.xml,但顯然這是錯誤的:/感謝您的幫助:) – asenovm

1

checkstyle plugin website

的Checkstyle的插件在 構建工作空間的CheckStyle,爲result.xml文件掃描和報告發現的警告的數量。

該插件應該查找checkstyle-result.xml XML格式的文件。你沒有在你的問題中提到你是如何配置插件的,但是如果你正在尋找可能是問題的checkstyle-result.html。

相關問題