簡體   English   中英

Sonar Runner不使用sonar-project.properties的屬性

[英]Sonar Runner does not use properties of sonar-project.properties

從今天開始,我就在jenkins使用SonarQube Runner 2.4,但是分析失敗並顯示以下消息:

SonarQube Runner 2.4
Java 1.7.0_51 Oracle Corporation (64-bit)
INFO: Runner configuration file: /.jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/Sonar_Runner_2.4/conf/sonar-runner.properties
INFO: Project configuration file: NONE
INFO: Default locale: "en_US", source code encoding: "ISO-8859-1" (analysis is platform dependent)
INFO: Work directory: /.jenkins/workspace/Sonar/.sonar
INFO: SonarQube Server 4.3.2
23:21:42.176 INFO  - Load batch settings
23:21:42.160 INFO  - User cache: /.sonar/cache
23:21:42.270 INFO  - Install plugins
23:21:43.322 INFO  - Install JDBC driver
23:21:43.329 INFO  - Create JDBC datasource for jdbc:mysql://xxx
23:21:45.505 INFO  - Initializing Hibernate
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 5.214s
Final Memory: 21M/429M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: You must define the following mandatory properties for ‚com.mypackage:MyProject: sonar.sources
ERROR: 
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
Build step 'Invoke Standalone Sonar Analysis' marked build as failure
[BFA] Scanning build for known causes...

[BFA] Done. 0s
Notifying upstream projects of job completion
Finished: FAILURE

如果我在Jenkins的項目屬性中添加屬性“ MyProject.sonar.sources = src”(我使用“調用獨立聲納分析”)。 我會收到錯誤消息

ERROR: Caused by: Findbugs needs sources to be compiled. Please build project before executing sonar and check the location of compiled classes.

這意味着未讀或使用sonar-project.properties(/.jenkins/workspace/Deploy/MyProject/sonar-project.properties),因為定義了所有值:

sonar.language=java
sonar.projectName=MyProject
sonar.projectVersion=0.1
sonar.binaries=bin
sonar.projectDescription=
sonar.projectKey=MyProjectKey
sonar.sources=src

執行聲納時,我可以看到MyProject的正確路徑,其中:-DMyProject.sonar.projectBaseDir = /。jenkins / workspace / Deploy / MyProject

還是sonar-project.properties的名稱更改了?

請在發布模式下構建項目。 構建完成后,您將在某個地方生成dll。 您必須指向該位置。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM