当我尝试构建Jenkins C#项目时,我收到了以下信息:
[Project_Name] $ O:\sonar-runner-2.4\bin\sonar-runner.bat -e -Dsonar.jdbc.url=jdbc:jtds:sqlserver://database.net/sonar;SelectMethod=Cursor ******** ******** -Dsonar.host.url=http://sonar.net:9000 ******** ******** -Dsonar.projectBaseDir=o:\jenkins\workspace\Project_Name -Dsonar.jdbc.password=******* -Dsonar.jdbc.username=sonar
O:/sonar-runner-2.4/
SonarQube Runner 2.4
Java 1.8.0_45 Oracle Corporation (64-bit)
Windows Server 2008 R2 6.1 amd64
INFO: Error stacktraces are turned on.
INFO: Runner configuration file: O:\sonar-runner-2.4\conf\sonar-runner.properties
INFO: Project configuration file: o:\jenkins\workspace\Project_Name\sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "windows-1252" (analysis is platform dependent)
INFO: Work directory: o:\jenkins\workspace\Project_Name\.sonar
INFO: SonarQube Server 5.1
15:44:26.946 INFO - Load global repositories
15:44:27.433 INFO - Load global repositories (done) | time=490ms
15:44:27.438 INFO - Server id: ************
15:44:27.445 INFO - User cache: C:\Users\19231\.sonar\cache
15:44:27.465 INFO - Install plugins
15:44:27.787 INFO - Install JDBC driver
15:44:27.797 INFO - Create JDBC datasource for jdbc:jtds:sqlserver://sonar.net/sonar;SelectMethod=Cursor
15:44:29.808 INFO - Initializing Hibernate
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 6.230s
Final Memory: 15M/451M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.sonar.runner.Main.executeTask(Main.java:70)
at org.sonar.runner.Main.execute(Main.java:59)
at org.sonar.runner.Main.main(Main.java:53)
Caused by: java.lang.IllegalStateException: You must define the following mandatory properties for 'my:AllocationAssistant': sonar.sources
at org.sonar.batch.scan.ProjectReactorBuilder.checkMandatoryProperties(ProjectReactorBuilder.java:315)
at org.sonar.batch.scan.ProjectReactorBuilder.defineRootProject(ProjectReactorBuilder.java:157)
at org.sonar.batch.scan.ProjectReactorBuilder.execute(ProjectReactorBuilder.java:116)
at org.sonar.batch.scan.ProjectScanContainer.projectBootstrap(ProjectScanContainer.java:110)
at org.sonar.batch.scan.ProjectScanContainer.doBeforeStart(ProjectScanContainer.java:86)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:90)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:57)
at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45)
at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:135)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:158)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
... 9 more
ERROR:
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
Build step 'Invoke Standalone Sonar Analysis' marked build as failure
Finished: FAILURE
sonar-project.properties文件如下所示:
sonar.projectKey =我:AllocationAssistant
sonar.projectName = AllocationAssistant
sonar.projectVersion = PRD
sonar.source =。
sonar.language = CS
sonar.dotnet.visualstudio.solution.file = AllocationAssistant.sln
sonar.dotnet.excludeGeneratedCode = TRUE
sonar.dotnet.4.0.sdk.directory = C:/Windows/Microsoft.NET/Framework/v4.0.30319
sonar.dotnet.version = 4.0
有人知道sonar-project.properties会出现什么问题吗? 我认为可能存在问题。 Sonar-project.properties位于.sln所在的文件夹中。
我将非常感谢您的意见和帮助。
答案 0 :(得分:0)
你的sonar-project.properties配置文件中有一个拼写错误。 ' sonar.source'而不是' sonar.sources'