Spring Boot 프로젝트 실행 오류: Execution failed for task 해결 하기

2025. 2. 4. 04:19·🕵️에러 해결사

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 설정 변경 방법

  1. File → Settings (Ctrl + Alt + S)로 이동
  2. Build, Execution, Deployment → Build Tools → Gradle 선택
  3. Build and run using을 Gradle → IntelliJ IDEA로 변경
  4. Run tests using도 Gradle → IntelliJ IDEA로 변경
  5. Apply → OK 버튼 클릭
  6. 프로젝트를 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
'🕵️에러 해결사' 카테고리의 다른 글
  • "detail": "Given token not valid for any token type" 토큰 인증 오류 해결
  • [Error]Id returned 1 exits status 에러 해결하기 (Dev C++)
  • Spring Boot 프로젝트 실행 오류: Could not resolve all dependencies 해결하기
  • AttributeError : Invalid API setting: 'JWT_PAYLOAD_HANDLER' 해결하기
고딩코난
고딩코난
godingconan 님의 블로그 입니다.
  • 고딩코난
    코딩의 고난
    고딩코난
  • 전체
    오늘
    어제
    • 분류 전체보기 (16)
      • 🔰프레임워크 (0)
        • 🧩Spring (0)
        • 🥭Django (0)
      • 📓프로그래밍 언어 (0)
        • 🍵Java (0)
        • 🐍Python (0)
      • 🖥️CS (0)
        • 분산 시스템 (0)
      • 🔓알고리즘 (2)
        • 🌿백준 (2)
      • 🎞️프로젝트 (0)
      • 💸도전! 수익 창출 (0)
      • 🔖Lesson Learned (2)
      • 🕵️에러 해결사 (7)
      • 🌐Web (1)
      • 🔧Git&Github (2)
      • 🛡️Cloud (2)
        • 📡AWS (1)
        • NCP (1)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    정보처리기사 필기
    1764
    UDP
    꿀팁
    TCP
    알고리즘
    버전 오류
    백준
    네트워크
    C++
    프로젝트 생성
    종료 에러
    IP
    합격
    Spring
    프로토콜
    spring 프로젝트
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
고딩코난
Spring Boot 프로젝트 실행 오류: Execution failed for task 해결 하기
상단으로

티스토리툴바