I’m using Gradle 2.7. I would like to copy an environment-specific file (context.xml) into my WAR’s META-INF directory (which is at the same level as WEB-INF). I have this task set up in my build.gradle file
// Copy context.xml into the appropropriate directory.
war {
def env = project.hasProperty('env') ? project.env : 'dev'
from("${project.rootDir}/src/main/environment/$env") {
include('context.xml')
into('META-INF')
}
}
However, when I run “gradle build”, nothing gets copied. I have verified the file exists. What else do I need to do to get this file to copy properly?