当我尝试构建应用程序时,由于我是Maven的新手,所以我遇到以下错误:我不完全了解导致构建失败的问题所在。
以下是针对构建失败而打印的日志消息:
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.DependencyConvergence failed with message:
Failed while enforcing releasability the error(s) are [
Dependency convergence error for org.apache.ant:ant-launcher:1.8.2 paths to dependency are:
+-com.srik.prjt.all:abcd:1.1.0-10.0.0-SNAPSHOT
+-com.srik.prjt.src:cug-core:9.5.0-10.0.0-20190918.213714-17
+-org.apache.ant:ant:1.8.2
+-org.apache.ant:ant-launcher:1.8.2
and
+-com.srik.prjt.all:abcd:1.1.0-10.0.0-SNAPSHOT
+-com.srik.prjt.src:cug-core:9.5.0-10.0.0-20190918.213714-17
+-org.apache.ant:ant-launcher:1.9.4
and
+-com.srik.prjt.all:abcd:1.1.0-10.0.0-SNAPSHOT
+-com.srik.prjt.src:cug-abcd:9.5.0-10.0.0-20190918.213740-11
+-org.apache.ant:ant-launcher:1.9.4
,
Dependency convergence error for com.google.guava:guava:r09 paths to dependency are:
+-com.srik.prjt.all:abcd:1.1.0-10.0.0-SNAPSHOT
+-com.srik.prjt.src:cug-core:9.5.0-10.0.0-20190918.213714-17
+-com.googlecode.ehcache-spring-annotations:ehcache-spring-annotations:1.2.0
+-com.google.guava:guava:r09
and
+-com.srik.prjt.all:abcd:1.1.0-10.0.0-SNAPSHOT
+-com.srik.prjt.src:cug-core:9.5.0-10.0.0-20190918.213714-17
+-com.google.guava:guava:18.0
,
Dependency convergence error for org.owasp.antisamy:antisamy:1.5.3 paths to dependency are:
+-com.srik.prjt.all:abcd:1.1.0-10.0.0-SNAPSHOT
+-com.srik.prjt.src:cug-core:9.5.0-10.0.0-20190918.213714-17
+-org.owasp.esapi:esapi:2.1.0.1
+-org.owasp.antisamy:antisamy:1.5.3
and
+-com.srik.prjt.all:abcd:1.1.0-10.0.0-SNAPSHOT
+-com.srik.prjt.src:cug-core:9.5.0-10.0.0-20190918.213714-17
+-org.owasp.antisamy:antisamy:1.5.8
,
Dependency convergence error for org.apache.httpcomponents:httpcore:4.4.4 paths to dependency are:
+-com.srik.prjt.all:abcd:1.1.0-10.0.0-SNAPSHOT
+-com.srik.prjt.src:cug-core:9.5.0-10.0.0-20190918.213714-17
+-org.apache.httpcomponents:httpclient:4.5.2
+-org.apache.httpcomponents:httpcore:4.4.4
and
+-com.srik.prjt.all:abcd:1.1.0-10.0.0-SNAPSHOT
+-com.srik.prjt.src:cug-core:9.5.0-10.0.0-20190918.213714-17
+-org.apache.httpcomponents:httpcore:4.4.5
,
Dependency convergence error for xml-apis:xml-apis:1.3.03 paths to dependency are:
+-com.srik.prjt.all:abcd:1.1.0-10.0.0-SNAPSHOT
+-com.srik.prjt.src:cug-core:9.5.0-10.0.0-20190918.213714-17
+-com.io7m.xom:xom:1.2.10
+-xml-apis:xml-apis:1.3.03
and
+-com.srik.prjt.all:abcd:1.1.0-10.0.0-SNAPSHOT
+-com.srik.prjt.src:cug-core:9.5.0-10.0.0-20190918.213714-17
+-xerces:xercesImpl:2.9.1
+-xml-apis:xml-apis:1.3.04
and
+-com.srik.prjt.all:abcd:1.1.0-10.0.0-SNAPSHOT
+-com.srik.prjt.src:cug-core:9.5.0-10.0.0-20190918.213714-17
+-xalan:xalan:2.7.0
+-xml-apis:xml-apis:1.0.b2
]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.163 s
[INFO] Finished at: 2019-09-19T15:40:00+05:30
[INFO] Final Memory: 18M/156M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce (enforce-dependency-convergence) on project abcd: 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
请告诉我是否需要其他详细信息。
使用的Ant版本:apache-ant-1.10.3
使用的Maven版本:apache-maven-3.2.1
在构建失败的子Pom上执行编辑:
依赖性管理标记之间的是:
<dependency>
<groupId>com.srik.prjt.src</groupId>
<artifactId>cug-core</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.ant</groupId>
<artifactId>ant-launcher</artifactId>
</exclusion>
</exclusions>
<scope>${framework.scope}</scope>
</dependency>
<dependency>
<groupId>com.srik.prjt.src</groupId>
<artifactId>cug-abcd</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.ant</groupId>
<artifactId>ant-launcher</artifactId>
</exclusion>
</exclusions>
</dependency>
答案 0 :(得分:0)
您(或您的父POM)激活了依赖性收敛实施器规则。如果在传递依赖关系树中具有相同工件的不同版本,则此规则将使构建失败。
通过将适当的条目添加到POM的<dependencyManagement>
部分中(对于具有不同条目的工件),可以停用执行者规则或解决收敛问题。