This article, the third one in a series on team development in IBM ® WebSphere® Studio Application Developer, focuses on installing and configuring CVS on RedHat Linux 7 as an SCM Repository. WebSphere Studio Application Developer (hereafter called Application Developer) works seamlessly with CVS, the dominant open-source, network-transparent version control system. CVS runs on most platforms, including Windows®, Linux, AIX®, and UNIX®. Installing it with Application Developer on RedHat Linux has several advantages:
- Linux is now the dominant open-source operating system.
- RedHat is one of the major distributors of Linux.
- CVS is included in the RedHat Linux 7 distribution.
- CVS for Linux is stable, reliable, and scalable, and is useful for individual developers and small teams as well as large, distributed teams.
- Application Developer runs on RedHat Linux 7.
- When using Application Developer, you can use CVS as a local repository
or as a shared repository for the entire team.
However, installing and configuring CVS for Linux is not trivial and there is little good documentation available. The step-by-step instructions below should help system administrators configure CVS for Linux for developers using Application Developer.
CVS Version 1.11.1.3 may be already installed in your RedHat
Linux 7 by default. To check, enter the command rpm
-qa|grep 'cvs'. If the return is cvs-1.11.1-3,
it means that CVS is already installed.
If the command returns nothing, you need to install CVS. The
CVS rpm is normally on Installation CD #2 of the RedHat Linux 7 distribution
in the directory RedHat/RPMS. After you mount
the CD to /mnt/cdrom, use the rpm
command to install CVS: rpm -i /mnt/cdrom/RedHat/RPMS/cvs-1.11.1p1-3.i386rpm
Set up the CVS user accounts and groups
- Log in as root.
- Create a user named
cvs, with a primary groupcvs. - Create users who will use cvs in Application Developer. This article uses
cvsdev1andcvsdev2. - Developers who use
cvscan use their private groups as their primary groups. For example,cvsdev1'sprimary group iscvsdev1, but make sure that they also belong to thecvsgroup.
Set up the folder and repository
- Log in as user
cvs. - Create a directory named
repositoryunder its own home directory, which is/home/cvs. - Set the access level and access mode of directory
/home/cvs/repository:chmod 770 /home/cvs/repository - Set setgid bit on directory
/home/cvs/repository:chmod g+s /home/cvs/repositoryExplanation: when a file is created in a directory, it belongs by default to the primary group of the owner. With the
setgidbit set on the directory, new files will belong to the same group as the directory instead of to the owner's primary group. For example, if usercvsdev1creates files in the directory/home/cvs/repository, those files will belong to thecvsgroup instead of to its primary groupcvsdev1.This step is crucial because it lets CVS users check out files created by other users. If this step is not completed, then when you check out a file created by another user, the operation will fail with this message:
Failed to create lock directory for
/home/cvs/repository/...: Permission denied.
Failed to obtain dir lock in repository/home/cvs/repository/... - Initialize the repository:
cvs -d /home/cvs/repository init
- Log out user
cvs.
Modify xinetd service to enable pserver protocol
- Log in as root.
- Create a file named
cvspserverin directory/etc/xinetd.dwith this content:# default: off # description: An cvs server. service cvspserver { disable = no socket_type = stream protocol = tcp user = root wait = no server = /usr/bin/cvs server_args = -f --allow-root=/home/cvs/repository pserver log_on_success +=USERID log_on_failure += USERID } - Open
/etc/servicesand verify that these two lines are present. If they are not, add them:cvspserver 2401/tcp # CVS client/server operations cvspserver 2401/udp # CVS client/server operations
- Restart
xinetdservice:service xinetd restart
- Open the file
/etc/profile. You should to see these lines in the file:USER='id -un' LOGNAME=$USER MAIL="/var/spool/mail/$USER"
- Add one line after the environment variable MAIL.
CVSROOT=":pserver:$USER@localhost:/home/cvs/repository"
- In the file, you should also see a line like this:
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
- Modify it and add CVSROOT into the export list like this:
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC CVSROOT
Test the installation by local users
- Developer 1 log in as
cvsdev1. - Make sure the environment variable is correct by typing this command:
echo $CVSROOT
It should return a result like this related to the user name:
:pserver:cvsdev1@localhost:/home/cvs/repository
- Log into CVS with the command:
cvs login
You will be prompted for a password. Enter your Linux password.
- Create a directory named
project1:mkdir project1
- Create a file named
Test.javain directoryproject1with the following contents:public class Test{ public String sayHello(String name){ return "Hello"+name; } } - Use these commands to import
Test.javainto moduleproject1in the CVS repository:cd /home/cvsdev1/project1 cvs import -m "import Test.java" project1 wsadgroup release1_0
You should see a message like this after the CVS import operation:
N project1/Test.java No conflicts created by this import
- Back up your source:
cd mv project1 project1.sav
- Check out
project1from the CVS repository:cd cvs checkout project1
You should see a new directory named
project1created under/home/cvsdev1, with a fileTest.javaand a directoryCVS. - Developer 2 log in as
cvsdev2 cvsdev2log into CVS:cvs login
cvsdev2check outproject1from CVS:cvs checkout project1
You should see a message like this from CVS:
cvs server:Updating project1 U project1/Test.java
- Add a new method to
Test.java, which is in the directoryproject1:public String sayBye(String name){ return "Bye, " + name; } - Check
Test.javainto the repository:cvs commit -m "checkin Test.java" Test.java
You should see a message like this from CVS:
Checking in Test.java; /home/cvs/repository/project1/Test.java, v <-- Test.java new revision: 1.2; previous revision: 1.1 done
User
cvsdev1catches the changes bycvsdev2with these commands:cd /home/cvsdev1/project1 cvs update Test.java
You should see a message like this from CVS:
U Test.java
You can open
Test.javawith an editor to see the update bycvsdev2.
Test the installation with Application Developer
- Open Team Perspective, select the Repositories view and in
the Workbench, select File => New => Other. From the CVS category,
select Repository Location and click Next. Complete the repository
location wizard. Here are brief descriptions of the CVS terms on this panel
of the wizard:
Connection type Protocol you wish to use to connect to the CVS server. The default is pserver, which represents the password server protocol. It is the connection type we just set up in RedHat Linux 7. User name User name you use to log on to the CVS server. For example, cvsdev1 or cvsdev2 in the cvs group that we just defined in RedHat Linux 7. Host name Machine name of the server you wish to connect to. This will be the host name or IP address of the RedHat Linux box. Repository path Fully qualified path to the location of the repository on the server. With our installation and configuration, this will be:/home/cvs/repository. CVS location Complete location used by Application Developer to connect to the repository. This is dynamically built as you complete the previous fields. Validate on finish Tests the repository connection before returning to the IDE. Keep this enabled as a first connectivity test.
Figure 1.
- Click Finish. If Application Developer can connect to the CVS server,
you will be prompted for a password for the user ID. See Figure 2 below.
Figure 2.
Once the user ID and password have been validated, you are returned to the Repositories view with a new entry for the repository to which Application Developer has connected.
- Expand Streams => HEAD => project1, and you can see
Test.javawith Release 1.2, which is consistent with our observation in Step 13 of the "Test the installation by local users" section.
Figure 3.
- Right-click
Test.javaand select Show in Resource History. From the Resource History view, you can see whencvsdev1made the initial revision ofTest.java, and whencvsdev2checked inTest.javato the repository after the code change.
Figure 4.
Figure 5.
5. Finally, right-click
project1and select Add to Workspace. You are all set to work onproject1in Application Developer!
Figure 6.
This article has described how to configure CVS in RedHat Linux. I hope you have found this article helpful and I welcome all feedback.
The author wishes to thank David Van and Joseph Chiu, Software Development Analysts, IBM Toronto Lab, for reviewing this article.
- WebSphere Developer Domain
(WSDD)
- WebSphere Studio
Application Developer product page
- Team Development with
WebSphere Studio Application Developer 4.0 -- Part 1: Overview
- Team Development with
WebSphere Studio Application Developer 4.0 -- Part 2: Installing and Configuring
CVS as an SCM Repository

Colin Yu is currently working as a software developer on WebSphere Studio Application Developer at the IBM Software Solutions Toronto Lab. Colin received a Bachelor of Engineering degree in 1995 and a Master of Applied Science degree from the University of Waterloo, Ontario in 2000. Colin is an IBM Certified Enterprise Developer and Systems Expert on WebSphere Application Server, and an IBM Certified Solution Developer on WebSphere Studio Application Developer and VisualAge for Java. You can reach Colin at coliny@ca.ibm.com .
Comments (Undergoing maintenance)





