I have read many topics which are similar with my problem, but they all do not meet my requirements.
I have two config file for different deployment environment, and they are placed in other two folders.[overlays/test/config.properties / overlays/prod/config.properties]
I have another config file in folder [src/main/resources/config.propertis] for IDE integration test use.
I want create war archive files for different environment, so I create two tasks to create these files, but i got duplicated config file under the same folder in war archive [WEB-INF/classes],
so my problem is : i want exclude the config file “config.properties” from the folder “src/main/resources/” when i create the war archive, then there will be only one config.properties file under the folder “WEB-INF/classes” per war archive.
the task i created like below:
task assemblyTest (type: War, dependsOn: classes) {baseName = project.name+’-test’
from("./overlays/test") {
into(“WEB-INF/classes”)
include “**/*”
} }
task assemblyProd(type: War, dependsOn: classes) {
baseName = project.name+’-prod’
from(’./overlays/prod/resources’) {
into(“WEB-INF/classes”)
include “**/*”
duplicatesStrategy = DuplicatesStrategy.FAIL
} }
thanks for your help very much!