Reputation: 411
I'm not an expert about versions of spring boot starters and have faced with problem. I'm trying build my project with this spring boot starter. And I need the embedded libraries version to be 5.2.0 as it says in description of this jar file. But when I added this dependency into my project I found that embedded libraries versions are different that I expected. My maven plugins shows that versions 5.1.6 and my code doesn't compile because some classes depend on methods from 5.2.0 module.
And there is one more thing. In another project I added the same dependency. But it's ok, versions are the same with description from maven repositoty. There is difference between these two project. One of them with spring-boot version 2.1.9 (which not compiles) and another - 2.3.4 (whihk works good). And when I checked versions of containing into starter libraries via artefactId in pom - they are ok and 5.2.0.
Here pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>adapters</artifactId>
<groupId>com.alarislabs</groupId>
<version>0.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>security</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
<version>2.2.0.RELEASE</version>
</dependency>
</dependencies>
I've tried to delete m2 repo with all maven dependencies and then download again but I still have problem. I've made a mistake in pom.xml? Maybe is something wrong with my IntelliJ?
Upvotes: 3
Views: 17948
Reputation: 25174
Spring Boot manages several dependencies versions so that we can ensure they are compatible with each other.
Look at this pom.xml file to see which dependencies version are managed by Spring Boot 2.3.4.RELEASE. You can change the version number and see the managed dependencies in that version.
Benefits:
How to solve your problem:
In your pom.xml, you don't need to specify the version for spring-boot-starter-oauth2-resource-server
. This library is managed by spring boot. It looks you are specifying version 2.2.0 which is not compatible with your spring boot version 2.1.9.
Upvotes: 3