I have a multi-module Maven project for a webapp. Example:
project-root
|- core
|- webapp-demo
where webapp-demo
references core
.
Most jsp and tag files are placed in webapp-demo
. However, some are placed in core
.
For development, I build and deploy this project using Maven as exploded webapp (i.e. the content of the WAR file but uncompressed). This also works fine from IntelliJ. Further, when I do "Build > Rebuild Project" in IntelliJ, then
- JSP and tag files are packaged.
- Changes to the files in
webapp-demo
are immediatedly recompiled by Tomcat. I can see the new version when I reload the page.
However, changes to the jsp and tag files in core
are not immediately recompiled by Tomcat. I have to stop and start Tomcat to see the changes.
I noticed that the changed files are packaged correctly by IntelliJ. The new tag file is available in the JAR of the webapp's "lib"-folder (/WEB-INF/lib). Sadly, Tomcat does not seem to notice this.
Is there a Tomcat configuration to make this work? I want Tomcat to recompile changed jsp and tag files even though they are inside a JAR in /WEB-INF/lib.
Maybe there is an option to also "explode" these JAR files (or at least their jsp and tag files)?
I prepared an example project on GitHub to reproduce my issue.
- I found this thread where it is said not to work for stuff inside /WEB-INF/lib.
- I found this other thread where it is said to work when one adds a
<WatchedResource>
config. I tried this and it did not work. - I tried "start" and "stop" of the webapp in the Tomcat Manager but the changed tag file is still not recompiled. It still shows the old version. Only when I stop and start the run config in IntelliJ (which stops and starts whole Tomcat), then I see the changed tag file of
core
.