Maven的依赖收敛错误

时间:2017-07-31 12:00:22

标签: java maven dropwizard

我正在尝试使用DropWizard为NLP库(Illinois NER tagger)创建REST api服务器。以下是我的<repositories> <repository> <id>sonatype-nexus-snapshots</id> <name>Sonatype Nexus Snapshots</name> <url>http://oss.sonatype.org/content/repositories/snapshots</url> </repository> <repository> <id>CogcompSoftware</id> <name>CogcompSoftware</name> <url>http://cogcomp.cs.illinois.edu/m2repo/</url> </repository> </repositories> <dependencyManagement> <dependencies> <dependency> <groupId>io.dropwizard</groupId> <artifactId>dropwizard-bom</artifactId> <version>${project.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>edu.illinois.cs.cogcomp</groupId> <artifactId>illinois-ner</artifactId> <version>3.0.72</version> </dependency> <dependency> <groupId>io.dropwizard</groupId> <artifactId>dropwizard-core</artifactId> <version>1.1.2</version> </dependency> <dependency> <groupId>io.dropwizard</groupId> <artifactId>dropwizard-http2</artifactId> <version>1.1.2</version> </dependency> <dependency> <groupId>io.dropwizard</groupId> <artifactId>dropwizard-hibernate</artifactId> <version>1.1.2</version> </dependency> <dependency> <groupId>io.dropwizard</groupId> <artifactId>dropwizard-metrics-graphite</artifactId> <version>1.1.2</version> </dependency> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <version>1.4.196</version> </dependency> </dependencies> 文件的内容:

mvn package

