3

I know this question has came up before here, however this is in regards to tomcat 9.

Is there anything that has changed in latest tomcat releases that allows to deploy a jar file without restarting tomcat ? We have been using tomcat 7 in our development and all developers restarting tomcat has been time consuming. Its application that has 700 java files that gets built in to a .jar file and about 1000 jsp files that rely on those .jar file, we are not using war. Can WatchedResource be used for this ?

Pit Digger
  • 9,618
  • 23
  • 78
  • 122

2 Answers2

1

You can always restart your webapp and not your Tomcat instance as long as the JAR resides in WEB-INF/lib and not in CATALINA_BASE/lib.

Michael-O
  • 18,123
  • 6
  • 55
  • 121
1

If you are using Eclipse IDE, then you can simply use FileSync plugin to hot deploy the .class files into tomcat WEB-INF/classes folder.

Basically, you need to map YOUR_PROJECT/target/classes folder to WEB-INF/classes so that they will always be in sync.

This is what we do in our project to avoid the restarts of Tomcat because of source file changes.

Vasu
  • 21,832
  • 11
  • 51
  • 67