1

我无法构建 nosqlunit-mongodb 项目。编译项目给了我以下例外。请帮助我理解这个例外是什么以及如何克服它。

刚刚开始使用 nosqlunit 和 mongodb。请耐心等待我的幼稚问题。

user@host:nosqlunit-mongodb mvn compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building nosqlunit-mongodb 0.7.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: <http s>:/oss.sonatype.org/content/repositories/snapshots/com/lordofthejars/nosqlunit-core/0.7.1-SNAPSHOT/maven-metadata.xml
[WARNING] Could not transfer metadata com.lordofthejars:nosqlunit-core:0.7.1-SNAPSHOT/maven-metadata.xml from/to sonatype-nexus-snapshots (http s:/oss.sonatype.org/content/repositories/snapshots): java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
[WARNING] Failure to transfer com.lordofthejars:nosqlunit-core:0.7.1-SNAPSHOT/maven-metadata.xml from https:/oss.sonatype.org/content/repositories/snapshots was cached in the local repository, resolution will not be reattempted until the update interval of sonatype-nexus-snapshots has elapsed or updates are forced. Original error: Could not transfer metadata com.lordofthejars:nosqlunit-core:0.7.1-SNAPSHOT/maven-metadata.xml from/to sonatype-nexus-snapshots (https:/oss.sonatype.org/content/repositories/snapshots): java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
Downloading: http s:/oss.sonatype.org/content/repositories/snapshots/com/lordofthejars/nosqlunit-core/0.7.1-SNAPSHOT/nosqlunit-core-0.7.1-SNAPSHOT.pom
Downloading: http s:/oss.sonatype.org/content/repositories/snapshots/com/lordofthejars/nosqlunit-mongodb/0.7.1-SNAPSHOT/maven-metadata.xml
[WARNING] Could not transfer metadata com.lordofthejars:nosqlunit-mongodb:0.7.1-SNAPSHOT/maven-metadata.xml from/to sonatype-nexus-snapshots (http s:/oss.sonatype.org/content/repositories/snapshots): java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.360s
[INFO] Finished at: Mon Dec 10 06:17:30 PST 2012
[INFO] Final Memory: 140M/698M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project nosqlunit-mongodb: Could not resolve dependencies for project com.lordofthejars:nosqlunit-mongodb:jar:0.7.1-SNAPSHOT: Failed to collect dependencies for [com.lordofthejars:nosqlunit-core:jar:0.7.1-SNAPSHOT (compile), org.mongodb:mongo-java-driver:jar:2.7.3 (compile), com.lordofthejars:nosqlunit-mongodb:jar:0.7.1-SNAPSHOT (compile), jmockmongo:jmockmongo:jar:0.0.2 (compile), junit:junit:jar:4.11 (provided), org.hamcrest:hamcrest-core:jar:1.3 (compile), org.hamcrest:hamcrest-library:jar:1.3 (compile), org.mockito:mockito-all:jar:1.9.0 (test), org.slf4j:slf4j-api:jar:1.6.4 (compile)]: Failed to read artifact descriptor for com.lordofthejars:nosqlunit-core:jar:0.7.1-SNAPSHOT: Could not transfer artifact com.lordofthejars:nosqlunit-core:pom:0.7.1-SNAPSHOT from/to sonatype-nexus-snapshots (https:/oss.sonatype.org/content/repositories/snapshots): java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] htt p: /cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
4

1 回答 1

2

您正在尝试仅编译 nosqlunit-mongodb,因此 Maven 尝试从http://repo.maven.apache.org/maven2检索com.lordofthejars:nosqlunit-core:jar:0.7.1-SNAPSHOT但它不存在那里。

在项目根目录中运行mvn compile以编译所有模块(包括 nosqlunit-core),它应该可以工作。

于 2015-02-05T09:16:15.390 回答