Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When not to use this server location when using tomcat within Eclipse

When using tomcat within Eclipse why would I ever not want to use the tomcat installation as checked in the attached image. I always use the "Tomcat Installation" Are there advantages/disadvantages of using the other Tomcat server locations.

enter image description here

like image 495
blue-sky Avatar asked Feb 03 '23 10:02

blue-sky


2 Answers

In fact, I always Use Workspace Metadata. When you say Use workspace metadata, Eclipse copies your files (class files, jsps, server.xml, context.xml) to /.metadata/.plugins/org.eclipse.wst.server.core/tmp0. It then starts Tomcat using these files. It does not change the Tomcat installation directory at all. Note that this doesn't copy the tomcat files, just the files which come from your project.

If you choose Use Tomcat Installation, then it copies your files into the Tomcat installation directory, and boots it from there.

If, like me, you're developing multiple projects from multiple workspaces, then this makes a big difference. With Use Workspace Metadata you will never get any interference between workspaces. For instance, it's possible that when rebooting Tomcat, one project will be in a bad state and your logs will be filled with stuff from another project. It's better to have two separate locations, and the workspace is a good place for this.

like image 173
Matthew Farwell Avatar answered Feb 06 '23 15:02

Matthew Farwell


Always try to use use workspace metadata ...

this option delpoys the web app in the workspace directory

~WORKSPACE\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps

so you have different work spaces for different projects , you will have applications deployed in different spaces and this solves ambiguity in deployment.

even if you have singe application, this is recommended

if you select use tomcat installation... , you will have to be careful while dealing with multiple applications as the old application will be overridden by the newly deployed web application.

when you select use custom location ... then you need to be more careful while handling multiple applications as you manually give the locations for deployment

like image 23
V K Avatar answered Feb 06 '23 16:02

V K