Maven发布插件错误

时间:2012-11-27 11:53:23

标签: maven jenkins maven-3 classnotfoundexception maven-release-plugin

我正在使用内部调用 maven-release-plugin 2.3.2 Jenkins M2 release plugin。我收到了这个错误:

 Waiting for Jenkins to finish collecting data
    mavenExecutionResult exceptions not empty
    message : Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare (default-cli) on project pms: Execution default-cli of goal org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare failed: A required class was missing while executing org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare: org.sonatype.plexus.components.cipher.PlexusCipher
    realm =    plugin>org.apache.maven.plugins:maven-release-plugin:2.3.2
    strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
...


    cause : Execution default-cli of goal org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare failed: A required class was missing while executing org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare: org.sonatype.plexus.components.cipher.PlexusCipher
    -----------------------------------------------------
    realm =    plugin>org.apache.maven.plugins:maven-release-plugin:2.3.2
    strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
    urls[0] = file:/opt/.../repository/org/apache/maven/plugins/maven-release-plugin/2.3.2/maven-release-plugin-2.3.2.jar
    urls[1] = file:/opt/.../repository/org/apache/maven/release/maven-release-manager/2.3.2/maven-release-manager-2.3.2.jar
...


    Number of foreign imports: 1
    import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

    -----------------------------------------------------

        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:127)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        ... 27 more
    Caused by: org.apache.maven.plugin.PluginContainerException: A required class was missing while executing org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare: org.sonatype.plexus.components.cipher.PlexusCipher
    -----------------------------------------------------
    realm =    plugin>org.apache.maven.plugins:maven-release-plugin:2.3.2
...

    Caused by: java.lang.ClassNotFoundException: org.sonatype.plexus.components.cipher.PlexusCipher
        at java.lang.ClassNotFoundException.<init>(ClassNotFoundException.java:76)
        at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:38)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
        ... 169 more
    channel stopped
    Finished: FAILURE

我错过了什么?

1 个答案:

答案 0 :(得分:1)

理想情况下,您不应该在向全世界发布的稳定Maven版本中获得此类Java依赖项异常。如果你仍然这样做,很可能

  1. 这是一个有很好记录的错误,应该很容易使用搜索引擎找到。
  2. 如果你不能到达这样一个地方,那么至少有一次这样做是值得的:清除所有东西,然后在质量保证网站上提出要求之前就开始清理。
  3. 在上述案例中,帮助我的是选项2。