How and when to clear and restart when editing code on tomcat production server

This question will consist of many subroutines.

I have been working as a Java Web developer since last year. I use eclipse for development, but when it comes to deploying code to Production and making minor changes to the code, I do so by accessing the server using SSH and a simple text editor . Moving from the IDE to the command line presents several challenges.

Questions

  • in eclipse I am clearing the project after making changes to .java or .xml files. How do I clear it using the command line?
  • What exactly is being cleaned and built? is the cleanup the same as restarting the server?
  • What scenarios (developer's point of view) require a server restart?
  • Editing css, html does not require server restart. In which files should I restart the server?
  • Server.xml and context.xml require reboot or not?
  • What is the difference between startup.sh and Catalina.sh?

ps: - I know some of the above questions might be too simple (or some might say silly), but I really don't know them.

+3


source to share


1 answer


in eclipse I am clearing a project after making changes to .java or .xml files.How can I clear it using command line?

You can run javac from the command line, but it won't be very convenient. We recommend using a build tool like maven (or at least ant) ​​to build your project. These tools can be run from the command line and create your war

What exactly is being cleaned and built? is the cleaning the same as restarting the server?

Cleanup removes the classes folder and the assembly compiles the source and creates the classes folder and .class files

What scenarios (developer's point of view) require a server restart?



You can use tomcat manager to quickly deploy your war, so no server reboot is required - however you probably shouldn't be doing this in production.

Editing css, html does not require server restart. should restart the server?

Any changes to java files (deployed in WEB-INF / classes) or banks (in WEB-INF / lib) require a server restart - actually anything in WEB-INF. Any changes to the css / html will also require redeployment in case of deploy as a war. Redeployment is not required if you are using exploded war (as I assume you are)

Server.xml and context.xml need restart or not?

Changes to server.xml require a reboot. Changes to context.xml at least require redeployment

+2


source







All Articles