I'm experiencing weird behaviour when running a tomcat webapp project in Intellij Ultimate.
If its the first time I click "Run" everything goes well, the artifact is built and ran as expected. Let's say then that I click on the "Stop" button to stop the Tomcat server, then I make a couple of changes to the source code and click "Run" again.
Here's the weird behaviour: Intellij won't recompile the code/build the artifact. It'll restart the server and then deploy the old (original) war file. This happens even if I manually check the Run Configuration options to make sure that the artifacts are re-built before running them on the server, not only that, this happens even if I manually click on the "Build" button before clicking on "Run" again.
I've found two ways to "solve" this: Either deleting the entire "target" folder, so that Intellij is forced to recompile the new version of the code, or re-running the application using the "Restart Server" option (when the server is already running).
Am I doing something wrong or is this behaviour expected? Thanks!