3

当我尝试构建(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] ------------------------------------------------------------------------
4

2 回答 2

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 给出了 301 https://maven.glass...,出于某种原因,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(此时)。

我希望这有帮助。如果你能弄清楚,请回帖,因为这是我到目前为止所获得的!

于 2012-06-05T15:42:41.650 回答
0

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

只需安装 Maven 2.X(我使用的是 2.2.1),然后将它的“bin”目录放在 PATH 环境变量的第一个位置,就可以了。

于 2013-04-26T17:14:27.030 回答