我面临着我的项目可能与我的依赖所依赖的commons-io之间的冲突。
详细地说,在我当前的maven依赖设置中,我收到了核心模块中抛出的以下异常:
引起:java.lang.SecurityException:class" org.apache.commons.io.IOUtils"的签名者信息与同一包中其他类的签名者信息不匹配
所以我检查了我项目的依赖树。以下是输出。
注意: Web应用程序模块依赖于核心模块,而核心模块具有依赖于 ESB common 模块
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] tempProject
[INFO] tempProject and ESB common classes
[INFO] tempProject Core
[INFO] tempProject Web Application
[INFO] tempProject EAR
[INFO] tempProject Jobs
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building tempProject 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ tempProject ---
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building tempProject and ESB common classes 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ tempProject-lib ---
[INFO] mypackage.tempProject:tempProject-lib:jar:1.0-SNAPSHOT
[INFO] +- org.apache.axis2:axis2-transport-http:jar:1.5:compile
[INFO] | +- org.apache.axis2:axis2-kernel:jar:1.5:compile
[INFO] | | \- (commons-io:commons-io:jar:2.4:compile - version managed from 1.4; omitted for duplicate)
[INFO] | \- commons-io:commons-io:jar:2.4:compile
[INFO] +- org.apache.axis2:axis2-transport-local:jar:1.5:compile
[INFO] | \- (commons-io:commons-io:jar:2.4:compile - version managed from 1.4; omitted for duplicate)
[INFO] \- org.apache.axis2:axis2-jaxws-mar:pom:1.5:compile
[INFO] +- org.apache.axis2:axis2-jaxws:jar:1.5:compile
[INFO] | +- org.apache.axis2:axis2-saaj:jar:1.5:compile
[INFO] | | \- (commons-io:commons-io:jar:2.4:compile - version managed from 1.4; omitted for duplicate)
[INFO] | +- org.apache.axis2:axis2-metadata:jar:1.5:compile
[INFO] | | \- (commons-io:commons-io:jar:2.4:compile - version managed from 1.4; omitted for duplicate)
[INFO] | \- (commons-io:commons-io:jar:2.4:compile - version managed from 1.4; omitted for duplicate)
[INFO] \- (commons-io:commons-io:jar:2.4:compile - version managed from 1.4; omitted for duplicate)
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building tempProject Core 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ tempProject-core ---
[INFO] mypackage.tempProject:tempProject-core:ejb:1.0-SNAPSHOT
[INFO] \- mypackage.tempProject:tempProject-lib:jar:1.0-SNAPSHOT:compile
[INFO] +- org.apache.axis2:axis2-transport-http:jar:1.5:compile
[INFO] | +- org.apache.axis2:axis2-kernel:jar:1.5:compile
[INFO] | | \- (commons-io:commons-io:jar:2.4:compile - version managed from 1.4; omitted for duplicate)
[INFO] | \- commons-io:commons-io:jar:2.4:compile
[INFO] +- org.apache.axis2:axis2-transport-local:jar:1.5:compile
[INFO] | \- (commons-io:commons-io:jar:2.4:compile - version managed from 1.4; omitted for duplicate)
[INFO] \- org.apache.axis2:axis2-jaxws-mar:pom:1.5:compile
[INFO] +- org.apache.axis2:axis2-jaxws:jar:1.5:compile
[INFO] | +- org.apache.axis2:axis2-saaj:jar:1.5:compile
[INFO] | | \- (commons-io:commons-io:jar:2.4:compile - version managed from 1.4; omitted for duplicate)
[INFO] | +- org.apache.axis2:axis2-metadata:jar:1.5:compile
[INFO] | | \- (commons-io:commons-io:jar:2.4:compile - version managed from 1.4; omitted for duplicate)
[INFO] | \- (commons-io:commons-io:jar:2.4:compile - version managed from 1.4; omitted for duplicate)
[INFO] \- (commons-io:commons-io:jar:2.4:compile - version managed from 1.4; omitted for duplicate)
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building tempProject Web Application 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.slf4j:slf4j-api:jar:1.7.7.jbossorg-1 is missing, no dependency information available
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ tempProject-web ---
[WARNING] Missing POM for org.slf4j:slf4j-api:jar:1.7.7.jbossorg-1
[INFO] mypackage.tempProject:tempProject-web:war:1.0-SNAPSHOT
[INFO] +- mypackage.tempProject:tempProject-lib:jar:1.0-SNAPSHOT:provided
[INFO] | +- org.apache.axis2:axis2-transport-http:jar:1.5:provided
[INFO] | | +- org.apache.axis2:axis2-kernel:jar:1.5:provided
[INFO] | | | \- (commons-io:commons-io:jar:2.4:provided - version managed from 1.4; omitted for duplicate)
[INFO] | | \- (commons-io:commons-io:jar:2.4:provided - version managed from 1.3.2; omitted for duplicate)
[INFO] | +- org.apache.axis2:axis2-transport-local:jar:1.5:provided
[INFO] | | \- (commons-io:commons-io:jar:2.4:provided - version managed from 1.4; omitted for duplicate)
[INFO] | \- org.apache.axis2:axis2-jaxws-mar:pom:1.5:provided
[INFO] | +- org.apache.axis2:axis2-jaxws:jar:1.5:provided
[INFO] | | +- org.apache.axis2:axis2-saaj:jar:1.5:provided
[INFO] | | | \- (commons-io:commons-io:jar:2.4:provided - version managed from 1.4; omitted for duplicate)
[INFO] | | +- org.apache.axis2:axis2-metadata:jar:1.5:provided
[INFO] | | | \- (commons-io:commons-io:jar:2.4:provided - version managed from 1.4; omitted for duplicate)
[INFO] | | \- (commons-io:commons-io:jar:2.4:provided - version managed from 1.4; omitted for duplicate)
[INFO] | \- (commons-io:commons-io:jar:2.4:provided - version managed from 1.4; omitted for duplicate)
[INFO] +- org.apache.struts:struts2-core:jar:2.1.6:compile
[INFO] | \- commons-io:commons-io:jar:2.4:compile
[INFO] \- net.fckeditor:java-core:jar:2.5:runtime
[INFO] \- (commons-io:commons-io:jar:2.4:runtime - version managed from 1.3.2; omitted for duplicate)
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building tempProject EAR 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ tempProject-ear ---
[INFO] mypackage.tempProject:tempProject-ear:ear:1.0-SNAPSHOT
[INFO] \- mypackage.tempProject:tempProject-core:ejb:1.0-SNAPSHOT:compile
[INFO] \- mypackage.tempProject:tempProject-lib:jar:1.0-SNAPSHOT:compile
[INFO] +- org.apache.axis2:axis2-transport-http:jar:1.5:compile
[INFO] | +- org.apache.axis2:axis2-kernel:jar:1.5:compile
[INFO] | | \- (commons-io:commons-io:jar:2.4:compile - version managed from 1.4; omitted for duplicate)
[INFO] | \- commons-io:commons-io:jar:2.4:compile
[INFO] +- org.apache.axis2:axis2-transport-local:jar:1.5:compile
[INFO] | \- (commons-io:commons-io:jar:2.4:compile - version managed from 1.4; omitted for duplicate)
[INFO] \- org.apache.axis2:axis2-jaxws-mar:pom:1.5:compile
[INFO] +- org.apache.axis2:axis2-jaxws:jar:1.5:compile
[INFO] | +- org.apache.axis2:axis2-saaj:jar:1.5:compile
[INFO] | | \- (commons-io:commons-io:jar:2.4:compile - version managed from 1.4; omitted for duplicate)
[INFO] | +- org.apache.axis2:axis2-metadata:jar:1.5:compile
[INFO] | | \- (commons-io:commons-io:jar:2.4:compile - version managed from 1.4; omitted for duplicate)
[INFO] | \- (commons-io:commons-io:jar:2.4:compile - version managed from 1.4; omitted for duplicate)
[INFO] \- (commons-io:commons-io:jar:2.4:compile - version managed from 1.4; omitted for duplicate)
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building tempProject Jobs 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ tempProject-jobs ---
[INFO] mypackage.tempProject:tempProject-jobs:war:1.0-SNAPSHOT
[INFO] \- mypackage.tempProject:tempProject-core:jar:1.0-SNAPSHOT:provided
[INFO] \- mypackage.tempProject:tempProject-lib:jar:1.0-SNAPSHOT:provided
[INFO] +- org.apache.axis2:axis2-transport-http:jar:1.5:provided
[INFO] | +- org.apache.axis2:axis2-kernel:jar:1.5:provided
[INFO] | | \- (commons-io:commons-io:jar:2.4:provided - version managed from 1.4; omitted for duplicate)
[INFO] | \- commons-io:commons-io:jar:2.4:provided
[INFO] +- org.apache.axis2:axis2-transport-local:jar:1.5:provided
[INFO] | \- (commons-io:commons-io:jar:2.4:provided - version managed from 1.4; omitted for duplicate)
[INFO] \- org.apache.axis2:axis2-jaxws-mar:pom:1.5:provided
[INFO] +- org.apache.axis2:axis2-jaxws:jar:1.5:provided
[INFO] | +- org.apache.axis2:axis2-saaj:jar:1.5:provided
[INFO] | | \- (commons-io:commons-io:jar:2.4:provided - version managed from 1.4; omitted for duplicate)
[INFO] | +- org.apache.axis2:axis2-metadata:jar:1.5:provided
[INFO] | | \- (commons-io:commons-io:jar:2.4:provided - version managed from 1.4; omitted for duplicate)
[INFO] | \- (commons-io:commons-io:jar:2.4:provided - version managed from 1.4; omitted for duplicate)
[INFO] \- (commons-io:commons-io:jar:2.4:provided - version managed from 1.4; omitted for duplicate)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] tempProject .............................................. SUCCESS [ 6.568 s]
[INFO] tempProject and ESB common classes ....................... SUCCESS [ 1.903 s]
[INFO] tempProject Core ......................................... SUCCESS [ 16.499 s]
[INFO] tempProject Web Application .............................. SUCCESS [ 7.391 s]
[INFO] tempProject EAR .......................................... SUCCESS [ 4.558 s]
[INFO] tempProject Jobs ......................................... SUCCESS [ 3.423 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 41.705 s
[INFO] Finished at: 2017-01-12T10:45:02+02:00
[INFO] Final Memory: 35M/516M
[INFO] ------------------------------------------------------------------------
1)我的第一步是从所有ESB公共依赖项中排除commons-io,这在本模块中无论如何都没有使用。然后我将核心模块包括在提供的commons-io 2.4中(使用Wildlfly 10)。这并没有解决问题。
2)第二次尝试是在我的父pom.xml中添加以下内容
<dependencyManagement>
<dependencies>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
</dependencies>
</dependencyManagement>
通过该更改,我无法部署应用程序,而我收到以下异常
引起:java.lang.NoClassDefFoundError:org / apache / commons / io / FileUtils
3)我在dependencyManagement中尝试了如(2)所示添加类型:pom和scope:import。我再次无法部署我的项目。
有什么建议吗?
注意:Wildfly 10附带commons-io 2.4。