在添加与Illinois库对应的依赖关系标记和存储库标记时,我的代码崩溃并在[INFO] [INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce) @ dropwizard-example --- [WARNING] Dependency convergence error for edu.illinois.cs.cogcomp:illinois-core-utilities:3.0.72 paths to dependency are: +-io.dropwizard:dropwizard-example:1.2.0-SNAPSHOT +-edu.illinois.cs.cogcomp:illinois-ner:3.0.72 +-edu.illinois.cs.cogcomp:illinois-tokenizer:3.0.72 +-edu.illinois.cs.cogcomp:illinois-core-utilities:3.0.72 and +-io.dropwizard:dropwizard-example:1.2.0-SNAPSHOT +-edu.illinois.cs.cogcomp:illinois-ner:3.0.72 +-edu.illinois.cs.cogcomp:illinois-core-utilities:3.0.72 and +-io.dropwizard:dropwizard-example:1.2.0-SNAPSHOT +-edu.illinois.cs.cogcomp:illinois-ner:3.0.72 +-edu.illinois.cs.cogcomp:LBJava:1.2.24 +-edu.illinois.cs.cogcomp:illinois-inference:0.6.0 +-edu.illinois.cs.cogcomp:illinois-core-utilities:3.0.51 and +-io.dropwizard:dropwizard-example:1.2.0-SNAPSHOT +-edu.illinois.cs.cogcomp:illinois-ner:3.0.72 +-edu.illinois.cs.cogcomp:LBJava:1.2.24 +-edu.illinois.cs.cogcomp:illinois-inference:0.6.0 +-edu.illinois.cs.cogcomp:illinois-sl-core:1.0.2 +-edu.illinois.cs.cogcomp:illinois-core-utilities:3.0.22 and +-io.dropwizard:dropwizard-example:1.2.0-SNAPSHOT +-edu.illinois.cs.cogcomp:illinois-ner:3.0.72 +-edu.illinois.cs.cogcomp:LBJava-NLP-tools:1.0.1 +-edu.illinois.cs.cogcomp:illinois-core-utilities:1.2.11 [WARNING] Dependency convergence error for edu.illinois.cs.cogcomp:LBJava:1.2.24 paths to dependency are: +-io.dropwizard:dropwizard-example:1.2.0-SNAPSHOT +-edu.illinois.cs.cogcomp:illinois-ner:3.0.72 +-edu.illinois.cs.cogcomp:LBJava:1.2.24 and +-io.dropwizard:dropwizard-example:1.2.0-SNAPSHOT +-edu.illinois.cs.cogcomp:illinois-ner:3.0.72 +-edu.illinois.cs.cogcomp:LBJava-NLP-tools:1.0.1 +-edu.illinois.cs.cogcomp:LBJava:1.1.0 [WARNING] Rule 0: org.apache.maven.plugins.enforcer.DependencyConvergence failed with message: Failed while enforcing releasability the error(s) are [ Dependency convergence error for edu.illinois.cs.cogcomp:illinois-core-utilities:3.0.72 paths to dependency are: +-io.dropwizard:dropwizard-example:1.2.0-SNAPSHOT +-edu.illinois.cs.cogcomp:illinois-ner:3.0.72 +-edu.illinois.cs.cogcomp:illinois-tokenizer:3.0.72 +-edu.illinois.cs.cogcomp:illinois-core-utilities:3.0.72 and +-io.dropwizard:dropwizard-example:1.2.0-SNAPSHOT +-edu.illinois.cs.cogcomp:illinois-ner:3.0.72 +-edu.illinois.cs.cogcomp:illinois-core-utilities:3.0.72 and +-io.dropwizard:dropwizard-example:1.2.0-SNAPSHOT +-edu.illinois.cs.cogcomp:illinois-ner:3.0.72 +-edu.illinois.cs.cogcomp:LBJava:1.2.24 +-edu.illinois.cs.cogcomp:illinois-inference:0.6.0 +-edu.illinois.cs.cogcomp:illinois-core-utilities:3.0.51 and +-io.dropwizard:dropwizard-example:1.2.0-SNAPSHOT +-edu.illinois.cs.cogcomp:illinois-ner:3.0.72 +-edu.illinois.cs.cogcomp:LBJava:1.2.24 +-edu.illinois.cs.cogcomp:illinois-inference:0.6.0 +-edu.illinois.cs.cogcomp:illinois-sl-core:1.0.2 +-edu.illinois.cs.cogcomp:illinois-core-utilities:3.0.22 and +-io.dropwizard:dropwizard-example:1.2.0-SNAPSHOT +-edu.illinois.cs.cogcomp:illinois-ner:3.0.72 +-edu.illinois.cs.cogcomp:LBJava-NLP-tools:1.0.1 +-edu.illinois.cs.cogcomp:illinois-core-utilities:1.2.11 , Dependency convergence error for edu.illinois.cs.cogcomp:LBJava:1.2.24 paths to dependency are: +-io.dropwizard:dropwizard-example:1.2.0-SNAPSHOT +-edu.illinois.cs.cogcomp:illinois-ner:3.0.72 +-edu.illinois.cs.cogcomp:LBJava:1.2.24 and +-io.dropwizard:dropwizard-example:1.2.0-SNAPSHOT +-edu.illinois.cs.cogcomp:illinois-ner:3.0.72 +-edu.illinois.cs.cogcomp:LBJava-NLP-tools:1.0.1 +-edu.illinois.cs.cogcomp:LBJava:1.1.0 ] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 38.047 s [INFO] Finished at: 2017-07-31T16:36:33+05:30 [INFO] Final Memory: 27M/1517M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce (enforce) on project dropwizard-example: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [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] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

上显示以下错误
gpg

请帮我解决此错误。

1 个答案:

答案 0 :(得分:1)

要解决此错误,您需要在dependencyManagement部分中管理冲突工件的版本。

例如:要解决edu.illinois.cs.cogcomp:illinois-core-utilities的问题,您需要输入类似

的条目
<dependency>
   <groupId>edu.illinois.cs.cogcomp</groupId>
   <artifactId>illinois-core-utilities</artifactId>
   <version>3.0.72</version>
</dependency>
你的dependencyManagement部分中的