我的应用程序取决于外部jar
<dependency>
<groupId>org.objectweb.joram</groupId>
<artifactId>jftp</artifactId>
<version>1.52</version>
</dependency>
我主要感兴趣的是使用以下软件包 import net.sf.jftp.net。*
但看起来这个jar也暴露了org.apache.log4j包中的某些类,导致在将应用程序war文件部署到tomcat时出现以下异常
java.lang.SecurityException:class“org.apache.log4j.PropertyConfigurator”的签名者信息与同一包中其他类的签名者信息不匹配
有什么方法可以避免错误吗?
答案 0 :(得分:1)
首先你可以使用
mvn dependency:tree
以确切了解jftp加载了哪些依赖项。然后,排除那些你不想要的东西:
<dependency>
<groupId>org.objectweb.joram</groupId>
<artifactId>jftp</artifactId>
<version>1.52</version>
<exclusions>
<exclusion> <!-- declare the exclusion here -->
<groupId>sample.ProjectB</groupId>
<artifactId>Project-B</artifactId>
</exclusion>
</exclusions>
</dependency>