본문 바로가기
카테고리 없음

[Spring] > Failed to transform ~.jar to match attributes {artifactType=classpath-entry-snapshot, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.

by Nhahan 2023. 12. 26.
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':gateway:compileKotlin'.
> Could not resolve all files for configuration ':gateway:detachedConfiguration1'.
   > Failed to transform common-0.0.1-SNAPSHOT-plain.jar to match attributes {artifactType=classpath-entry-snapshot, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
      > Execution failed for ClasspathEntrySnapshotTransform: /Users/sunningkim/Documents/prototype-be/api/common/build/libs/common-0.0.1-SNAPSHOT-plain.jar.
         > Check failed.

 

메모리가 모자라서 빌드가 되지 않는 오류.

나의 경우 멀티모듈을 5개 만드니까 빌드 시에 에러가 나는 상황.

 

 

 

해결법

`gradle.properties` 수정

// gradle.properties    메모리를 이용해 빌드 속도를 올려주는 옵션
kotlin.incremental.useClasspathSnapshot=false

(`gradle.properties`는 spring initializr에 의해 생성되지 않기 때문에 만들어주어야함)

 

 


 

2014.10.05

가볍게 쓴 메모 글인데, 의외로 검색량이 많아서 자바 버전 추가

org.gradle.java.compile.incremental=false

 

 

혹은 코틀린/자바에서 아래와 같은 방식도 가능

org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m

(수치는 개인 상황에 맞게 조절)

댓글