我想为Java8使用最新的assertj-core(例如断言选项)。 我使用spring-boot-starter-test 1.4.1它带有assertj 2.5.0预配置。弹簧启动启动器测试1.4.1 - 使用assertj-core 3.5.x
我不能使用弹簧启动父POM。
如何设置我的maven项目,所以我排除或用3.5.2覆盖版本2.5.0?我试图
- 设置只是财产
assertj.version
- 在
spring-boot-dependencies
更新的starter-test dependency
我设立一个自定义的 “测试”模块用于我的多模块项目中的所有模块。我不仅需要spring-test-starter,还需要一些其他的依赖和一些测试类和规则。
这是我的项目的样子:
my-module-root
|-my-module-a (using test)
|-my-module-b (using test)
\-test (including starter-test, ... - in COMPILE scope (because this is a test library))
现在,当我排除测试模块上assertj核心(和包括3.5.2),用于测试模块的依赖性都OK。 但是当我检查根级别上的依赖关系时,我在类路径中同时拥有了assertj-core-2.5.0和assertj-core-3.5.2。
做模块A和B包括在“测试模块测试“ 范围?。除了“测试”模块,你确定你没有包含任何spring-boot-starter-test吗? –
是的,是的。双重检查。我将在github上创建一个小样本来验证... –