Hi,
I’m using Gradle 2.7. I would like environment-specific properties files to be included in my classpath for both my unit tests and WAR assembly. As such I have this code …
ext.env = project.hasProperty('env') ? project.env : 'dev'
// src is not default java source dir in gradle
// so change srcDir and resources srcDir
//according to eclipse project layout
sourceSets {
main {
java {
srcDir 'src/main/java'
}
resources {
srcDir 'src/main/resources'
srcDir 'src/main/environment/$env'
}
}
}
However, running a command like
gradle build -Penv=qa
does not include the files from the src/main/environment/qa directory in my classpath for testing and does not package the files into my WAR. What do I need to do to accomplish this?