본문 바로가기

오류해결

Entry application.properties is a duplicate but no duplicate handling strategy has been set.

Spring boot에서 Gradle task로 war파일을 build하려고 하다가 오류를 만났다.

에러내용 : 
* What went wrong:
Execution failed for task ':processResources'.
> 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.

 

application 프로파일이 중복으로 가져와져서 나타나는 오류인것 같다.

해결방법: build.gradle의 task영역을 추가한다!

tasks {
  processResources {
              duplicatesStrategy = org.gradle.api.file.DuplicatesStrategy.INCLUDE
  }
}

 

 

 

gradle수정 후, Refresh Gradle Project를 잊지 말아야 한다 :)


 

 

 

참고 :

https://docs.gradle.org/current/javadoc/org/gradle/api/file/DuplicatesStrategy.html

 

DuplicatesStrategy (Gradle API 7.4.2)

Do not attempt to prevent duplicates. If the destination of the operation supports duplicates (e.g. zip files) then a duplicate entry will be created. If the destination does not support duplicates, the existing destination entry will be overridden with th

docs.gradle.org