Why when I rename a project in Eclipse does Tomcat not pick up the new resource name?

I believe you are looking for a hidden pref located under your project/.settings/org.eclipse.wst.common.component.

The beginning of the file should look roughly like this:

<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
    <wb-module deploy-name="projectB">

So just change the deploy-name. Another thing that I recommend changing is the project's context root, right-click the project -> Properties -> Web Project Settings.

(just to clarify, to the best of my understanding this behavior is a bug in WTP. WTP is responsible for maintaining the hidden pref file under .settings, and it just doesn't update the file when the project is renamed)


Edit your project name here:

Eclipse -> Project -> Properties -> Web Project Settings -> Context Root

This is where you want to edit the project name (too), and I believe it will also change the project/.settings/org.eclipse.wst.common.component file as mentioned in Yoni's answer above. I would recommend opening it to verify it though. If so, this is the better answer I believe.

EDIT: Anyone who verifies this, please post, and I'll append your verification to my answer.


Unfortunately, changing the Context Root does not update the org.eclipse.wst.common.component-file. So it is really necessary to change the deploy name in the file.