NullPointer
NullPointer

Reputation: 412

Do I need to rebuild the whole project everytime I start Tomcat server?

If I made some changes to the JAVA code, do I need to rebuild the project using maven before I restart the Tomcat server to see the result?

Upvotes: 3

Views: 6170

Answers (2)

Dhaval Simaria
Dhaval Simaria

Reputation: 1964

Though server like Tomcat do provide automatic reload of application with new changes, e.g: Automatically publish when resources change, doing a rebuild after any change is considered a good practice as it will eliminate any possibility of missing out on any change implementation.

Also you can use plugins like Spring-Loaded and JRebel that allow reloading of classes while JVM is running.

Also if you are using Spring-Boot, there is an inbuilt module called Dev-tools available from version 1.3, that triggers automatic restart of application once new changes are saved.

Upvotes: 3

Bhumi Nandan Chettri
Bhumi Nandan Chettri

Reputation: 43

If you are deploying in test server or production server you need to build the package.war every time as it would take the changes you have done in the source code. If you are running in local server then, you can ask tomcat to deploy automatically by - Double click on server -> one window will appear click on publising and check *Automatically publish when a resource change. Ofcource, this will take time to build and reload. If time is really crucial for you and your team then you can configure JRebel

https://zeroturnaround.com/software/jrebel/

This plugin will really saves your time.

Upvotes: 2

Related Questions