当前位置: 首页 > 知识库问答 >
问题:

SonarRunner适用于Sonar 3.2,但不适用于SonarQube 4.4

昝欣可
2023-03-14

我一直在使用声纳3.2

同样的配置,当我升级到SonarQube 4.4时

C:\Users\kprasad\Documents\Visual Studio 2013\Projects\LKTest>sonar-runner
C:\Users\kprasad\Downloads\sonar-runner-2.4
SonarQube Runner 2.4
Java 1.6.0_38-ea Sun Microsystems Inc. (32-bit)
Windows 7 6.1 x86
INFO: Runner configuration file: C:\Users\kprasad\Downloads\sonar-runner-2.4\con
f\sonar-runner.properties
INFO: Project configuration file: C:\Users\kprasad\Documents\Visual Studio 2013\
Projects\LKTest\sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: C:\Users\kprasad\Documents\Visual Studio 2013\Projects\LKT
est\.\.sonar
INFO: SonarQube Server 4.4.1
18:49:01.343 INFO  - Load global settings
18:49:01.436 INFO  - User cache: C:\Users\kprasad\.sonar\cache
18:49:01.447 INFO  - Install plugins
18:49:02.087 INFO  - Install JDBC driver
18:49:02.094 WARN  - H2 database should be used for evaluation purpose only
18:49:02.094 INFO  - Create JDBC datasource for jdbc:h2:tcp://localhost/sonar
18:49:02.164 INFO  - Initializing Hibernate
18:49:05.018 INFO  - Loading technical debt model...
18:49:05.042 INFO  - Loading technical debt model done: 24 ms
18:49:05.047 INFO  - Load project settings
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 4.283s
Final Memory: 37M/89M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR:
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with t
he -e switch.
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
C:\Users\kprasad\Documents\Visual Studio 2013\Projects\LKTest>

声纳项目属性:

sonar.projectKey=LKTest Sonar Report
sonar.projectVersion=1.0
sonar.projectName=LKTest

sonar.sources=.
sonar.language=cs
sonar.sourceEncoding=UTF-8

sonar.visualstudio.enable=true

sonar.cs.opencover.reportPaths=results.xml

sonar.dotnet.visualstudio.solution.file=LKTest.sln
sonar.silverlight.4.mscorlib.location=C:/Program Files/Reference Assemblies/Microsoft/Framework/Silverlight/v4.0
sonar.dotnet.excludeGeneratedCode=true
sonar.dotnet.4.0.sdk.directory=C:/Windows/Microsoft.NET/Framework/v4.0.30319
sonar.dotnet.version=4.0 

sonar.gendarme.mode=

sonar.gallio.mode=
sonar.gallio.coverage.tool=OpenCover
sonar.gallio.runner=Local
sonar.dotnet.visualstudio.testProjectPattern=*.Test*
sonar.gallio.reports.path=gallio-report.xml
sonar.gallio.coverage.reports.path=coverage-report.xml
sonar.opencover.installDirectory=C:/Program Files/OpenCover/ 

sonar.dotnet.test.assemblies=C:\Users\kprasad\Documents\Visual Studio 2013\Projects\LKTest\LKTest.Tests\bin\Debug\LKTest.Tests.dll

sonar.fxcop.mode=reusereport 

sonar.stylecop.mode=reusereport

sonar.ndeps.mode=reusereport
C:\Users\kprasad\Documents\Visual Studio 2013\Projects\LKTest>sonar-runner -e
C:\Users\kprasad\Downloads\sonar-runner-2.4
SonarQube Runner 2.4
Java 1.6.0_38-ea Sun Microsystems Inc. (32-bit)
Windows 7 6.1 x86
INFO: Error stacktraces are turned on.
INFO: Runner configuration file: C:\Users\kprasad\Downloads\sonar-runner-2.4\con
f\sonar-runner.properties
INFO: Project configuration file: C:\Users\kprasad\Documents\Visual Studio 2013\
Projects\LKTest\sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: C:\Users\kprasad\Documents\Visual Studio 2013\Projects\LKT
est\.\.sonar
INFO: SonarQube Server 4.4.1
12:39:51.109 INFO  - Load global settings
12:39:51.324 INFO  - User cache: C:\Users\kprasad\.sonar\cache
12:39:51.344 INFO  - Install plugins
12:39:51.791 INFO  - Install JDBC driver
12:39:51.810 WARN  - H2 database should be used for evaluation purpose only
12:39:51.811 INFO  - Create JDBC datasource for jdbc:h2:tcp://localhost/sonar
12:39:51.984 INFO  - Initializing Hibernate
12:39:55.507 INFO  - Loading technical debt model...
12:39:55.540 INFO  - Loading technical debt model done: 33 ms
12:39:55.544 INFO  - Load project settings
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 6.759s
Final Memory: 37M/89M
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.IllegalArgumentException
        at java.net.URI.create(URI.java:841)
        at org.sonar.batch.bootstrap.ServerClient.doRequest(ServerClient.java:99
)
        at org.sonar.batch.bootstrap.ServerClient.request(ServerClient.java:85)
        at org.sonar.batch.bootstrap.ServerClient.request(ServerClient.java:81)
        at org.sonar.batch.bootstrap.ServerClient.request(ServerClient.java:77)
        at org.sonar.batch.settings.DefaultSettingsReferential.downloadSettings(
DefaultSettingsReferential.java:65)
        at org.sonar.batch.settings.DefaultSettingsReferential.projectSettings(D
efaultSettingsReferential.java:56)
        at org.sonar.batch.bootstrap.BatchSettings.downloadSettings(BatchSetting
s.java:92)
        at org.sonar.batch.bootstrap.BatchSettings.init(BatchSettings.java:71)
        at org.sonar.batch.scan.ProjectSettingsReady.start(ProjectSettingsReady.
java:40)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(
ReflectionLifecycleStrategy.java:110)
        at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(Reflect
ionLifecycleStrategy.java:89)
        at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter
