For v3.0.2 we can still custom MySQL version by

ext {
  set('mysql.version', '5.1.49')
}

but for version v2.7.8 we can not custom MySQL driver version.

because of the two commits are different https://github.com/spring-projects/spring-boot/commit/1944374c6def752db159a80e767dcd84475147e4 https://github.com/spring-projects/spring-boot/commit/f24afd96854bcf7daafcc87607d60e8b204919a3

Is this difference expected?

Comment From: wilkinsona

Yes, this is expected. The MySQL team took the unusual step of changing the coordinates of the JDBC driver in an 8.0.x maintenance release. In 8.0.31 they published at both the old location (mysql:mysql-connector-java) and at the new location (com.mysql:mysql-connector-j). In 8.0.32 they dropped the old location so the driver is now only published at the new location. https://github.com/spring-projects/spring-boot/commit/f24afd96854bcf7daafcc87607d60e8b204919a3 aligned Spring Boot's dependency management with this change.

If you need to downgrade the driver to a version old than 8.0.31 it is no longer managed by Boot's dependency management and you should declare the dependency with a version, for example:

runtimeOnly("mysql:mysql-connector-java:5.1.49")

Comment From: meiyese

@wilkinsona Thanks for your reply.

Currently the main branch and v3.0.x branch is not aligned, do we need do the same change in the main branch and v3.0.x branch as https://github.com/spring-projects/spring-boot/commit/f24afd96854bcf7daafcc87607d60e8b204919a3 ?

Comment From: wilkinsona

Thank you for spotting the misalignment. I have corrected things in https://github.com/spring-projects/spring-boot/issues/34021.