错误:sonar.sources的值无效
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了错误:sonar.sources的值无效相关的知识,希望对你有一定的参考价值。
试图运行sonartest,但它失败说:
我的jenkins控制台输出:
Started by user Badal Singh
Building on master in workspace C:Program Files (x86)JenkinsworkspaceDownStream-UpStreamSonaTest
> C:Program Files (x86)Gitingit.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> C:Program Files (x86)Gitingit.exe config remote.origin.url https://github.com/singhbad/Bruce.git # timeout=10
Fetching upstream changes from https://github.com/singhbad/Bruce.git
> C:Program Files (x86)Gitingit.exe --version # timeout=10
using GIT_ASKPASS to set credentials BruceGit
> C:Program Files (x86)Gitingit.exe fetch --tags --progress https://github.com/singhbad/Bruce.git +refs/heads/*:refs/remotes/origin/*
> C:Program Files (x86)Gitingit.exe rev-parse "refs/remotes/origin/Metapool^{commit}" # timeout=10
> C:Program Files (x86)Gitingit.exe rev-parse "refs/remotes/origin/origin/Metapool^{commit}" # timeout=10
Checking out Revision 0f59d8b3fd664144cc55e85f44be7cdfab224831 (refs/remotes/origin/Metapool)
Commit message: "Commit for metapool"
> C:Program Files (x86)Gitingit.exe config core.sparsecheckout # timeout=10
> C:Program Files (x86)Gitingit.exe checkout -f 0f59d8b3fd664144cc55e85f44be7cdfab224831
> C:Program Files (x86)Gitingit.exe rev-list 0f59d8b3fd664144cc55e85f44be7cdfab224831 # timeout=10
[SonaTest] $ "C:Program Files (x86)Jenkins oolshudson.plugins.sonar.SonarRunnerInstallationSonaScaninsonar-scanner.bat" -e -Dsonar.host.url=http://localhost:9000 ******** "-Dsonar.projectBaseDir=C:Program Files (x86)JenkinsworkspaceDownStream-UpStreamSonaTest"
INFO: Option -e/--errors is no longer supported and will be ignored
INFO: Scanner configuration file: C:Program Files (x86)Jenkins oolshudson.plugins.sonar.SonarRunnerInstallationSonaScanin..confsonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarQube Scanner 3.0.3.778
INFO: Java 1.8.0_73 Oracle Corporation (64-bit)
INFO: Windows 10 10.0 amd64
INFO: User cache: C:WINDOWSsystem32configsystemprofile.sonarcache
INFO: Publish mode
INFO: Load global settings
INFO: Load global settings (done) | time=524ms
INFO: Server id: AWBWzyK1kTiY3x_K-rPE
INFO: User cache: C:WINDOWSsystem32configsystemprofile.sonarcache
INFO: Load plugins index
INFO: Load plugins index (done) | time=266ms
INFO: SonarQube server 6.7.0
INFO: Default locale: "en_IN", source code encoding: "windows-1252" (analysis is platform dependent)
INFO: Process project properties
ERROR: Invalid value of sonar.sources for App sonar.projectBaseDir= C:Program Files (x86)JenkinsworkspaceDownStream-UpStreamSonaTestNumberGenerator
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 12.706s
INFO: Final Memory: 40M/92M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: The folder 'C:Program Files (x86)JenkinsworkspaceDownStream-UpStreamSonaTestNumberGeneratorsrcmainjavacommkyong sonar.language=java' does not exist for 'App sonar.projectBaseDir= C:Program Files (x86)JenkinsworkspaceDownStream-UpStreamSonaTestNumberGenerator' (base directory = C:Program Files (x86)JenkinsworkspaceDownStream-UpStreamSonaTest)
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
ERROR: SonarQube scanner exited with non-zero code: 1
Finished: FAILURE
如何解决此错误消息?
答案
我看到了错误:
ERROR: The folder 'C:Program Files (x86)JenkinsworkspaceDownStream-UpStreamSonaTestNumberGeneratorsrcmainjavacommkyong sonar.language=java'
does not exist for 'App sonar.projectBaseDir= C:Program Files (x86)JenkinsworkspaceDownStream-UpStreamSonaTestNumberGenerator'
(base directory = C:Program Files (x86)JenkinsworkspaceDownStream-UpStreamSonaTest)
您开始使用以下过程:
[SonaTest] $ "C:Program Files (x86)Jenkins oolshudson.plugins.sonar.SonarRunnerInstallationSonaScaninsonar-scanner.bat"
-e -Dsonar.host.url=http://localhost:9000 ********
"-Dsonar.projectBaseDir=C:Program Files (x86)JenkinsworkspaceDownStream-UpStreamSonaTest"
确保加倍,以便
sonar.projectBaseDir
找到实际的文件夹。
那是:
-Dsonar.projectBaseDir=C:\Program Files (x86)\Jenkins...
在Analyzing Source Code / Analysis Parameters 查看更多信息。 OP Badal Singh报道in the comments:
这是由于我在
sonar.properties
文件中提到的错误的文件夹路径
以上是关于错误:sonar.sources的值无效的主要内容,如果未能解决你的问题,请参考以下文章
错误:错误域 = NSCocoaErrorDomain 代码 = 3840“字符 0 周围的值无效。” UserInfo=NSDebugDescription=字符 0 周围的值无效。
错误域 = NSCocoaErrorDomain 代码 = 3840 “字符周围的值无效
错误域 = NSCocoaErrorDomain 代码 = 3840 “字符 1 周围的值无效。” UserInfo=NSDebugDescription=字符 1 周围的值无效。swift 4
如何在 sonar-project.properties 中指定通配符