티스토리 뷰
[Gradle] Execution failed for task ':jar'.> Entry application.properties is a duplicate but no duplicate handling strategy has been set. 이슈 해결
니용 2023. 2. 28. 10:23Spring 개발 도중 아래와 같은 에러를 접하여 검색 결과를 찾아보았습니다.
* 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 생성부분에서 똑같은 에러가 발생하게 됩니다.
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... 를 선택합니다.
IntelliJ 메모리 효율적으로 사용하기
안녕하세요~ 코딩을 진행할 때 주로 사용하는 툴이 IntelliJ IDE 를 사용하고 있는데, 간헐적으로 메모리 사용량이 10GB를 넘어버리는 경우가 종종 있어 메모리를 최적화하면서 사용하는 방법을 간
abbo.tistory.com
'Server' 카테고리의 다른 글
[Java] class path resource [com/p6spy/engine/spy/appender/MessageFormattingStrategy.class] cannot be opened because it does not exist (9) | 2023.04.06 |
---|---|
[IntelliJ] 검색에서 파일 마스크 처리해서 소스 코드 찾기 (2) | 2023.03.14 |
[Chat GPT] 코틀린으로 웹 개발 하는 것에 대해서 에세이를 간단하게 써달라고 했다 (0) | 2023.03.03 |
[Java] @Value Annotation static 변수로 선언하기 (0) | 2023.02.24 |
[Java] String template 사용하기 (0) | 2023.02.11 |
[Jenkins] 배포 자동화 알림 Slack 으로 전송하기 (0) | 2023.02.06 |