sagioto
(Sagi Bernstein)
June 4, 2015, 2:44pm
1
Hi,
I’m using the war plugin with a filter like so:
war {
from("$projectDir/src/main/resources"){
filter { it = it.replace('foo', 'bar') }
}
duplicatesStrategy = 'EXCLUDE'
}
Unfortunately this only includes the pre-filtered files,
if I remove the duplicatesStrategy it includes both version but it leads to unwanted results,
Is there w way to only include the filtered files?
thanks,
You could probably do something like this.
war {
filesMatching('src/main/resources/**') { details ->
details.filter { it.replace('foo', 'bar') }
}
}
sagioto
(Sagi Bernstein)
June 5, 2015, 1:55pm
3
This only includes the unfiltered file,
I need the file after processing to be included in the war
Ah yes, sorry. The WAR classpath (everything going into WEB-INF/classes) is treated a bit special. You’ll want to do the filtering as part of the ‘processResources’ task.
processResources {
filter { it.replace('foo', 'bar') }
}