Pit Digger
Pit Digger

Reputation: 9800

Is there a way to deploy a jar without restarting in Tomcat 9?

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 ?

Upvotes: 2

Views: 2892

Answers (2)

Vasu
Vasu

Reputation: 22452

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.

Upvotes: 1

Michael-O
Michael-O

Reputation: 18415

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.

Upvotes: 1

Related Questions