.start(AbstractInjectionFactory.java:84)
        at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.j
ava:169)
        at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Store
d.java:132)
        at org.picocontainer.behaviors.Stored.start(Stored.java:110)
        at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(Defaul
tPicoContainer.java:1015)
        at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoConta
iner.java:1008)
        at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.jav
a:766)
        at org.sonar.api.platform.ComponentContainer.startComponents(ComponentCo
ntainer.java:91)
        at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.
java:77)
        at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:64)
        at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:51)
        at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.ja
va:110)
        at org.sonar.api.platform.ComponentContainer.startComponents(ComponentCo
ntainer.java:92)
        at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.
java:77)
        at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapCon
tainer.java:185)
        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(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher
.java:87)
        ... 9 more
Caused by: java.net.URISyntaxException: Illegal character in query at index 80:
http://localhost:9025/batch_bootstrap/properties?dryRun=false&project=LKTest
 Sonar Report
        at java.net.URI$Parser.fail(URI.java:2810)
        at java.net.URI$Parser.checkChars(URI.java:2983)
        at java.net.URI$Parser.parseHierarchical(URI.java:3073)
        at java.net.URI$Parser.parse(URI.java:3015)
        at java.net.URI.<init>(URI.java:577)
        at java.net.URI.create(URI.java:839)
        ... 47 more
ERROR:
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.


C:\Users\kprasad\Documents\Visual Studio 2013\Projects\LKTest>

请帮助整理这些例外

问候, KP

共有1个答案

黄俊智
2023-03-14

问题是你的“sonar.projectKey”包含空格字符。

在SonarQube的最新版本中,我们强制项目键中允许的字符类型:只有字母、数字、' _ '、'.'和“:”。参考见SONAR-4188。

 类似资料:
  • 问题内容: 嗨,我只是简单地尝试在www.example.com上获取h1标签,该标签显示为“ Example Domain”。该代码适用于http://www.example.com,但不适用于https://www.exmaple.com。我该如何解决这个问题?谢谢 问题答案: PhantomJSDriver不支持(所有)DesiredCapabilities。 你会需要: 记录在这里:htt

  • 所以我使用这种方法写入文件,它在windows上运行完全正常,但在mac上运行时,它会创建文件,但它们是空的。 我知道数据是正确的,因为它打印正确。感谢您的任何帮助,这真的让我绊倒了。

  • 列名称的类型为int[] 上述查询适用于postgresql,但不适用于hsqldb,甚至适用于sql 尝试的hsqldb版本:2.2.9和2.3.0 在hsqldb中工作的sql是从table_name中选择x,unnest(column_name)y(x)x和y不是该表的列。

  • 我能够成功地打电话给邮递员: /mfp/api/az/v1/token和 /mfpadmin/management-apis/2.0/runtimes/mfp/applications 我正在获取从/mfp/api/az/v1/token接收的承载令牌,并将其添加到/mfp/applications的授权标头中。 我收到了来自两者的200个响应,并从每个API中获取了预期的信息。 然后,我选择从P

  • 我已经看过并尝试了几乎所有关于这个话题的其他帖子,但运气不好。 我使用的是python 3.6,所以我使用的是以下AMI

  • 关于redash,我有一个问题。这是请求。在上,它工作得很好。查询示例: 但在axios上,它抛出: 网络错误 并在控制台上写: 访问XMLHttpRequest at