gradle-tomcat-plugin
gradle-tomcat-plugin copied to clipboard
Documentation - add example to compile translated jsps
The plugin defaults to translate jsps into java files but not compile those jsps for war file packaging. The tomcatJasper task is dependent on classes. Since classes runs first, your existing .java files will be turned into .class files, then your jsps will be turned into .java files. This is the correct ordering as your .class files may be required to translate or compile your jsp / jsp java files.
The problem is that you can't make tomcatJasper finalized by compileJava because it depends on classes which causes a circular dependency and won't work in gradle.
The solution I eventually came up with is:
task compileJspJava(type: JavaCompile) {
source = 'build/jasper'
classpath = compileJava.classpath
destinationDir = compileJava.destinationDir
}
tomcatJasper.finalizedBy compileJspJava
I believe this is what most people are wanting
If you allow me to create a new branch then I'll create a PR for this documentation.