<dependency>
<groupId>mygroup</groupId>
<artifactId>myartifact</artifactId>
<version>1.0.0</version>
<exclusions>
<!--The jdbc driver causes hot-deployment issues-->
<exclusion>
<groupId>db.drivers</groupId>
<artifactId>jdbc</artifactId>
</exclusion>
</exclusions>
</dependency>
I have a maven POM file for a web service. For one of the dependencies I have to specify several exclusions for jar files that are already kept at a
higher-level in the web-application server (accessible to all web-applications, not just this particular one). One example of such exclusion is the JAR containing my JDBC driver.
Maven dependency exclusion for War file, but inclusion for tests Maven去除依赖影响
本文详细介绍了如何在Maven POM文件中配置依赖排除,特别针对已存在于较高层级web应用服务器中的jar文件进行排除,以解决冲突问题。以JDBC驱动为例,解释了如何在特定依赖下实现排除。

被折叠的 条评论
为什么被折叠?



