Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Documentation - add example to compile translated jsps #190

Open
freshcodemonger opened this issue Jan 10, 2020 · 1 comment
Open

Documentation - add example to compile translated jsps #190

freshcodemonger opened this issue Jan 10, 2020 · 1 comment

Comments

@freshcodemonger
Copy link

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

@freshcodemonger
Copy link
Author

If you allow me to create a new branch then I'll create a PR for this documentation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants