C#Sonarqube插件的问题



我从一年开始安装了Sonarqube 5.6,它与TFS集成在一起。安装了几个其他插件,C#,依赖项检查,FXCOP,JAVA,CHECKMARX,SCM-CVS,SCM-GIT,SCM-GIT,SCM-SVN和SCM-TFVC。一切都很好。今天,它开始错误地构建失败 2017-06-26T17:54:22.7387533Z Downloading SonarQube.MSBuild.Runner.Implementation.zip from http://xxxxxxx:9000/static/csharp/SonarQube.MSBuild.Runner.Implementation.zip to E:agnt_work41.sonarqubebinSonarQube.MSBuild.Runner.Implementation.zip 2017-06-26T17:54:22.7397520Z ##[error]Could not find a file on the SonarQube server. Url: http://xxxxxxxxxx:9000/static/csharp/SonarQube.MSBuild.Runner.Implementation.zip 2017-06-26T17:54:22.7407523Z ##[error]Failed to update the SonarQube Scanner for MSBuild binaries. Check the server url, verify that the C# plugin is correctly installed on the SonarQube server and that the SonarQube server has been restarted. 2017-06-26T17:54:22.7417526Z ##[error]Pre-processing failed. Exit code: 1 2017-06-26T17:54:22.8678238Z ##[error]System.Exception: Unexpected exit code received from batch file: 1 2017-06-26T17:54:22.8698250Z ##[error] at Microsoft.TeamFoundation.DistributedTask.Task.Internal.PowerShell.InvokeBatchScriptCmdlet.ProcessRecord() 2017-06-26T17:54:22.8708248Z ##[error] at System.Management.Automation.CommandProcessor.ProcessRecord()

从错误中,我可以与C#插件有关。我检查了该插件/扩展/插件,并在那里。我认为这可能是兼容性问题,我试图将其升级到最新的6.0

安装6.0后再次尝试并遇到相同的错误。

我还尝试了同一插件的旧版本。尝试了5.3,5.0。手动复制JAR文件之后/插件。试图重新启动声纳服务器,并且没有成功启动。我得到了下面的错误,

2017.06.26 18:31:11 ERROR web[o.s.s.p.Platform] Fail to stop server - ignored java.lang.IllegalStateException: Cannot stop. Current container state was: CONSTRUCTED at org.picocontainer.lifecycle.DefaultLifecycleState.stopping(DefaultLifecycleState.java:72) ~[picocontainer-2.15.jar:na] at org.picocontainer.DefaultPicoContainer.stop(DefaultPicoContainer.java:794) ~[picocontainer-2.15.jar:na] 2017.06.26 18:31:11 ERROR web[o.a.c.c.C.[.[.[/]] Exception sending context initialized event to listener instance of class org.sonar.server.platform.PlatformServletContextListener java.lang.IllegalStateException: Fail to load plugin FxCop [fxcop] at org.sonar.server.plugins.ServerExtensionInstaller.installExtensions(ServerExtensionInstaller.java:74) ~[sonar-server-5.6.jar:na] at org.sonar.server.platform.platformlevel.PlatformLevel4.start(PlatformLevel4.java:691) ~[sonar-server-5.6.jar:na] at org.sonar.server.platform.Platform.start(Platform.java:216) ~[sonar-server-5.6.jar:na] Caused by: java.lang.IllegalStateException: Unable to register extension org.sonar.api.config.PropertyDefinition at org.sonar.core.platform.ComponentContainer.addExtension(ComponentContainer.java:248) ~[sonar-core-5.6.jar:na] at org.sonar.server.plugins.ServerExtensionInstaller.installExtension(ServerExtensionInstaller.java:111) ~[sonar-server-5.6.jar:na] at org.sonar.server.plugins.ServerExtensionInstaller.installExtensions(ServerExtensionInstaller.java:66) ~[sonar-server-5.6.jar:na] Caused by: org.picocontainer.PicoCompositionException: Duplicate Keys not allowed. Duplicate for 'org.sonar.api.config.PropertyDefinition-sonar.cs.fxcop.timeoutMinutes'at org.picocontainer.DefaultPicoContainer.addAdapterInternal(DefaultPicoContainer.java:438) ~[picocontainer-2.15.jar:na] 2017.06.26 18:31:11 ERROR web[o.a.c.c.StandardContext] One or more listeners failed to start. Full details will be found in the appropriate container log file 2017.06.26 18:31:11 ERROR web[o.a.c.c.StandardContext] Context [] startup failed due to previous errors 2017.06.26 18:31:11 WARN web[o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread 2017.06.26 18:31:11 WARN web[o.s.p.ProcessEntryPoint] Fail to start web java.lang.IllegalStateException: Webapp did not start at org.sonar.server.app.EmbeddedTomcat.isUp(EmbeddedTomcat.java:84) ~[sonar-server-5.6.jar:na]at org.sonar.server.app.WebServer.isUp(WebServer.java:47) [sonar-server-5.6.jar:na]at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:105) ~[sonar-process-5.6.jar:na]at org.sonar.server.app.WebServer.main(WebServer.java:68) [sonar-server5.6.jar:na]

有人可以帮助解决此问题吗?

您也需要更新MSBUILD的扫描仪。旧版本与Sonarc#6 。

不兼容

我通过删除FXCOP插件解决了此问题。该插件以某种方式停止工作。可以是我使用的版本与C#插件不兼容。我安装了C#插件版本5.0(最新是6.0(

如上所述,如果我想使用C#最新版本,我需要为MSBUILD更新声纳扫描仪。

最新更新