Question

I was handed a tomcat6 web application and the previous developer told me to unzip new classes directly into the /var/lib/tomcat6/webapps/ROOT/WEB-INF/ folder and restart the service.

This was deemed better by him instead of placing the WAR in the webapps folder.

In which case is this better and under what conditions? I would like pros/cons and reasons for deployment through unzipping and deploying through WAR.

Is one accepted in the community more than the other?

1 Benefit of unzipping:

  • On may only transfer to the server the sub-packages (or .class files) that changed. Handy for very large projects (resulting war) and remote server transfer.

1 Benefit of deploying by WAR:

  • Ease, less steps.
Was it helpful?

Solution

I don't think there's a definitive answer here. At least I've never head a truly compelling reason to always do one or the other. I'd say it's up to personal preference and that you should do what works best for you, your situation and your environment.

As requested, some pros & cons, although there's nothing mind blowing on this list.

Pros (for WAR):

  • Everything is in one convenient package. No need to worry about forgetting something.
  • Can be versioned so you know what files work together
  • Integrates easily with a CI pipeline i.e. war is created, tested and promoted.
  • If versioned, can be easily rolled back.

Cons (against WAR):

  • Can be big to transfer around. Partial update could be quicker if file size is lower.
  • No need to unzip the file. Might be slightly faster, but probably not.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top