本案例以 springboot 3.1.12 版本為例
<parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>3.1.12</version><relativePath/> </parent>
點擊?spring-boot-starter-parent 進入 spring-boot-starter-parent-3.1.12.pom?
點擊 spring-boot-dependencies 進入 spring-boot-dependencies-3.1.12.pom
在??spring-boot-dependencies-3.1.12.pom 搜索 mysql
得知該版本匹配的驅動為 8.0.33
坐標依賴為
即在springboot 的 pom 中 引入如下依賴即可 自動匹配 mysql 驅動版本
<dependency><groupId>com.mysql</groupId><artifactId>mysql-connector-j</artifactId>
</dependency>
?