물흐르듯코딩

Could not resolve all files for configuration: 'bootJarMainClassName'. Could not find mysql:mysql-connector-java 빌드 오류 해결 본문

BE

Could not resolve all files for configuration: 'bootJarMainClassName'. Could not find mysql:mysql-connector-java 빌드 오류 해결

AquaDev 2024. 5. 2. 15:11

 

 

 

스프링 부트 버전을 2.7.12로 업데이트 후 빌드 할 때 아래와 같은 오류가 반복적으로 나타났다.

Execution failed for task ':common-config:bootJarMainClassName'.

> Could not resolve all files for configuration ':common-config:runtimeClasspath'.
  > Could not find mysql:mysql-connector-java:.
      Required by:
               project :common-config > project :common-data

 

Could not find mysql:mysql-connector-java ..?

build.grdle에 있는 mysql-connector-java 의존성을 찾지 못하는 듯했다.

spring boot 2.7 Release Note를 찾아 그 원인을 찾을 수 있었다.

 


 

 

2.7.8 이상부턴 mysql-connector-java가 아닌 com.mysql:mysql-connector-j 의존성을 사용한다는 것이었다.

build.grdle runtimeOnly를 수정하여 해당 오류를 해결했다!

 

runtimeOnly 'com.mysql:mysql-connector-j'

 

 

 

 

📜 Spring boot 2.7 Release Notes

https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.7-Release-Notes

 

Spring Boot 2.7 Release Notes

Spring Boot. Contribute to spring-projects/spring-boot development by creating an account on GitHub.

github.com

 


 

🏷 참고

https://luvstudy.tistory.com/221

https://titlejjk.tistory.com/264