2013-09-05 51 views
2
期間缺課消息

環境:的Java/Linux的/搖籃1.6 /詹金斯最新聲納SonarQube - SonarWay FindBugs的 - sonarRunner任務

gradle這個乾淨的構建jacocoTestReport sonarRunner - 做工精細。

在sonarRunner任務,我看的時候sonarRunner試圖將數據發佈到聲納自己的數據庫(org.h2.jdbc ..)

我看到下面的輸出線以下缺失的類/線。我該怎麼做才能讓這些缺失的物品在sonarRunner任務/步驟中不會顯示。

11:15:47 11:15:47.076 INFO - Findbugs output report: /production/jenkinsAKS/jobs/CAPersonSvc/workspace/build/sonar/findbugs-result.xml 
11:15:55 The following classes needed for analysis were missing: 
11:15:55 org.springframework.context.ApplicationContext 
11:15:55 org.springframework.context.support.ClassPathXmlApplicationContext 
11:15:55 javax.crypto.SecretKey 
11:15:55 javax.crypto.spec.PBEKeySpec 
11:15:55 javax.crypto.SecretKeyFactory 
11:15:55 javax.crypto.spec.PBEParameterSpec 
11:15:55 javax.crypto.Cipher 
11:15:55 javax.crypto.KeyGenerator 
11:15:55 javax.crypto.spec.IvParameterSpec 
11:15:55 javax.crypto.spec.SecretKeySpec 
11:15:55 11:15:55.245 INFO - Execute Findbugs 2.0.1 done: 10991 ms 
11:15:55 11:15:55.247 INFO - Sensor FindbugsSensor done: 10994 ms 

感謝

+0

您是否已將javax crypto&spring定義爲構建文件中的依賴項? –

+0

不,因爲構建工作正常。這是sonarRunner任務 –

+0

這些類是否直接由您自己的代碼使用? –

回答

0

的缺失類是第三方JAR的一部分。

請找到jar文件名from here,然後在本地機器中搜索jar文件的位置。

更改build.gradle與jar文件的位置。

sonarRunner { 
    sonarProperties { 
     properties["sonar.libraries"] += "../Lib/for_spring.jar,../Lib/for_javax.jar" 
    } 
} 

你可以通過this for reference:章36.5

如果錯過任何運行時依賴添加正如你說的,你會得到警告這樣

19:57:21.394 WARN - Class 'org/apache/commons/chain/Command' is not accessible through the ClassLoader. 

,你沒有得到這個警告,所以可能是這些不是運行時依賴。我不確定這些依賴是什麼,但你可以試試這個。

+0

Gradle使用在構建腳本(及其傳遞依賴性)中聲明的「compile」和「runtime」依賴關係自動配置'sonar.libraries'。 –

+0

我會嘗試你的提示Panther,但同意Pete。 –

+0

@ArunSangal:我已經更新了答案,你可以試試這個。 –

相關問題