Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

不支持sonarQube7.*版本 #6

Open
zhangjh953166 opened this issue Oct 29, 2018 · 22 comments
Open

不支持sonarQube7.*版本 #6

zhangjh953166 opened this issue Oct 29, 2018 · 22 comments

Comments

@zhangjh953166
Copy link

使用sonarQube7版本以上,提示无法加载plugin。看错误是使用的api接口已经废弃了。
Caused by: java.lang.NoClassDefFoundError: org/sonar/api/batch/Sensor

@xiaoyi001yeye
Copy link

我也遇到这个问题了,咋办呢。

@xiaoyi001yeye
Copy link

https://docs.sonarqube.org/display/PLUG/Plugin+Version+Matrix 貌似7.3不支持PMD了,不知道为啥。用老的吧

@xiaoyi001yeye
Copy link

https://github.com/jensgerdes/sonar-pmd/releases 昨天刚刚发布了3.0.0版本,支持7.3

@rhinoceros
Copy link

我临时调通了一个:sonarqube7.6 和 sonar-pmd 3.2.0-SNAPSHOT 和 p3c-pmd 1.3.4


p3c-pmd 1.3.4-pmd6.10.0
         把p3c-pmd的pmd版本升级到6.10.0
         代码:https://github.com/rhinoceros/p3c/blob/p3c-pmd-1.3.4-branch/p3c-pmd
         mvn clean install

sonar-pmd 3.2.0-SNAPSHOT 集成p3c-pmd 1.3.4-pmd6.10.0
         p3c-pmd 1.3.4-pmd6.10.0
         代码: https://github.com/rhinoceros/sonar-p3c-pmd/tree/pmd-3.2.0-beta/sonar-pmd-plugin
         mvn clean package
         然后把target/sonar-pmd-plugin-3.2.0-SNAPSHOT.jar 更新到sonarqube服务器上sonarqube-7.6/extensions/plugins/sonar-pmd-plugin-3.2.0-SNAPSHOT.jar。 更新前记得,停止sonarqube,删除旧的pmd插件; 更新后启动sonarqube。

@Kealina-A
Copy link

@rhinoceros 你集成成功了么,我按照你的说明执行,还是启动失败,可以留个联系方式么?我咨询你细节,报的错误和之前没更新的一样,以下是错误信息
ERROR web[][o.s.s.p.Platform] Background initialization failed. Stopping SonarQube java.lang.IllegalStateException: Fail to load plugin PMD [pmd] at org.sonar.server.plugins.ServerExtensionInstaller.installExtensions(ServerExtensionInstaller.java:82) at org.sonar.server.platform.platformlevel.PlatformLevel4.start(PlatformLevel4.java:573) at org.sonar.server.platform.Platform.start(Platform.java:211) at org.sonar.server.platform.Platform.startLevel34Containers(Platform.java:185) at org.sonar.server.platform.Platform.access$500(Platform.java:46) at org.sonar.server.platform.Platform$1.lambda$doRun$0(Platform.java:119) at org.sonar.server.platform.Platform$1$$Lambda$765/418344244.run(Unknown Source) at org.sonar.server.platform.Platform$AutoStarterRunnable.runIfNotAborted(Platform.java:371) at org.sonar.server.platform.Platform$1.doRun(Platform.java:119) at org.sonar.server.platform.Platform$AutoStarterRunnable.run(Platform.java:355) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.NoClassDefFoundError: org/sonar/api/batch/Sensor at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$100(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at org.sonar.classloader.ClassRealm.loadClassFromSelf(ClassRealm.java:125) at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:37) at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87) at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76) at org.sonar.plugins.pmd.PmdPlugin.getExtensions(PmdPlugin.java:37) at org.sonar.api.SonarPlugin.define(SonarPlugin.java:51) at org.sonar.server.plugins.ServerExtensionInstaller.installExtensions(ServerExtensionInstaller.java:72) ... 10 common frames omitted Caused by: java.lang.ClassNotFoundException: org.sonar.api.batch.Sensor at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:39) at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87) at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76) ... 26 common frames omitted

@rhinoceros
Copy link

rhinoceros commented Feb 25, 2019

https://github.com/rhinoceros/sonar-p3c-pmd/releases/tag/pmd-3.2.0-beta-with-p3c1.3.4-pmd6.10.0

这个包在 我在sonarqube7.6 enterprise(试用许可),试用过。
不要在生产环境上使用。

@rhinoceros
Copy link

