java – 如何在Cloud9中运行maven build

前端之家收集整理的这篇文章主要介绍了java – 如何在Cloud9中运行maven build前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我只是尝试使用Cloud9 ide,我成功地将我的 github存储库分叉并将settings.xml放到$HOME / .m2 /目录中.

当我尝试构建mvn clean install时,我遇到了错误

[INFO] Error building POM (may not be this project's POM).


Project ID: com.temenos.interaction:com.temenos.interaction.rimdsl.parent

Reason: Cannot find layout implementation corresponding to: 'p2' for remote repository with id: 'p2.eclipse.kepler'. for project com.temenos.interaction:com.temenos.interaction.rimdsl.parent


[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Cannot find layout implementation corresponding to: 'p2' for remote repository with id: 'p2.eclipse.kepler'. for project com.temenos.interaction:com.temenos.interaction.rimdsl.parent
        at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:404)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:272)
        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:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        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.project.ProjectBuildingException: Cannot find layout implementation corresponding to: 'p2' for remote repository with id: 'p2.eclipse.kepler'. for project com.temenos.interaction:com.temenos.interaction.rimdsl.parent
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildArtifactRepositories(DefaultMavenProjectBuilder.java:949)
        at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1206)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:823)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:508)
        at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:200)
        at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:604)
        at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:487)
        at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:560)
        at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:560)
        at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:391)
        ... 12 more
Caused by: org.apache.maven.artifact.InvalidRepositoryException: Cannot find layout implementation corresponding to: 'p2' for remote repository with id: 'p2.eclipse.kepler'.
        at org.apache.maven.project.ProjectUtils.getRepositoryLayout(ProjectUtils.java:157)
        at org.apache.maven.project.ProjectUtils.buildArtifactRepository(ProjectUtils.java:110)
        at org.apache.maven.project.ProjectUtils.buildArtifactRepositories(ProjectUtils.java:56)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildArtifactRepositories(DefaultMavenProjectBuilder.java:942)
        ... 21 more
Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException: Component descriptor cannot be found in the component repository: org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayoutp2.
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:323)
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:440)
        at org.apache.maven.project.ProjectUtils.getRepositoryLayout(ProjectUtils.java:153)
        ... 24 more

现在我的问题是如何启用从不同存储库下载工件?
Cloud9工作区有什么设置吗?

解决方法

您的问题可能出在Maven版本上.

如果你在终端上执行:

$dpkg --get-selection | grep -i maven

如果你有像maven2这样的东西,你已经在你的环境中安装了Maven的旧​​版本2.显然,某些目标或插件仅适用于后一版本3.

因此,在您的Cloud9环境中,您可以安装版本3,如下所示:

$sudo apt-get remove maven2
$sudo apt-get install maven
$export MAVEN_OPTS="-Xmx256m"

最后一个命令是为了避免你的maven进程被Cloud9杀死,当它超过maven的内存边界时,它可能会发生在你身上. [碰巧发生在我身上:P]

您可以在这里更详细地了解这一点:How to use Cloud9 with Maven?

猜你在找的Java相关文章