I am trying to replace a resource file in my WAR plugin with Gradle.
I basically have two resource files:
database.properties database.properties.production
I want to achieve the replacement of 'database.properties' 'database.properties.production' in the last WAR file in the WEB-INF / classes section.
I tried many things, but the most logical for me was the following, which does not work:
war { webInf { from ('src/main/resources') { exclude 'database.properties' rename('database.properties.production', 'database.properties') into 'classes' } } }
But this leads to duplication of all other resource files, including duplicates of database.properties (two different files with the same name) and still database.properties.production is in the WAR.
I need a clean solution without duplicates and without database.properties.production in WAR.
source share