rhinoceros commented Feb 26, 2019

p3c1.3.6也可以用了
https://github.com/rhinoceros/sonar-p3c-pmd/releases/tag/pmd-3.2.0-beta-with-p3c1.3.6-pmd6.10.0
不要在生产环境上使用。

@Kealina-A
Copy link

@rhinoceros 已经试用成功,非常感谢

@CaoFeng1226
Copy link

@rhinoceros 请问您做的这个3.20插件包含了多少p3c的规则?

@rhinoceros
Copy link

image
51个
@CaoFeng1226

@CaoFeng1226
Copy link

谢谢!@rhinoceros

@OuIChien
Copy link

怎样才算是生产环境?

@elinalin
Copy link

使用sonarQube7版本以上,提示无法加载plugin。看错误是使用的api接口已经废弃了。
Caused by: java.lang.NoClassDefFoundError: org/sonar/api/batch/Sensor

image
51个
@CaoFeng1226

是不是7.7不支持啊

@nongzhi9950
Copy link

我用https://github.com/mrprince/sonar-p3c-pmd/ 源码 下载编译后生成sonar-pmd-plugin-2.6.jar
,之后copy到sonarqube-7.0 的extensions\plugins目录下(将之前的pmd插件删除, 重新启动sonar,

启动后是能看到p3c 的代码规则,但在jenkins job中调用sonar-scanner 进行代码检查时,运行到PMD Configuration
后面就卡住不往下走了;之后用你提到的sonar-pmd-plugin-3.2.0-SNAPSHOT.jar , 也是一样的;

是sonarqube 7.0 不支持sonar p3c pmd编译出的插件吗?

请帮忙抽空给分析分析,多谢多谢~

@nongzhi9950
Copy link

image

@nongzhi9950
Copy link

sonarqube 7.0 7.6,7.8三个版本都试了,都是同样的卡在这了。

@chimisu
Copy link

chimisu commented Apr 13, 2020

这个问题有进展吗?

@1054522381
Copy link

1054522381 commented Dec 29, 2020

sonarqube7.6社区版 也是前端可以看到p3c规则,但是项目扫描的时候会失败

@rhinoceros
Copy link

image
我就是7.6 啊

sonarqube7.6社区版 也是前端可以看到p3c规则,但是项目扫描的时候会失败

@rhinoceros
Copy link

Community Edition版本 7.6 (build 21501)

@caojiele
Copy link

image
image
9.0的支持吗?jar放进去并且重启sonar,仓库里面也没有。

@gotoworld
Copy link

Community EditionVersion 9.2.1 (build 49989)

with the same ERROR

2022.04.16 08:50:41 INFO  web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2022.04.16 08:50:43 ERROR web[][o.s.s.p.Platform] Background initialization failed. Stopping SonarQube
java.lang.IllegalStateException: Fail to load plugin PMD [pmd]
        at org.sonar.server.plugins.ServerExtensionInstaller.installExtensions(ServerExtensionInstaller.java:77)
        at org.sonar.server.platform.platformlevel.PlatformLevel4.start(PlatformLevel4.java:581)
        at org.sonar.server.platform.PlatformImpl.start(PlatformImpl.java:213)
        at org.sonar.server.platform.PlatformImpl.startLevel34Containers(PlatformImpl.java:187)
        at org.sonar.server.platform.PlatformImpl$1.lambda$doRun$0(PlatformImpl.java:120)
        at org.sonar.server.platform.PlatformImpl$AutoStarterRunnable.runIfNotAborted(PlatformImpl.java:370)
        at org.sonar.server.platform.PlatformImpl$1.doRun(PlatformImpl.java:120)
        at org.sonar.server.platform.PlatformImpl$AutoStarterRunnable.run(PlatformImpl.java:354)
        at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.NoClassDefFoundError: org/sonar/api/batch/Sensor
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
        at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
        at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:550)
        at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:458)
        at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:452)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:451)
        at org.sonar.classloader.ClassRealm.loadClassFromSelf(ClassRealm.java:125)
        at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:37)
        at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
        at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)
        at org.sonar.plugins.pmd.PmdPlugin.getExtensions(PmdPlugin.java:37)
        at org.sonar.api.SonarPlugin.define(SonarPlugin.java:51)
        at org.sonar.server.plugins.ServerExtensionInstaller.installExtensions(ServerExtensionInstaller.java:67)
        ... 8 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.sonar.api.batch.Sensor
        at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:39)
        at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests