问题
Does anyone know what the following exception means, or how I should begin to debug or investigate it? I find it rather cryptic. I think it means I'm missing a Maven dependency in my pom.xml, but I can't for the life of me work out what.
Regards,
Caused by: hudson.maven.MavenEmbedderException: java.util.NoSuchElementException
role: org.apache.maven.execution.MavenExecutionRequestPopulator
roleHint:
at fitnesse.wikitext.widgets.DependencyResolvingMavenEmbedder.<init>(DependencyResolvingMavenEmbedder.java:84)
at fitnesse.wikitext.widgets.DependencyResolvingMavenEmbedder.<init>(DependencyResolvingMavenEmbedder.java:64)
at fitnesse.wikitext.widgets.DependencyResolvingMavenEmbedder.<init>(DependencyResolvingMavenEmbedder.java:90)
at fitnesse.wikitext.widgets.MavenClasspathExtractor.mavenConfiguration(MavenClasspathExtractor.java:80)
at fitnesse.wikitext.widgets.MavenClasspathExtractor.extractClasspathEntries(MavenClasspathExtractor.java:32)
... 25 more
Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException: java.util.NoSuchElementException
role: org.apache.maven.execution.MavenExecutionRequestPopulator
roleHint:
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:247)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:235)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:229)
at fitnesse.wikitext.widgets.DependencyResolvingMavenEmbedder.lookup(DependencyResolvingMavenEmbedder.java:522)
at fitnesse.wikitext.widgets.DependencyResolvingMavenEmbedder.buildMavenExecutionRequest(DependencyResolvingMavenEmbedder.java:107)
at fitnesse.wikitext.widgets.DependencyResolvingMavenEmbedder.<init>(DependencyResolvingMavenEmbedder.java:74)
... 29 more
Caused by: java.util.NoSuchElementException
at org.sonatype.guice.plexus.locators.RealmFilter$FilteredItr.next(RealmFilter.java:100)
at org.sonatype.guice.plexus.locators.RealmFilter$FilteredItr.next(RealmFilter.java:58)
at org.sonatype.guice.plexus.locators.DefaultPlexusBeans$Itr.next(DefaultPlexusBeans.java:64)
at org.sonatype.guice.plexus.locators.DefaultPlexusBeans$Itr.next(DefaultPlexusBeans.java:52)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:243)
... 34 more
When I run Maven with -X, get some extra info, just slightly before the exception, along the lines of:
Created new class realm plugin>eg.example:artifact:1.0.0-SNAPSHOT
Importing foreign packages into class realm plugin>eg.example:artifact:1.0.0-SNAPSHOT
Imported: < maven.api
Populating class realm plugin>eg.example:artifact:1.0.0-SNAPSHOT
Then it lists a whole bunch of dependencies as being included, for example:
Included: bouncycastle:bcprov-jdk15:jar:135
Included: mx4j:mx4j-tools:jar:3.0.1
Included: org.mortbay.jetty:servlet-api-2.5:jar:6.1.9
Included: net.jcip:jcip-annotations:jar:1.0
Then it lists a whole bunch of dependencies as being excluded. It is some of these dependencies that I think are needed. How do I get them included? Why are they excluded? What logic is going on here?
Excluded: org.apache.maven:maven-compat:jar:3.0.1
Excluded: org.apache.maven:maven-model-builder:jar:3.0.1
Excluded: org.apache.maven:maven-aether-provider:jar:3.0.1
Excluded: org.sonatype.aether:aether-api:jar:1.8
Excluded: org.sonatype.aether:aether-spi:jar:1.8
Excluded: org.sonatype.aether:aether-impl:jar:1.8
Excluded: org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-7
Excluded: org.apache.maven:maven-plugin-api:jar:3.0.4
Excluded: org.apache.maven:maven-model:jar:3.0.4
Excluded: org.apache.maven:maven-artifact:jar:3.0.4
Excluded: org.sonatype.sisu:sisu-inject-plexus:jar:2.3.0
Excluded: org.codehaus.plexus:plexus-classworlds:jar:2.4
Excluded: org.apache.maven:maven-project:jar:2.0.9
Excluded: org.apache.maven:maven-settings:jar:2.0.9
Excluded: org.apache.maven:maven-profile:jar:2.0.9
Excluded: org.apache.maven:maven-artifact-manager:jar:2.0.9
Excluded: org.apache.maven:maven-plugin-registry:jar:2.0.9
Excluded: org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1
Excluded: org.apache.maven:maven-core:jar:2.0.9
Excluded: org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.9
Excluded: org.apache.maven:maven-repository-metadata:jar:2.0.9
Excluded: org.apache.maven:maven-error-diagnostics:jar:2.0.9
Excluded: org.apache.maven:maven-plugin-descriptor:jar:2.0.9
Excluded: org.apache.maven:maven-monitor:jar:2.0.9
Excluded: classworlds:classworlds:jar:1.1
Excluded: org.apache.maven:maven-toolchain:jar:2.0.9
来源:https://stackoverflow.com/questions/9365294/maven-plexus-componentlookupexception-classpath-nightmare