2

有谁知道以下异常是什么意思,或者我应该如何开始调试或调查它?我觉得它相当神秘。我认为这意味着我的 pom.xml 中缺少一个 Maven 依赖项,但我一辈子都无法弄清楚是什么。

问候,

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

当我使用 -X 运行 Maven 时,会在异常之前稍稍获取一些额外信息,大致如下:

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

然后它列出了一大堆依赖项,例如:

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

然后它列出了一大堆被排除的依赖项。我认为需要这些依赖项中的一些。我如何让它们包括在内?为什么他们被排除在外?这里发生了什么逻辑?

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
4

0 回答 0