DekGenius.com
Previous Section  < Day Day Up >  Next Section

Recipe 6.3 Connecting Eclipse to a CVS Repository

6.3.1 Problem

You want to connect Eclipse to a CVS repository.

6.3.2 Solution

In Eclipse, open the Repositories view, right-click that view, and select New Repository Location, opening the Add CVS Repository dialog. Enter the required information, and click OK.

6.3.3 Discussion

You have to establish a connection from Eclipse through the CVS server to the CVS repository before working with that repository. First, make sure your CVS server is running.

To connect Eclipse to the CVS repository, select Window Open Perspective Other, and select the CVS Repository Exploring perspective. After you do this the first time, Eclipse adds this perspective to the Window Open Perspective submenu and also adds a shortcut for this perspective to the other perspective shortcuts at the extreme left of the Eclipse window.

When the CVS Repository Exploring perspective opens, right-click the blank CVS repositories view at left, and select New Repository Location, opening the Add CVS Repository dialog shown in Figure 6-3.

Figure 6-3. Connecting Eclipse to a CVS repository
figs/ecb_0603.gif


In the Add CVS Repository dialog, enter the name of the CVS server, often the name of the machine hosting the CVS server, and the path to the CVS repository. To connect to the CVS server, you'll also need to supply a username and password, as shown in Figure 6-3 (in this case we're using integrated Windows NT security, so no password is needed). You can use two connection protocols with CVS servers, SSH (secure shell) and pserver. We'll use pserver here.

pserver is a CVS client/server protocol that uses its own password files and connections. It's more efficient than SSH but less secure. If security is an issue, go with SSH.


Click Finish after configuring the connection. The new connection to the CVS server should appear in the CVS Repositories view, as shown in Figure 6-4.

Figure 6-4. A new repository created in the CVS Repositories view
figs/ecb_0604.gif


A public CVS server is available that gives you access to the code for Eclipse; go to :pserver:anonymous@dev.eclipse.org:/home/eclipse.

If you wish, you can see what commands Eclipse sends to the CVS server. To do so, open the CVS console by selecting Window Show View Other CVS CVS Console. The CVS Console view will appear (this view overlaps the standard Console view).


6.3.3.1 Eclipse 3.0

Eclipse 3.0 also supports CVS SSH2 in addition to the pserver and SSH protocols. You can enable SSH2 in the SSH2 Connection Method preference page (right-click a project and select Team CVS SSH2 Connection Method). All CVS server connections of type extssh will use SSH2 from that point on.

6.3.4 See Also

Chapter 4 of Eclipse (O'Reilly).

    Previous Section  < Day Day Up >  Next Section