I want to debug my web application in Jetty using gradle. I have some of my property files in source code. Since these files are not copied to WAR, I used the below code to use resources
folder,
sourceSets.main.resources {
srcDirs = ["src/main/java"]; include "**/*.*"
}
This includes properties files in WAR. But when I debug in eclipse, it points to classes
folder which doesnot contain properties folder. How to make debug to point to resources
folder?
Build.gradle:
war {
doFirst {
def propertyFile = file "src/main/java/com/properties/about/About.properties"
def props = new Properties()
propertyFile.withReader { props.load(it) }
println "Before setProperty:"
println props.getProperty('releaseDate')
props.setProperty('releaseDate', new Date().format('yyyy-MM-dd-HH:mm:ss'))
propertyFile.withWriter { props.store(it, null) }
println "After setProperty:"
println props.getProperty('releaseDate')
}
buildDir = new File(rootProject.projectDir, "gradleBuild/" + project.name)
}