简体   繁体   English

sonar-maven-plugin停止在詹金斯工作

[英]sonar-maven-plugin stopped working in jenkins

A week ago, all our code analysis jobs stopped working with the error message you see at the end of this post. 一周前,我们所有的代码分析工作都停止使用您在本文末尾看到的错误消息。 We have not upgraded anything, it simply stopped working. 我们没有升级任何东西,它只是停止工作。 The only difference I see in the jenkins logs is, that a different version of the sonar-maven-plugin ist used. 我在jenkins日志中看到的唯一区别是,使用了不同版本的sonar-maven-plugin。 It was 2.6 before and it is 2.7.1 now. 之前是2.6,现在是2.7.1。 And we don't know, where the information comes from. 我们不知道,信息来自哪里。

Our infrastucture: 我们的基础设施:

  • Jenkins 1.565.3 詹金斯1.565.3
  • Jenkins Sonar Plugin 2.1 詹金斯声纳插件2.1
  • Sonarqube 3.1.1 Sonarqube 3.1.1
  • Maven 3.0.3 Maven 3.0.3

We have no information about sonar-maven-plugin placed in the pom. 我们没有关于放置在pom中的sonar-maven-plugin的信息。 Everything is handled by the Jenkins Sonar Plugin. 一切都由Jenkins Sonar插件处理。

I noticed a difference between the last build, where the code analysis was working and the first build where it faild: 我注意到代码分析工作的最后一个构建和它发展的第一个构建之间的区别:

Working logmessing: 工作logmessing:

Downloading: https://artifactory.nepatec.de/repo/org/codehaus/mojo/sonar-maven-plugin/2.6/sonar-maven-plugin-2.6.pom

Message the failed build: 发送失败的构建消息:

Downloading: https://artifactory.nepatec.de/repo/org/codehaus/mojo/sonar-maven-plugin/2.7.1/sonar-maven-plugin-2.7.1.pom

We don't know where the version change comes from, because it is not defined in the jenkins sonar plugin and we also did not find a way to configure it. 我们不知道版本更改的来源,因为它没有在jenkins声纳插件中定义,我们也没有找到配置它的方法。

Does anyone know, why the version jump comes from and what we can do, to revert it? 有谁知道,为什么版本跳转来自我们可以做什么,还原它?

The Build always fails with the following Exception: Build始终失败,并出现以下异常:

05.11.2015 09:08:35 org.sonatype.guice.bean.reflect.NamedClass
WARNUNG: Error injecting: org.codehaus.mojo.sonar.SonarMojo
java.lang.TypeNotPresentException: Type org.codehaus.mojo.sonar.SonarMojo not present
    at org.sonatype.guice.bean.reflect.URLClassSpace.loadClass(URLClassSpace.java:100)
    at org.sonatype.guice.bean.reflect.NamedClass.load(NamedClass.java:45)
    at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:47)
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
    at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:968)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1014)
    at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:964)
    at com.google.inject.Scopes$1$1.get(Scopes.java:59)
    at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:79)
    at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:53)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:243)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:235)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:455)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:92)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at    org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: java.lang.UnsupportedClassVersionError: org/codehaus/mojo/sonar/SonarMojo : Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:386)
    at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
    at org.sonatype.guice.bean.reflect.URLClassSpace.loadClass(URLClassSpace.java:96)
... 33 more

The latest release of the Maven SonarQube Plugin requires Java 7 at least, see MSONAR-126 . 最新版本的Maven SonarQube插件至少需要Java 7,请参阅MSONAR-126

So you have to update your Jenkins configuration to eun (at least) the SonaQube analyses using Java 7+. 因此,您必须使用Java 7+将Jenkins配置更新为至少(至少)SonaQube分析。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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