我正在使用旧版Spring应用程序,并且想要迁移到Spring Boot。我的意图是使用spring-boot-starter-data-jpa
。因此,我在pom.xml
(管理所有spring-boot-dependencies
)中添加了以下部分:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.3.RELEASE</version>
</parent>
但这搞砸了我需要暂时保留的某些依赖项。我目前正在使用Selenium依赖项(版本
2.53.0
;从另一个项目中过渡添加),但是spring-boot正在获取3.9.1
的依赖项。我想排除
3.9.1
依赖关系,但exclusion
过滤器无法按预期工作。总结一下,我想使用
spring-boot-starter-parent
和spring-boot-starter-data-jpa
,而不要使用selenium-java
中的托管spring-boot-dependencies
。感谢这方面的帮助。
最佳答案
而不是弄乱<excludes>
,然后尝试弄清楚您需要再次包含什么(在弄清楚被排除的内容之后)。只需按照here in the Spring Boot Reference Guide解释覆盖版本即可。
假设您使用spring-boot-starter-parent
作为父项,则只需将<selenium.version>
添加到<properties>
部分以指定所需的版本。
<properties>
<selenium.version>2.53.0</selenium.version>
</properties>
这将使Spring Boot使用所需的版本。