【发布时间】:2018-10-09 14:16:16
【问题描述】:
我在父 pom 中有以下定义:
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
<version>2.11</version>
<scope>test</scope>
</dependency>
然后在我的孩子 pom 中:
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
</dependency>
我发现当我的 WAR 文件(我的子 pom 中的打包类型)构建时,来自 htmlunit 的传递依赖项包含在 WEB-INF/lib 目录中(特别是 commons-codec)。
我会认为,因为依赖项的范围是“测试”,所以它和它的任何传递依赖项都不应该被打包。我的假设不正确吗?
【问题讨论】: