Eclipse publishing to Tomcat

31,444

Solution 1

A the "Servers" view, you can double click on your Tomcat instance, to open the server settings editor.

There, at the upper right corner, you can find the Publishing options. Check the "Never publish automatically" option, and save.

With this it should be enough.

Oh, and by "Publishing", they kind of mean "Deploying", or "Copying to the deploy directory", depending on what server you are using.

Solution 2

Eclipse (Helios) makes a copy of your entire Tomcat configuration and starts a new instance of the Tomcat server when you are running the web application from Eclipse. That is why you must shut down any existing Tomcat service before running in Eclipse.

The application runs out of your workspace, not out of the "webapps" folder. Eclipse modifies the copied server.xml file to add "CONTEXT" tags that include your workspace project folders in the running application list.

The path in the "CONTEXT" tag should be the name of your project folder.

You can export the project to a WAR file and deploy your web application to the webapps folder if you want.

Share:
31,444
mkoryak
Author by

mkoryak

Senior software engineer at Google in Cambridge. Author of jquery.floatThead - fixed table headers (1K stars on github) https://github.com/mkoryak

Updated on July 09, 2022

Comments

  • mkoryak
    mkoryak almost 2 years

    I recently came back to using Eclipse after 2 years of IntelliJ. Things have changed.

    Now when I try to run Tomcat, it tries to publish my project to it. What the hell is publish?

    What ever happened to pushing a war into the webapps directory and letting Tomcat deploy it?

    Right now my deployment is broken because of compilation errors. I have a feeling that Eclipse is taking my project and copying it to webapps dir without first building it properly.

    Can someone explain to me what exactly publishing does, and also how to turn it off and use Tomcat like normal people?