Showing posts with label maven. Show all posts
Showing posts with label maven. Show all posts

Wednesday, October 08, 2025

Maven deploy to Tomcat

 So, I'm finally moving off of NetBeans and into IntelliJ IDEA

The two main reasons for that are:

  1. NetBeans is really getting old any hardly any relevant updates
  2. All my other IDEs (PyCharm, Android Studio) are built on it
I long ago moved my projects from ant based to maven, not I struggled to get the tomcat plugin to properly deploy to my local tomcat.
Well, the re-deploy didn't work to be honest.
Reason was, that the plugin does not add the "upgrade=true" to the upload URL, and I failed to manually tweak it.

Then I found that the plugin will honor a property called maven.tomcat.update and a quick test from a command line showed that this really works.
But then, how to get it into the IDE itself. 

Took me a while, and the best way is to add it to your POM under properties, like below:

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jakartaee>10.0.0</jakartaee>
<maven.tomcat.update>true</maven.tomcat.update>
</properties>

And voila, all uploads from the deploy target will now end with "&update=true".