Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to run maven build in Cloud9

I am just trying Cloud9 ide, I successfully forked my github repository and placed settings.xml to $HOME/.m2/ directory.

When I am trying to build mvn clean install I am getting below error


[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

now my question is how do I enable to download artifacts from different repository? is there any setting for Cloud9 workspace?

like image 338
Jangid Avatar asked Jul 27 '14 14:07

Jangid


1 Answers

Your problem could be on the Maven version.

If you execute on the terminal:

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

If you have something like maven2 you have installed on your environment the old version 2 of Maven. Apparently some goals or plugins are only available on the latter version 3.

So, on your Cloud9 environment you can install the version 3 like this:

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

The last command it's to avoid your maven process to be killed by Cloud9 when it exceeds the memory boundaries with maven probably it will happend to you. [ It happened to me :P ]

You can read about this in more detail here: How to use Cloud9 with Maven?

like image 175
Paulo Oliveira Avatar answered Sep 21 '22 13:09

Paulo Oliveira