COMP 310
|
Renaming a Project in
Eclipse
|
 |
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.
- Disconnect project from source control: On EVERY computer that is connected that project in the source control
server, disconnect the project from source control:
- Right-click the project and select "Team/Disconnect...".
- In the disconnect confirmation dialog, change the option to "Also
delete the SVN meta information from the file system".
- Click "Yes"
- This project will no longer be used but do not delete it until you
are 100% sure that you have it somewhere else.
- Rename the project in SVN: Switch to the
SVN Repository Exploring
perspective
- Right-click the project and select "Rename/Move..."
- 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.
- Type in the new project name and click
Finish.
- Fix the internal name of the project: Check out
the project from SVN on ONLY ONE machine. (This step can be omitted if desired.)
- 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.
- Close Eclipse.
- In your file explorer, browse to your project directory and use
Notepad or any other text editor and edit the
".project" file.
- Change the <name>
field from "<name>old_project_name</name>" to "<name>new_project_name</name>"
- Save the".project"
file and reopen Eclipse.
- Commit all the code back to the SVN repository.
- Check out the project from SVN to all machines that will be
using it.
- 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