简体   繁体   中英

Stylecop Anayzers plugin for Sonarqube does not allow to start the platform

I want to use the rules of the StyleCop analyzer for Roslyn in SonarQube, In order to do that and following the documentation founded, I downloaded the SonarQube Roslyn SDK , and try to generate the plugin with for the analyzer with the following command:

RoslynSonarQubePluginGenerator /a:StyleCop.Analyzers /sqale:StyleCop.Analyzers.1.0.0.sqale.xml

It generates a LOG without errors, however a dialog telling me that a file is not located appear, dos not show anymore. At the end this message appear:

Plugin generated: C:\Temp\SonarQube.Roslyn.SDK-1.0\stylecopanalyzers-plugin-1.0.0.jar

I copy the plugin to C:\\Sonar\\sonarqube_5_6\\extensions\\plugins and try to start the SonarQube instance, but it fails. the following log appear at sonar.log file:

2016.10.07 15:35:18 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 instantiate class [org.sonar.plugins.roslynsdk.RoslynSdkGeneratedPlugin] of plugin [stylecopanalyzers]
    at org.sonar.core.platform.PluginLoader.instantiatePluginClasses(PluginLoader.java:146) ~[sonar-core-5.6.1.jar:na]
    at org.sonar.core.platform.PluginLoader.load(PluginLoader.java:73) ~[sonar-core-5.6.1.jar:na]
    at org.sonar.server.plugins.ServerPluginRepository.loadInstances(ServerPluginRepository.java:288) ~[sonar-server-5.6.1.jar:na]
    at org.sonar.server.plugins.ServerPluginRepository.start(ServerPluginRepository.java:117) ~[sonar-server-5.6.1.jar:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_65]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_65]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_65]
    at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_65]
    at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89) ~[picocontainer-2.15.jar:na]
    at org.sonar.core.platform.ComponentContainer$1.start(ComponentContainer.java:320) ~[sonar-core-5.6.1.jar:na]
    at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.behaviors.Stored.start(Stored.java:110) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767) ~[picocontainer-2.15.jar:na]
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:141) ~[sonar-core-5.6.1.jar:na]
    at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:84) ~[sonar-server-5.6.1.jar:na]
    at org.sonar.server.platform.Platform.start(Platform.java:216) ~[sonar-server-5.6.1.jar:na]
    at org.sonar.server.platform.Platform.startLevel2Container(Platform.java:182) ~[sonar-server-5.6.1.jar:na]
    at org.sonar.server.platform.Platform.init(Platform.java:91) ~[sonar-server-5.6.1.jar:na]
    at org.sonar.server.platform.PlatformServletContextListener.contextInitialized(PlatformServletContextListener.java:43) ~[sonar-server-5.6.1.jar:na]
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4812) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5255) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_65]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_65]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_65]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_65]
Caused by: java.lang.ClassNotFoundException: org.sonar.plugins.roslynsdk.RoslynSdkGeneratedPlugin
    at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:39) ~[sonar-classloader-1.0.jar:na]
    at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87) ~[sonar-classloader-1.0.jar:na]
    at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76) ~[sonar-classloader-1.0.jar:na]
    at org.sonar.core.platform.PluginLoader.instantiatePluginClasses(PluginLoader.java:141) ~[sonar-core-5.6.1.jar:na]
    ... 32 common frames omitted

If I open the jar file, it just have a META-INF folder

META-INF
  |_lib
      |_sslr-squid-bridge-2.6.jar

I already downloaded sonarqube-roslyn-sdk-template-plugin and put in the same folder as the SDK, but the behavior remains.

Am I missing some step? Does I need anything else?

I download the code. in the project SonarQube.Plugins.Roslyn.PluginGenerator.csproj at the class ArchiveUpdater, specifically in the method ZipUsingShell there was an error adding the files, it shows a dialog box.

As a workaround I take the temporal folder and create the .jar file manually. I would like to go deep, why it is not able to add the files but currently I am in a Hurry.

I guess the issue may be related to the instance of 7zip that I have installed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM