W jendym z projektów próbuję podbić wersję springa do wersji 5.2.20.RELEASE
(ze względu na podatność).
Próbowałem podbić spring boota do wersji 2.5.12
natomiast od razu zauważyłem problemy z kompatybilnością
zależności/bibliotek, błędy w runtime więc uznałem tę zmianę za dużą i zbyt ryzykowną.
Aktualnie aby podbić wersję springa do poma dodałem:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.2.20.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>5.2.20.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>5.2.20.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>5.2.20.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>5.2.20.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.2.20.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-activemq</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</exclusion>
</exclusions>
</dependency>
Maven sypie takimi błędami:
[WARNING]
Dependency convergence error for org.springframework:spring-aop:5.2.20.RELEASE paths to dependency are:
+-myproject:0.0.1-SNAPSHOT
+-org.springframework:spring-aop:5.2.20.RELEASE
and
+-myproject:0.0.1-SNAPSHOT
+-org.springframework:spring-context:5.2.20.RELEASE
+-org.springframework:spring-aop:5.2.7.RELEASE
[WARNING]
Dependency convergence error for org.springframework:spring-core:5.2.20.RELEASE paths to dependency are:
+-myproject:0.0.1-SNAPSHOT
+-org.springframework:spring-core:5.2.20.RELEASE
and
+-myproject:0.0.1-SNAPSHOT
+-org.springframework:spring-web:5.2.20.RELEASE
+-org.springframework:spring-beans:5.2.7.RELEASE
+-org.springframework:spring-core:5.2.7.RELEASE
and
+-myproject:0.0.1-SNAPSHOT
+-org.springframework:spring-web:5.2.20.RELEASE
+-org.springframework:spring-core:5.2.7.RELEASE
and
+-myproject:0.0.1-SNAPSHOT
+-org.springframework:spring-jms:5.2.20.RELEASE
+-org.springframework:spring-core:5.2.7.RELEASE
and
+-myproject:0.0.1-SNAPSHOT
+-org.springframework:spring-jms:5.2.20.RELEASE
+-org.springframework:spring-messaging:5.2.7.RELEASE
+-org.springframework:spring-core:5.2.7.RELEASE
and
+-myproject:0.0.1-SNAPSHOT
+-org.springframework:spring-jms:5.2.20.RELEASE
+-org.springframework:spring-tx:5.2.7.RELEASE
+-org.springframework:spring-core:5.2.7.RELEASE
and
+-myproject:0.0.1-SNAPSHOT
+-org.springframework:spring-aop:5.2.20.RELEASE
+-org.springframework:spring-core:5.2.7.RELEASE
and
+-myproject:0.0.1-SNAPSHOT
+-org.springframework:spring-test:5.2.20.RELEASE
+-org.springframework:spring-core:5.2.7.RELEASE
and
+-myproject:0.0.1-SNAPSHOT
+-org.springframework:spring-context:5.2.20.RELEASE
+-org.springframework:spring-core:5.2.7.RELEASE
and
+-myproject:0.0.1-SNAPSHOT
+-org.springframework:spring-context:5.2.20.RELEASE
+-org.springframework:spring-expression:5.2.7.RELEASE
+-org.springframework:spring-core:5.2.7.RELEASE
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.DependencyConvergence failed with message:
Failed while enforcing releasability. See above detailed error message.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.808 s
[INFO] Finished at: 2022-04-04T18:32:03+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:enforce (enforce) on project partyapi: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Nie rozumiem tego. Przecież jak wejdę do poma to jak wół jest, że np. spring-aop:5.2.20.RELEASE zależy od spring-core:5.2.20.RELEASE a nie od spring-core:5.2.7.RELEASE.
Jak rozwiązać ten problem? A może jest jakiś lepszy sposób na podbicie wersji springa?