COMP 310

Renaming a Project in Eclipse

    Current Home  Java Resources  Eclipse Resources

One must exercise caution when renaming a project in Eclipse as it is possible for to inadvertently create situations with unexpected consequences.   In particular, one must be very careful when the project is under source control.

Project is NOT Under Source Control

To rename the project, simply right-click the project and select "Refactor/Rename...".  Fill in the new name and click OK

Project IS Under Source Control

In a nutshell, one must disconnect ALL local projects on ALL machines and then rename the project in SVN.   After that is done, the project can be checked out as a brand-new project.

  1. Disconnect project from source control: On EVERY computer that is connected that project in the source control server, disconnect the project from source control:
    1. Right-click the project and select "Team/Disconnect...".
    2. In the disconnect confirmation dialog, change the option to "Also delete the SVN meta information from the file system".
    3. Click "Yes"
    4. This project will no longer be used but do not delete it until you are 100% sure that you have it somewhere else.
  2. Rename the project in SVN: Switch to the SVN Repository Exploring perspective
    1. Right-click the project and select "Rename/Move..."
    2. In the Move Remote Resource dialog that comes up, be sure that the desired remote folder in which the project is to reside is highlighted.
    3. Type in the new project name and click Finish.
  3. Fix the internal name of the project:  Check out the project from SVN on ONLY ONE machine. (This step can be omitted if desired.)
    1. Notice that the suggested project name is the old name.   Be sure to change the project name to the new name when you check out the project.
    2. Close Eclipse.
    3. In your file explorer, browse to your project directory and use Notepad or any other text editor and edit the ".project" file.
    4. Change the <name> field from "<name>old_project_name</name>" to "<name>new_project_name</name>"
    5. Save the".project" file and reopen Eclipse.
    6. Commit all the code back to the SVN repository.
  4. Check out the project from SVN to all machines that will be using it.
    1. Once the new project has been completely verified, the old project can be deleted from the Eclipse (Right-click the old project and select "Delete").

 

 

 

 


© 2017 by Stephen Wong