我正在使用旧版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-parentspring-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使用所需的版本。

10-01 01:24
查看更多