简体   繁体   中英

Fail to instantiate class [org.sonar.plugins.scm.svn.SvnPlugin] of plugin [scmsvn] while running SonarQube in Jenkins

I'm trying to configure SonarQube in Jenkins for my Maven project, but during the analysis I get the following error:

16:26:46 **java.lang.IllegalStateException: Fail to instantiate class [org.sonar.plugins.scm.svn.SvnPlugin] of plugin [scmsvn]**
16:26:46    at org.sonar.core.platform.PluginLoader.instantiatePluginClasses(PluginLoader.java:147)
16:26:46    at org.sonar.core.platform.PluginLoader.load(PluginLoader.java:74)
16:26:46    at org.sonar.scanner.bootstrap.ScannerPluginRepository.start(ScannerPluginRepository.java:61)
16:26:46    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
16:26:46    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
16:26:46    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
16:26:46    at java.lang.reflect.Method.invoke(Method.java:498)
16:26:46    at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
16:26:46    at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)
16:26:46    at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
16:26:46    at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
16:26:46    at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
16:26:46    at org.picocontainer.behaviors.Stored.start(Stored.java:110)
16:26:46    at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016)
16:26:46    at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009)
16:26:46    at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
16:26:46    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:134)
16:26:46    at org.sonar.batch.bootstrapper.Batch.doStart(Batch.java:94)
16:26:46    at org.sonar.batch.bootstrapper.Batch.start(Batch.java:88)
16:26:46    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.start(BatchIsolatedLauncher.java:52)
16:26:46    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
16:26:46    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
16:26:46    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
16:26:46    at java.lang.reflect.Method.invoke(Method.java:498)
16:26:46    at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
16:26:46    at com.sun.proxy.$Proxy0.start(Unknown Source)
16:26:46    at org.sonarsource.scanner.api.EmbeddedScanner.doStart(EmbeddedScanner.java:220)
16:26:46    at org.sonarsource.scanner.api.EmbeddedScanner.start(EmbeddedScanner.java:156)
16:26:46    at org.sonarsource.scanner.cli.Main.execute(Main.java:70)
16:26:46    at org.sonarsource.scanner.cli.Main.main(Main.java:60)
16:26:46 **Caused by: java.lang.NoClassDefFoundError: org/tmatesoft/svn/core/wc/ISVNOptions**
16:26:46    at java.lang.Class.getDeclaredConstructors0(Native Method)
16:26:46    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
16:26:46    at java.lang.Class.getConstructor0(Class.java:3075)
16:26:46    at java.lang.Class.newInstance(Class.java:412)
16:26:46    at org.sonar.core.platform.PluginLoader.instantiatePluginClasses(PluginLoader.java:142)
16:26:46    ... 29 more
16:26:46 **Caused by: java.lang.ClassNotFoundException: org.tmatesoft.svn.core.wc.ISVNOptions**
16:26:46    at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:39)
16:26:46    at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
16:26:46    at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)
16:26:46    ... 34 more

I connect to SonarQube server v 6.7.1 and I've tried to use a couple of versions of SonnarScanner but all the time I get the same error. Do you know what might cause the issue?

This can be solved by doing the following try adding -Dsonar.scm.disabled=True in your command ( for eg.. mvn sonar:sonar -Dsonar.scm.disabled=True )

or

delete .sonar folder from home directory of your user eg .. rm -rf ~/.sonar

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