일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- SpringBoot
- 젠킨스
- myBatis
- spring error
- 리액트 캡차
- react 캡차
- Spring Security
- Spring Boot
- 리액트 심플캡차
- 깃
- error
- jpa
- react simple captcha
- 스프링 시큐리티
- Security 로그인
- Docker
- spring security 로그인
- 스프링 시큐리티 로그인
- build
- CI
- react 자동입력방지
- maven
- react captcha
- git
- react 상태
- ChatGPT
- 에러
- react 심플캡차
- 스프링
- REACT
- Today
- Total
I can do it(Feat. DEV)
[Maven]There are test failures(feat. Failed to determine a suitable driver class) 에러 해결 방법 본문
[Maven]There are test failures(feat. Failed to determine a suitable driver class) 에러 해결 방법
까짓거 해보자 개발자 2023. 8. 28. 17:59기존 진행하는 React 프로젝트에 back단으로 Spring Boot를 추가하려고
https://start.spring.io 사이트에서 아래와 같은 설정으로 프로젝트를 생성함.

생성된 프로젝트 zip파일을 풀고 기분 좋게 intelliJ에서 import를 시킴.😁
그리고 메이븐으로 mvn install 명령어를 실행시켰는데..?
에러코드
Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project uis: There are test failures.
Please refer to D:\dev\uis\target\surefire-reports for the individual test results.
...
빌드 중 위와 같은 에러를 나에게 선물해 줌.
처음에는 버전문제인가? 해서 갓글에 검색해 보니
빌드 중에 난 게 아니라 테스트 중에 에러가 났고 해결방법은 아래 사이트를 보면 아시겠지만
pom.xml 파일 > 플러그인 설정에
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
위 코드를 추가하여 테스트 중 에러가 나더라도 무시하고 지나가도록 설정하는 방법을 찾음.
하지만 필자 생각으론 근본적인 에러를 해결한 게 아니라,
테스트 실패를 무시한다는 게 영 찜찜해서 다른 에러를 찾아봄.
에러코드
에러난 커맨드 스크롤을 더 올려보니
java.lang.IllegalStateException: Failed to load ApplicationContext Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean i nstantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested except ion is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdb c.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class Caused by: org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
이러한 에러가 더 있는 걸 발견!🤦♂️
대충 보니 jpa 관련 문제인 듯하지만 일단 갓글에 에러(ailed to determine a suitable driver class)를 검색🔎
이유는 프로젝트 생성 시 JPA, Mybatis Dependency를 추가했었는데 datasource를 설정해주지 않아서 에러가 난 것😅
바로 pom.xml 파일로 가서 mybatis 및 jpa 의존성을 주석처리하고

mvn install 해보니 정상적으로 빌드 및 테스트가 됨!!👍
https://start.spring.io 사이트로 간편하게 프로젝트 생성하고 의존성 추가하는데
미리 막 이것저것 추가하면 안 되겠다는 것을 경험함 끝.🤗
📢참고 사이트
스프링부트 springboot mvn build test error 에러 해결
관련 글의 stackoverflow 링크 https://stackoverflow.com/questions/13170860/failed-to-execute-goal-org-apache-maven-pluginsmaven-surefire-plugin2-10test 링크를 타고 들어가면 다양한 답변이 나온다. 그 중에서 몇가지를 소개한
fors.tistory.com
https://haenny.tistory.com/298
Failed to determine a suitable driver class 오류 해결
오류 로그 ********************************* APPLICATION FAILED TO START ********************************* Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. Reason: Failed to
haenny.tistory.com
'개발자 모드 > 오류처리' 카테고리의 다른 글
[Maven]Blocked mirror for repositories: [...] (0) | 2023.08.29 |
---|---|
[Maven]Fatal error compiling: invalid flag: --release (0) | 2023.08.29 |
[Java/Spring]numbers of source raster bands and source color space components do not match (0) | 2023.08.22 |
[Git] Spring Boot + React 프로젝트 git에 add 안될 때 (0) | 2023.05.04 |
Spring에서 ajax return 404 Error 날 때 (0) | 2023.03.08 |