[IDEA 10.5.4 + Maven] Cannot find layout implementation corresponding to: 'p2' for remote repository with id: 'yyyy'. for project xxx:xxx

Hi,

I have imported a maven project into IntelliJ IDEA 10.5.4, but while importing dependencies are not imported correctly. Logs show following exception stack.

2012-01-03 19:57:48,899 [ 501931]   INFO -      #org.jetbrains.idea.maven - org.apache.maven.artifact.resolver.ArtifactResolutionException: Unable to get dependency information: Unable to read the metadata file for artifact 'xxx:xxx:xxx': Cannot find layout implementation corresponding to: 'p2' for remote repository with id: 'yyyy'. for project xxx:xxx
  xxx:xxx:jar:2.0.2

from the specified remote repositories:
  central-noinexus (),
  central (),

Path to dependency:
 1) xxx:xxx:xxx


java.lang.RuntimeException: org.apache.maven.artifact.resolver.ArtifactResolutionException: Unable to get dependency information: Unable to read the metadata file for artifact 'xx:xxx:jar': Cannot find layout implementation corresponding to: 'p2' for remote repository with id: 'yyyy'. for project xxx:xxx
  xx:xxx:jar:2.0.2

from the specified remote repositories:
  central-noinexus (),
  central (),

Path to dependency:
 1) xxx:xxx:xxx

 at org.apache.maven.artifact.resolver.DefaultArtifactCollector.recurse(DefaultArtifactCollector.java:430)
 at org.apache.maven.artifact.resolver.DefaultArtifactCollector.collect(DefaultArtifactCollector.java:74)
 at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:316)
 at org.jetbrains.maven.embedder.MavenEmbedder.resolveProject(MavenEmbedder.java:212)
 at org.jetbrains.idea.maven.server.embedder.Maven2ServerEmbedderImpl$2.execute(Maven2ServerEmbedderImpl.java:135)
 at org.jetbrains.idea.maven.server.embedder.Maven2ServerEmbedderImpl$2.execute(Maven2ServerEmbedderImpl.java:132)
 at org.jetbrains.idea.maven.server.embedder.Maven2ServerEmbedderImpl$6.run(Maven2ServerEmbedderImpl.java:510)
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.RuntimeException: org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException: Unable to read the metadata file for artifact 'xxx:xxx:jar': Cannot find layout implementation corresponding to: 'p2' for remote repository with id: 'yyyy'. for project xxx:xxx
 at org.apache.maven.project.artifact.MavenMetadataSource.retrieveRelocatedProject(MavenMetadataSource.java:200)
 at org.apache.maven.project.artifact.MavenMetadataSource.retrieveRelocatedArtifact(MavenMetadataSource.java:94)
 at org.apache.maven.artifact.resolver.DefaultArtifactCollector.recurse(DefaultArtifactCollector.java:387)
 ... 12 more
Caused by: java.lang.RuntimeException: org.apache.maven.project.ProjectBuildingException: Cannot find layout implementation corresponding to: 'p2' for remote repository with id: 'yyyy'. for project xxx:xxx
 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.assembleLineage(DefaultMavenProjectBuilder.java:1407)
 at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1407)
 at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:823)
 at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:255)
 at org.apache.maven.project.artifact.MavenMetadataSource.retrieveRelocatedProject(MavenMetadataSource.java:163)
 ... 14 more
Caused by: java.lang.RuntimeException: org.apache.maven.artifact.InvalidRepositoryException: Cannot find layout implementation corresponding to: 'p2' for remote repository with id: 'yyyy'.
 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)
 ... 20 more
Caused by: java.lang.RuntimeException: 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)
 ... 23 more



I am using maven 3.0.3. Please let me know how to resolve this issue.

Thanks
1 comment
Comment actions Permalink

I have the same issue with IntelliJ 11.0.1.

From what I found [0], it seems the "p2" layout is only available since maven 3, so maybe IDEA includes maven libraries in version 2?

[0] http://dev.eclipse.org/mhonarc/lists/tycho-user/msg01310.html

Here is the snippet from my idea.log (I renamed proprietary artifact ids to INTERNAL*)

java.lang.RuntimeException: org.apache.maven.artifact.resolver.ArtifactResolutionException:
    Unable to get dependency information: Unable to read the metadata file for artifact 'com.INTERNAL:com.INTERNAL.java:jar':
        Cannot find layout implementation corresponding to: 'p2' for remote repository with id: 'INTERNAL-REPO-ID'. for project com.INTERNAL2:parent
  com.INTERNAL:com.INTERNAL.java:jar:2.0.2


from the specified remote repositories:
  central (http://repo1.maven.org/maven2),
  nexus-releases (http://INTERNAL-DOMAIN.com/content/groups/development-repositories)


Path to dependency:
 1) local:INTERNAL3:jar:1.0




 at org.apache.maven.artifact.resolver.DefaultArtifactCollector.recurse(DefaultArtifactCollector.java:430)
 at org.apache.maven.artifact.resolver.DefaultArtifactCollector.collect(DefaultArtifactCollector.java:74)
 at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:316)
 at org.jetbrains.maven.embedder.MavenEmbedder.resolveProject(MavenEmbedder.java:212)
 at org.jetbrains.idea.maven.server.embedder.Maven2ServerEmbedderImpl$2.execute(Maven2ServerEmbedderImpl.java:135)
 at org.jetbrains.idea.maven.server.embedder.Maven2ServerEmbedderImpl$2.execute(Maven2ServerEmbedderImpl.java:132)
 at org.jetbrains.idea.maven.server.embedder.Maven2ServerEmbedderImpl$6.run(Maven2ServerEmbedderImpl.java:510)
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.RuntimeException: org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException: Unable to read the metadata file for artifact 'com.INTERNAL:com.INTERNAL.java:jar': Cannot find layout implementation corresponding to: 'p2' for remote repository with id: 'INTERNAL-REPO-ID'. for project com.INTERNAL2:parent
 at org.apache.maven.project.artifact.MavenMetadataSource.retrieveRelocatedProject(MavenMetadataSource.java:200)
 at org.apache.maven.project.artifact.MavenMetadataSource.retrieveRelocatedArtifact(MavenMetadataSource.java:94)
 at org.apache.maven.artifact.resolver.DefaultArtifactCollector.recurse(DefaultArtifactCollector.java:387)
 ... 12 more
Caused by: java.lang.RuntimeException: org.apache.maven.project.ProjectBuildingException: Cannot find layout implementation corresponding to: 'p2' for remote repository with id: 'INTERNAL-REPO-ID'. for project com.INTERNAL2: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.assembleLineage(DefaultMavenProjectBuilder.java:1407)
 at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1407)
 at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:823)
 at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:255)
 at org.apache.maven.project.artifact.MavenMetadataSource.retrieveRelocatedProject(MavenMetadataSource.java:163)
 ... 14 more
Caused by: java.lang.RuntimeException: org.apache.maven.artifact.InvalidRepositoryException: Cannot find layout implementation corresponding to: 'p2' for remote repository with id: 'INTERNAL-REPO-ID'.
 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)
 ... 20 more
Caused by: java.lang.RuntimeException: 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)
 ... 23 more

0

Please sign in to leave a comment.