Fanish
10/01/2025, 8:53 AMI am using a war task in my gradle project, The idea is to get the web.xml file in war artifact created and in that copied file there is one parameter <param-value>${springActiveProfile}</param-value>which should have the value given in def springActiveProfile = 'sync,prodPropertySetup'.
But my below added task is not working as it is not editing the web.xml
def springActiveProfile = 'sync,prodPropertySetup'
war {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveBaseName = "Sync"
// Normal webapp content
from("src/main/webapp")
// Override just web.xml with expansion
from("src/main/webapp/WEB-INF") {
include "web.xml"
into "WEB-INF"
expand(springActiveProfile: springActiveProfile)
}
}Sergej Koščejev
10/01/2025, 9:27 AMFanish
10/01/2025, 1:51 PMtasks.register('customWar', Jar){
//source and target info
...
}Vampire
10/01/2025, 8:06 PMfilesMatching to do the expansion on just the one file you want it to. :-)Vampire
10/01/2025, 8:08 PM