티스토리 뷰

반응형

Spring 개발 도중 아래와 같은 에러를 접하여 검색 결과를 찾아보았습니다.

* What went wrong:
Execution failed for task ':jar'.
> Entry application.properties is a duplicate but no duplicate handling strategy has been set. Please refer to https://docs.gradle.org/7.3.3/dsl/org.gradle.api.tasks.Copy.html#org.gradle.api.tasks.Copy:duplicatesStrategy for details.

 

1. clean build

최상단에 뜨는 스택오버플로우 글을 참조해보니, 이런 증상은 종종 제대로 클린이 되지 않아서 중복적으로 클래스 생성되었을 때 발생하는 문제라고 합니다. 그래서 gradle clean 후 build 를 하였더니 이슈가 해결되었지만, 다음 build 시에는 jar 생성부분에서 똑같은 에러가 발생하게 됩니다.

 

https://stackoverflow.com/questions/67265308/gradle-entry-classpath-is-a-duplicate-but-no-duplicate-handling-strategy-has-b

 

Gradle "Entry .classpath is a duplicate but no duplicate handling strategy has been set"

I'm trying to build a gradle project but, when I try $ gradle build I get the following output: Starting a Gradle Daemon (subsequent builds will be faster) > Task :jar FAILED FAILURE: Build fai...

stackoverflow.com

 

2. task 내에 옵션 추가

build.gradle 스크립트 내에 아래와 같은 내용이 없다면 추가해줍니다.

tasks {
    jar {
        enabled = false
        duplicatesStrategy = org.gradle.api.file.DuplicatesStrategy.INCLUDE
       
    }
}

또는

jar {
   duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
}

 

3. 재부팅

IDE의 이슈일 수도 있으므로 IDE를 재부팅 시키거나 Cache 를 클리어합니다. File - Invalidate Caches... 를 선택합니다. 

https://abbo.tistory.com/270

 

IntelliJ 메모리 효율적으로 사용하기

안녕하세요~ 코딩을 진행할 때 주로 사용하는 툴이 IntelliJ IDE 를 사용하고 있는데, 간헐적으로 메모리 사용량이 10GB를 넘어버리는 경우가 종종 있어 메모리를 최적화하면서 사용하는 방법을 간

abbo.tistory.com

 

반응형
댓글
공지사항