这是我拥有的 Maven 依赖项
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.10.RELEASE</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
我想要实现的是,将弹簧芯从 4.3.14.RELEASE 更改为 4.3.4.RELEASE。是的,默认情况下,spring boot starter 使用的是 spring core 4.3.14,它可以扩展到 5.0.7.RELEASE,因为我尝试排除 spring-core 并包括 4.3.4.RELEASE
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.10.RELEASE</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
</exclusions>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.3.4.RELEASE</version>
</dependency>
</dependencies>
当我尝试构建它时,会引发以下期望
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration': Unsatisfied dependency expressed through method 'setFilterChainProxySecurityConfigurer' parameter 1; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.convert.support.DefaultConversionService.getSharedInstance()Lorg/springframework/core/convert/ConversionService;
手动添加每个依赖项是不可能的,因为应用程序使用了大量的依赖项,并且与其他依赖项的兼容性将是另一项艰巨的工作。
那么有什么解决方法吗?
注意:- 尝试使用 spring framework-bom 和 spring IO,但没有找到任何解决方案,也许我错过了一些东西。这些例子是受欢迎的。