我正在嘗試檢查僅使用源代碼和使用源代碼的分析與編譯后生成的 .jar 之間是否有任何區別。如果我洗掉“-Dsonar.java.binaries”屬性,我會收到此錯誤:
ERROR: Error during SonarQube Scanner execution
ERROR: Your project contains .java files, please provide compiled classes with sonar.java.binaries property, or exclude them from the analysis with sonar.exclusions property.
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
我正在使用的命令:
sonar-scanner '-Dsonar.host.url=http://192.168.1.25' '-Dsonar.projectKey=org.javaProject:myProject' '-Dsonar.projectName=myProject' '-Dsonar.sourceEncoding=UTF-8' '-Dsonar.sources=src' '-Djavax.net.ssl.trustStore=/certs'
你知道是否可以只分析沒有任何二進制檔案的源代碼?
uj5u.com熱心網友回復:
要使 SonarQube 具有任何重要價值,它應該在編譯代碼并運行單元測驗之后作為構建的一部分運行。坦率地說,我不知道是否可以在沒有類檔案的情況下運行掃描,但我不建議您嘗試這樣做。
如果您真的只想查看靜態分析問題,我相信有一個在 Eclipse 或其他桌面工具中運行的“Sonar Lint”工具。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/441643.html
