1. 에러 상황
Spring 프로젝트를 실행하고 종료했을 때, 다음과 같은 에러가 뜨게 되었다.
Execution failed for task ':~~.main()'. > Build cancelled while executing task ':~~.main()' * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. For more on this, please refer to https://docs.gradle.org/8.12.1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. BUILD FAILED in 2m 32s 3 actionable tasks: 3 executed
📌 현상:
- 프로젝트 실행이 실패하고 Build cancelled 메시지가 출력됨
- Gradle 관련 경고가 표시됨
2. 에러 원인
이 오류는 Gradle이 프로젝트 실행을 관리하도록 설정되어 있지만, IntelliJ IDEA와의 호환성 문제로 인해 실행이 중단되었기 때문이다.
🔍 자세한 원인 분석:
- IntelliJ IDEA에서 프로젝트 실행을 Gradle이 담당하도록 설정되어 있음
- Gradle이 :MensaQuizApplication.main()을 실행하는 동안 중단됨
- IntelliJ IDEA 자체에서 실행하면 정상적으로 동작하는 경우가 많음
⚠️ 추가 원인 가능성
- Gradle 버전이 최신 버전(예: 8.x 이상)과 맞지 않는 경우
- Gradle의 일부 기능이 Gradle 9.0에서 제거될 예정이라 비호환성 문제 발생
3. 해결 방법
에러 원인이 복잡해 보이지만, 간단한 설정만으로 해결할 수 있다.
📌 IntelliJ IDEA 설정 변경 방법
- File → Settings (Ctrl + Alt + S)로 이동
- Build, Execution, Deployment → Build Tools → Gradle 선택
- Build and run using을 Gradle → IntelliJ IDEA로 변경
- Run tests using도 Gradle → IntelliJ IDEA로 변경
- Apply → OK 버튼 클릭
- 프로젝트를 Rebuild (Ctrl + F9) 후 실행
이제 종료해도 위와 같은 에러가 뜨지 않고 무사히 종료된다!
'🕵️에러 해결사' 카테고리의 다른 글
| Windows에서 Python 파일 경로 오류 해결하기: 올바른 경로 입력 방법 총정리 (0) | 2025.03.11 |
|---|---|
| "detail": "Given token not valid for any token type" 토큰 인증 오류 해결 (0) | 2025.02.19 |
| [Error]Id returned 1 exits status 에러 해결하기 (Dev C++) (0) | 2025.02.12 |
| Spring Boot 프로젝트 실행 오류: Could not resolve all dependencies 해결하기 (0) | 2025.02.04 |
| AttributeError : Invalid API setting: 'JWT_PAYLOAD_HANDLER' 해결하기 (0) | 2025.01.28 |