【问题标题】:No plugin found for prefix 'sonar' in the current project and in the plugin groups Error在当前项目和插件组中找不到前缀“声纳”的插件错误
【发布时间】:2013-09-12 07:34:55
【问题描述】:

直到昨天,Jenkins 和 Sonar(使用 Maven)一切正常。突然,我在 Jenkins 日志中看到了以下错误,并且所有项目的构建都失败了,并且出现了相同的错误。

[ERROR] No plugin found for prefix 'sonar' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/user/mysys/.m2/repository), nexus (http://localhost:8081/nexus/content/groups/public)] -> [Help 1]
org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException: No plugin found for prefix 'sonar' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/user/mysys/.m2/repository), nexus (http://localhost:8081/nexus/content/groups/public)]
    at org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.resolve(DefaultPluginPrefixResolver.java:94)
    at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.findPluginForPrefix(MojoDescriptorCreator.java:262)
    at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDescriptor(MojoDescriptorCreator.java:222)
    at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:106)
    at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:86)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:98)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    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:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    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)

我在 Jenkins 中运行了声纳并安装了声纳插件。

可能是什么问题。任何人都可以在这方面帮助我。

【问题讨论】:

  • 您必须对配置进行了某些更改,因为这不会“突然”发生...
  • 嗨 Fabrice,我已将 cobertura 最大内存(在声纳设置中)设置为 1.5 GB,以使我们的一个大型项目生成代码覆盖率。在进行 cobertura 内存更改后,我看到大项目生成代码覆盖率报告,但所有后续构建都失败并出现上述错误,包括所有小项目。你能在这里提出什么建议吗?

标签: maven jenkins sonarqube


【解决方案1】:

从今天早上开始我就遇到了同样的问题。我没有对我的 conf 进行任何更改。我在 Jenkins 上找到了一个解决方案:管理 Jenkins -> 配置系统 -> 声纳 -> 高级 -> 声纳-maven-plugin 版本,我放了 2.1,我所有的项目现在都可以正常工作,很奇怪......

【讨论】:

  • 嗨 Bigoudenus,在将 Manage Jenkins -> Configure System -> Sonar -> Advanced -> version of sonar-maven-plugin 设置为 2.1 之后,它也对我有用。非常感谢:)
【解决方案2】:

这里也一样。我已经在 pom 中定义了插件(所以我们也可以在本地运行声纳)

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>sonar-maven-plugin</artifactId>
                <version>2.1</version>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

【讨论】:

    【解决方案3】:

    这些都没有为我解决。在 Bamboo 中运行时出现错误。我不需要向 pom 添加任何内容。这是我用来运行 Sonar Maven 任务的 JDK 版本。

    【讨论】:

      猜你喜欢
      • 2019-08-09
      • 2023-03-04
      • 2018-04-28
      • 2016-07-09
      • 1970-01-01
      • 2014-08-10
      • 2016-04-18
      • 2017-06-02
      • 1970-01-01
      相关资源
      最近更新 更多