How to run maven on Cloud9

I'm just trying to use Cloud9 ide, I successfully forked my github repository and placed settings.xml in the $ HOME / .m2 / directory.

When I try to create mvn clean install , I get below the error


[INFO] Error building POM (may not be this project 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 artifact downloads from another repository? is there any customization of the Cloud9 workspace?

+6
source share
3 answers

Your problem may be in the Maven version.

If you run on the terminal:

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

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

So, in your Cloud9 environment, you can install version 3 as follows:

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

The last command to avoid your maven process, which should be killed by Cloud9 when it exceeds memory limits with maven, is likely to happen to you. [This happened to me: P]

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

+8
source

Other users have also encountered this problem with Cloud 9. See the next thread on Cloud 9. One of the users wrote a small piece that should work for you. enter the link here

0
source

From what I understand, your pom.xml refers to the repository identifier that is defined in your settings.xml , which makes you dependent on the platform you use to build, and thereby invalidates one of the Maven points: simplifying projects on any the car.

Will this work for you if you instead of your repositories inside your pom.xml project ? As far as I remember, the syntax is almost the same.

Link to POM, repository section: https://maven.apache.org/pom.html#Repositories

0
source

Source: https://habr.com/ru/post/972918/


All Articles