获取错误原因:不是v4.0.0 POM。项目org.kohsuke.stapler:maven-stapler-plugin尝试构建幻灯片插件

时间:2012-04-16 04:34:34

标签: jenkins-plugins

当我尝试构建(mvn)幻灯片插件时,我收到错误: (见下面的详细信息)

mvn -e

+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING] POM for 'org.kohsuke.stapler:maven-stapler-plugin:pom:1.15:runtime' is invalid.

Its dependencies (if any) will NOT be available to the current build.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: org.kohsuke.stapler:maven-stapler-plugin
POM Location: /home/kahmed/.m2/repository/org/kohsuke/stapler/maven-stapler-plugin/1.15/maven-stapler-plugin-1.15.pom

Reason: Not a v4.0.0 POM. for project org.kohsuke.stapler:maven-stapler-plugin at /home/kahmed/.m2/repository/org/kohsuke/stapler/maven-stapler-plugin/1.15/maven-stapler-plugin-1.15.pom


[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Unable to build project for plugin 'org.kohsuke.stapler:maven-stapler-plugin': Not a v4.0.0 POM. for project org.kohsuke.stapler:maven-stapler-plugin at /home/kahmed/.m2/repository/org/kohsuke/stapler/maven-stapler-plugin/1.15/maven-stapler-plugin-1.15.pom
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.loadPluginFully(DefaultLifecycleExecutor.java:1599)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.findArtifactTypeHandlersInPlugins(DefaultLifecycleExecutor.java:1468)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.findExtensions(DefaultLifecycleExecutor.java:222)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:178)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
    at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
    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.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.InvalidPluginException: Unable to build project for plugin 'org.kohsuke.stapler:maven-stapler-plugin': Not a v4.0.0 POM. for project org.kohsuke.stapler:maven-stapler-plugin at /home/kahmed/.m2/repository/org/kohsuke/stapler/maven-stapler-plugin/1.15/maven-stapler-plugin-1.15.pom
    at org.apache.maven.plugin.DefaultPluginManager.checkRequiredMavenVersion(DefaultPluginManager.java:293)
    at org.apache.maven.plugin.DefaultPluginManager.verifyVersionedPlugin(DefaultPluginManager.java:205)
    at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:184)
    at org.apache.maven.plugin.DefaultPluginManager.loadPluginFully(DefaultPluginManager.java:1626)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.loadPluginFully(DefaultLifecycleExecutor.java:1582)
    ... 15 more
Caused by: org.apache.maven.project.InvalidProjectModelException: Not a v4.0.0 POM. for project org.kohsuke.stapler:maven-stapler-plugin at /home/kahmed/.m2/repository/org/kohsuke/stapler/maven-stapler-plugin/1.15/maven-stapler-plugin-1.15.pom
    at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1599)
    at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1571)
    at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:562)
    at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:251)
    at org.apache.maven.plugin.DefaultPluginManager.checkRequiredMavenVersion(DefaultPluginManager.java:277)
    ... 19 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Mon Apr 16 00:32:26 EDT 2012
[INFO] Final Memory: 15M/182M
[INFO] ------------------------------------------------------------------------

2 个答案:

答案 0 :(得分:2)

我也得到了这个(尽管它用于akuma神器)并且可以解释原因,但还没有找到一个好的解决方案。两者都定义了父POM和新的repo:

<parent>
  <groupId>org.kohsuke</groupId>
  <artifactId>pom</artifactId>
  <version>2</version>
</parent>

<repositories>
  <repository>
    <id>m.g.o-public</id>
    <url>http://maven.glassfish.org/content/groups/public/</url>
  </repository>
</repositories>

此glassfish maven repo的URL为https://maven.glass...提供301,由于某种原因,maven决定将该响应的正文下载为POM。如果你查看~/.m2/repository/org/kohsuke/pom/2/pom-2.pom,你会看到类似的内容:

<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/0.6.39</center>
</body>
</html>

手动查看glassfish回购,我甚至没有看到所需的父POM(此时)。

我希望这会有所帮助。如果你能够弄明白,请回复,因为到目前为止这已经到了!

答案 1 :(得分:0)

我也有这个问题,与另一个项目有不同的POM,我试图用Maven 3.X构建。简单的解决方案是安装最新的2.X版Maven。在那之后,它建好了。作为Maven新手,看来REPOS的URI格式在两个版本之间有所不同。

只需安装Maven 2.X(我使用的是2.2.1),然后将它的“bin”目录放在PATH env变量中,你就应该好了。