我无法构建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

最佳答案

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

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

关于java - 无法构建nosqlunit-mongodb项目,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/13803281/

10-10 00:53