• 카테고리

    질문 & 답변
  • 세부 분야

    백엔드

  • 해결 여부

    미해결

maven plugin 에러 해결 도와주세요.

22.03.02 16:05 작성 조회수 1.47k

0

[ERROR] Failed to execute goal io.spring.javaformat:spring-javaformat-maven-plugin:0.0.31:validate (default) on project spring-petclinic: Execution default

 of goal io.spring.javaformat:spring-javaformat-maven-plugin:0.0.31:validate failed: An API incompatibility was encountered while executing io.spring.javaf

ormat:spring-javaformat-maven-plugin:0.0.31:validate: java.lang.UnsupportedClassVersionError: io/spring/javaformat/eclipse/jdt/jdk11/internal/formatter/Def

aultCodeFormatter has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognize

s class file versions up to 52.0

[ERROR] -----------------------------------------------------

[ERROR] realm =    plugin>io.spring.javaformat:spring-javaformat-maven-plugin:0.0.31

[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy

[ERROR] urls[0] = file:/C:/Users/Gunwoo/.m2/repository/io/spring/javaformat/spring-javaformat-maven-plugin/0.0.31/spring-javaformat-maven-plugin-0.0.31.jar

[ERROR] urls[1] = file:/C:/Users/Gunwoo/.m2/repository/io/spring/javaformat/spring-javaformat-formatter/0.0.31/spring-javaformat-formatter-0.0.31.jar

[ERROR] urls[2] = file:/C:/Users/Gunwoo/.m2/repository/io/spring/javaformat/spring-javaformat-config/0.0.31/spring-javaformat-config-0.0.31.jar

[ERROR] urls[3] = file:/C:/Users/Gunwoo/.m2/repository/io/spring/javaformat/spring-javaformat-formatter-eclipse-jdt-jdk8/0.0.31/spring-javaformat-formatter

-eclipse-jdt-jdk8-0.0.31.jar

[ERROR] urls[4] = file:/C:/Users/Gunwoo/.m2/repository/io/spring/javaformat/spring-javaformat-formatter-eclipse-jdt-jdk11/0.0.31/spring-javaformat-formatte

r-eclipse-jdt-jdk11-0.0.31.jar

[ERROR] urls[5] = file:/C:/Users/Gunwoo/.m2/repository/io/spring/javaformat/spring-javaformat-formatter-eclipse-runtime/0.0.31/spring-javaformat-formatter-

eclipse-runtime-0.0.31.jar

[ERROR] urls[6] = file:/C:/Users/Gunwoo/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.24/plexus-utils-3.0.24.jar

[ERROR] urls[7] = file:/C:/Users/Gunwoo/.m2/repository/org/apache/commons/commons-lang3/3.5/commons-lang3-3.5.jar

[ERROR] urls[8] = file:/C:/Users/Gunwoo/.m2/repository/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar

[ERROR] urls[9] = file:/C:/Users/Gunwoo/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.3/org.eclipse.sisu.inject-0.3.3.jar

[ERROR] urls[10] = file:/C:/Users/Gunwoo/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar

[ERROR] Number of foreign imports: 1

[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

[ERROR]

[ERROR] -----------------------------------------------------

[ERROR]

[ERROR] -> [Help 1]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR]

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException

이런식으로 플러그인 에러가 나고있습니다. ㅠㅠ..현재 java8버전을 사용하고있는데 11이상버전으로 해야하는걸까요?..

답변 4

·

답변을 작성해보세요.

2

안준우님의 프로필

안준우

2022.04.13

해결하셨지만 혹시 이 링크를 타고 들어오시는분들위해 설명드립니다!

올려주신 에러 부분 4번째 문단에 보면 아래와 같이 되어 있습니다.

aultCodeFormatter has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognize

s class file versions up to 52.0

대충 번역하자면 자바 런타임 버전 55가 필요한데 지금 당신의 버전은 52다 라는 의미입니다.

자바는 버전별로 major version 번호라는게 있는데

자바 1.2 = 46

자바 1.3 = 47

...

자바 8 = 52

자바 9 =53

자바 10 = 54

자바 11 = 55

위와 같은 식입니다.

따라서 필요한 건 자바11인데 현재 자바8 을 사용하셔서 생기는 문제이고, 자바11을 사용하시면 해결됩니다.!

현재 자신의 자바버전 확인하는 법은

인텔리제이 하단의 'Terminal' 쪽으로 가셔서 콘솔창에 java -version 이라고 입력하셨을때

openjdk version "1.8 ~~~~~" 이런식으로 나오면 자바8인거고

openjdk version "11.0.~~~~" 이런식으로나오면 자바11인겁니다.

따라서 자바11 설치하시고 콘솔창에 java -version 입력을 통해 확실히 바꾸고 나시면 해결하실 수 있을겁니다.

 

1

gon023415님의 프로필

gon023415

2022.12.23

잘모르겠지만 최근에 의존성문제로 jdk를 11에서 17로 바꾸니까 빌드되는 현상도있네요? 저도 잘 참고햇습니다

0

존오비미켈님의 프로필

존오비미켈

2023.03.02

23년 3월 기준 자바 17버전 이상에서 동작한다고 pet clinic 깃허브 readme에 되어있네요.

Petclinic is a Spring Boot application built using Maven or Gradle. You can build a jar file and run it from the command line (it should work just as well with Java 17 or newer):

0

tobe1205님의 프로필

tobe1205

질문자

2022.03.02

해결완료했습니다..ㅜㅜ!

이호준님의 프로필

이호준

2022.03.23

혹시 어떻게 해결하셨는지 공유좀 부탁드려도 될까요?

dog3218님의 프로필

dog3218

2022.04.07

저도 궁금한데 답변 가능한가요?