|
Written by Chintan Rajyaguru
|
|
Wednesday, 10 May 2006 19:05 |
|
One of the most commonly used version control system is CVS and one of the most commonly used IDE is eclipse (Rational Application Developer - RAD, in my case). Surprisingly, Google isn't much of a help when you do searches like "rad cvs," "rad setting up cvs," "ibm rational application developer setting up cvs" etc. so I thought I would document the process I follow: In most cases cvs repository resides on a server. To use cvs from within Rational Application Developer (or eclipse IDE), you first need to setup the repository and then share your project(s) using that repository. Let's review the process step by step:
Setup repository Prerequisites: - You must have a cvs username and password
- You must know the host name, repository location, port number (if default port is not used)
Process: - Go to the CVS repository view of RAD
- Go to Window > Open Perspective and choose Other
- From the resulting window, select CVS Repository Exploring and click Ok

- Right click in the CVS Repositories view (a tab in the left panel) and select New > Repository Location
- In the Add CVS Repository window, enter Host, Repository path, User, Password, Connection type and port information as shown
 - Let us discuss the above entries quickly
- The hostname is the remote server on which cvs is installed. The value should be the ip address of the machine or the machine name. In the example, I have used a fully qualified machine name. The cvs admin should be able to give you the hostname
- Repository path. This is the directory designated as cvs documents root. The cvs admin should be able to give you the repository path. Any file that is under version control will be somewhere under the repository - /var/cvs/myrepository in case of the example
- Username and password are typically assigned by the cvs administrator. Because cvs has a weird way of generating passwords, most of the time passwords are not changeable by the developer
- In most cases default port should work. If not, obtain it from the cvs admin
- The checkboxes in the example simply
- Validate the connection and notify you if the wizard can't connect to the server
- Save the password so you don't have to enter every time you check in or check out something
Adding project to the repository The steps above simply connect RAD to the cvs repository. The project in the workspace are not part of the cvs repository yet. To add a project in cvs, follow these steps: - Right click the project you want to add and select Team > Share Project


- Select Use existing repository location radio button, choose the repository you created earlier and click Next
- Enter Module Name is the most important screen in adding the project to the repository. Select Use specified module name and enter the path of the module relative to the repository location. Remember the following
- The path should NOT start with a slash (/)
- The path is relative to the cvs repository path (you entered repository path when you setup the repository). For example, let's assume the repository is at /var/cvs/myrepository. You have an application called myapp, which has 3 projects MyAppEJB, MyAppWeb and MyAppEAR. You should put projects in the repository like this:
- /var/cvs/myrepository/src/myapp/MyAppEAR
- /var/cvs/myrepository/src/myapp/MyAppEJB
- /var/cvs/myrepository/src/myapp/MyAppWeb
When you are in RAD, you only see MyAppEAR, MyAppEJB and MyAppWeb. You don't see src and myapp directories. While sharing the EAR project in RAD, you should enter src/myapp/MyAppEAR - The path INCLUDES the name of the project you are adding. Notice in the example above that the path includes the name of the project MyAppEAR

Start using From this point on, you shouldn't use another cvs client to work with cvs. You can directly work with cvs right from RAD. Simply right click the file (or package) and select Team > - Commit - to send your changes to cvs
- Add to version control - to add a new file to cvs
- Update - to get latest version from cvs
- Restore from repository - to loose your changes and get the latest file from cvs
|
|
Last Updated on Tuesday, 16 May 2006 16:27 |