공부하면서/spring boot

[Spring Boot / JPA] Gradle plugin 에러

코린영이 2024. 2. 9. 00:48
728x90
반응형

 

목차

1. 에러

2. 해결 방법

3. 참고사이트

 

 

1. 에러

오류,., vscode에서는 build가 되는데,., 왜!! intelliJ에서는 gradle 오류가 나냐고!!!

 

 

A problem occurred configuring root project 'magicard'.
> Could not resolve all files for configuration ':classpath'.
   > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.1.8.
     Required by:
         project : > org.springframework.boot:org.springframework.boot.gradle.plugin:3.1.8
      > No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.1.8 was found. The consumer was configured to find a library for use during runtime, compatible with Java 11, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.5' but:
          - Variant 'apiElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.1.8 declares a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component for use during compile-time, compatible with Java 17 and the consumer needed a component for use during runtime, compatible with Java 11
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.5')
          - Variant 'javadocElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.1.8 declares a component for use during runtime, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java version (required compatibility with Java 11)
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.5')
          - Variant 'mavenOptionalApiElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.1.8 declares a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component for use during compile-time, compatible with Java 17 and the consumer needed a component for use during runtime, compatible with Java 11
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.5')
          - Variant 'mavenOptionalRuntimeElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.1.8 declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component, compatible with Java 17 and the consumer needed a component, compatible with Java 11
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.5')
          - Variant 'runtimeElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.1.8 declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component, compatible with Java 17 and the consumer needed a component, compatible with Java 11
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.5')
          - Variant 'sourcesElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.1.8 declares a component for use during runtime, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java version (required compatibility with Java 11)
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.5')

* Try:
> 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.

* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'magicard'.



Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.1.8.
Required by:
    project : > org.springframework.boot:org.springframework.boot.gradle.plugin:3.1.8
Caused by: org.gradle.internal.component.NoMatchingGraphVariantsException: No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.1.8 was found. The consumer was configured to find a library for use during runtime, compatible with Java 11, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.5' but:
  - Variant 'apiElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.1.8 declares a library, packaged as a jar, and its dependencies declared externally:
      - Incompatible because this component declares a component for use during compile-time, compatible with Java 17 and the consumer needed a component for use during runtime, compatible with Java 11
      - Other compatible attribute:
          - Doesn't say anything about org.gradle.plugin.api-version (required '8.5')
  - Variant 'javadocElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.1.8 declares a component for use during runtime, and its dependencies declared externally:
      - Incompatible because this component declares documentation and the consumer needed a library
      - Other compatible attributes:
          - Doesn't say anything about its target Java version (required compatibility with Java 11)
          - Doesn't say anything about its elements (required them packaged as a jar)
          - Doesn't say anything about org.gradle.plugin.api-version (required '8.5')
  - Variant 'mavenOptionalApiElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.1.8 declares a library, packaged as a jar, and its dependencies declared externally:
      - Incompatible because this component declares a component for use during compile-time, compatible with Java 17 and the consumer needed a component for use during runtime, compatible with Java 11
      - Other compatible attribute:
          - Doesn't say anything about org.gradle.plugin.api-version (required '8.5')
  - Variant 'mavenOptionalRuntimeElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.1.8 declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:
      - Incompatible because this component declares a component, compatible with Java 17 and the consumer needed a component, compatible with Java 11
      - Other compatible attribute:
          - Doesn't say anything about org.gradle.plugin.api-version (required '8.5')
  - Variant 'runtimeElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.1.8 declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:
      - Incompatible because this component declares a component, compatible with Java 17 and the consumer needed a component, compatible with Java 11
      - Other compatible attribute:
          - Doesn't say anything about org.gradle.plugin.api-version (required '8.5')
  - Variant 'sourcesElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.1.8 declares a component for use during runtime, and its dependencies declared externally:
      - Incompatible because this component declares documentation and the consumer needed a library
      - Other compatible attributes:
          - Doesn't say anything about its target Java version (required compatibility with Java 11)
          - Doesn't say anything about its elements (required them packaged as a jar)
          - Doesn't say anything about org.gradle.plugin.api-version (required '8.5')

 

 

 

2. 해결 방법

왜 오류가 났을까,,,

다른게 없는 것 같은데!!!..!!! 

 

환경 설정에서 자바 버전 바꾸고

git clone 다시하고 

해결 완,,!

 

인줄 알았건만!!!

vscode에서는 완~~전 잘 작동하구옇ㅎㅎ

 

intelliJ에서만 에러가 뜨네여,,! 이게 머선일이야

intelliJ에서만 문제가 생겨서 이건!! 백퍼센트 설정파일 문제다!! 하고

intelliJ 에서 gradle이 안먹힐 때를 검색해봤더니 역시!! 정보의 바다 구글!!ㅋㅋㅋㅋ

 

 

.idea 파일 삭제하고!! 절대로 intelliJ로 프로젝트 열지 말구!

build.gradle 파일을 직접 intelliJ를 통해 실행해주어야 한다!! 

그럼 다시 쫘르르르륽 다시 빌드되면서 정상 작동하는 것을 볼 수 있다ㅜㅠ

 

 

몇 시간동안 계에속 프로젝트 삭제하고 다시 clone하고 정말 심적으로 고통스러웠는데ㅜㅜ

해결돼서 완전 다행이다ㅜㅜ

 

에러코드를 다시 보니,, 계속해서 나 gradle쪽에 문제 있어!! 확인해줘!! 이러고 있는데,, ㅎ

계속 눈 감고 있었네,,ㅋㅋㅋㅋㅋㅋㅋ쩝

 

오늘의 교훈! 에러 확인 잘하자!!

 

 

참고사이트

오늘도 지피티 선생님과 뤼튼 선생님의 도움을 받았다..!

https://wrtn.ai/

 

뤼튼

모두를 위한 AI 포털 뤼튼. AI 채팅부터 이미지 생성, 나만의 AI 제작까지, 언제 어디서나 생성형 AI와 함께하세요.

wrtn.ai

https://chat.openai.com/

https://ksabs.tistory.com/184

 

[IntelliJ] Gradle 프로젝트 불러올때 에러해결

에러상황 가끔씩 IntelliJ에서 기존의 프로젝트를 불러올때 spring boot annotation들이 적용이 안되고 빨간불이 들어올 때가 있습니다. 해결하고나서 포스팅하는거라 적용이 안됐을 때의 자료화면이

ksabs.tistory.com

 

728x90
반응형