Spring Boot 2.0.0 , DataSourceBuilder not found in autoconfigure jar

22.9k Views Asked by At

We are upgrading our existing Spring Boot (1.5) application to 2.0.0.

We connect with multiple databases and use the org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder class.

I added the dependency:

compile group: 'org.springframework.boot',
name: 'spring-boot-autoconfigure',
version: '2.0.0.RELEASE' 

However, I am not able to compile the project: This class (DataSourceBuilder) does not exist in the 2.0.0 version jar.

In order to rule out gradle issues, I manually downloaded the jar and added it to the classpath. This class does not exist in the version.

Also extracted and searched the jar but this class is missing. Can anyone help me resolve it?

2

There are 2 best solutions below

0
On BEST ANSWER

The class was moved to another package. Its FQN is now org.springframework.boot.jdbc.DataSourceBuilder: https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/jdbc/DataSourceBuilder.html

0
On

Old class (Spring Boot 1.x)

org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder

New class (Spring Boot 2.x)

import org.springframework.boot.jdbc.DataSourceBuilder;