Eclipse Tutorial

Managing Projects

Overview

For this course, we need a mechanism that allow us to achieve the following goals:

We will be using CVS to achieve the above goals. CVS is an utility used to keep track of the history of files that you (and possibly other people) are utilizing.

Notice that recent Eclipse releases require you to add a CVS plugin (earlier Eclipse versions had default CVS functionality). See the Installing Eclipse section for information regarding installation of this plugin.

In CVS a repository is a location where files are stored. For this course, we have set up a repository for each student from where all files associated with a project will reside. It is this CVS–managed repository that allow us to achieve the goals described above. When files associated with a project are distributed in the course, they are distributed by placing copies of the files in each student's repository. Students can then retrieve these files by completing a process called “check out.” Students can work on their code and save the files in the repository by completing a process called “submit.” The repository of each student resides in a computer system we call the grace.umd.edu which will be accessed via a network connection. That means that if you work at home and save your files in the repository you will have access to those files from a computer at school.

In order to have access to your repository, you need to set up a repository in Eclipse. This is a process you only need to do once. After this process have been completed, you will be able to manage all the projects in the repository.

Changing to CVS perspective

Select Window → Perspective → Open Perspective → Other → CVS Repository Exploring. You will see the following window:

CVS Repository Exploring window

Creating a new repository location

In order to set up a repository you need an account in the computer system (host) where your repository resides. Ask your instructor for information regarding how to obtain the CVS class account.

To “connect” to your repository you need to create a new repository location by right clicking on the white empty pane that can be found under the title "CVS Repositories" and selecting New → Repository Location…. Once you have completed your selection a dialog will come up that will let you define a new CVS repository. The following is an example on how to connect to your repository assuming the following information (remember, this is not the information you will use, this is just an example). Keep in mind that the user(account) appears at the end of the Repository base directory. In our example that is nelsonp, but for you it should be your directory id/account id.

Add CVS Repository window

The host, repository base directory, user account, and password change every semester and for every class. Contact your class coordinators for more information.

While creating the repository, check the “Save Password” option so that you do not have to provide the password every time you access the repository. You must complete the above process only once in the semester from any machine you are planning to run Eclipse. Click on Finish, and you should get a line in that pane that says something like:

::extssh:nelsonp@grace.umd.edu:/afs/glue/ ...

Accessing repository contents

  1. Click on the triangle at the start of the line identifying the repository. You should see three lines (HEAD, Branches, Versions).
  2. Click on the triangle at the start of the line that says “HEAD.”
  3. It will show “Pending…” as it loads data from the repository. Then, you should see folders representing projects that are available. For example, assuming your teacher already posted a project named p1 you should see something similar to the following:

accessing repository contents

Checking out a project

If you want to transfer all the files associated with a project:

  1. Make sure your current perspective is the CVS Perspective.
  2. Access the repository contents.
  3. Right-click on the project folder (e.g., p1 in the above screenshot) you are interested in, and select “Check Out.”
  4. After checking out a project you should have a new project in your workspace with a name that corresponds to the folder name.

Submitting a project

If you have downloaded and installed all the necessary Eclipse plugins then you can submit your project by switching to the Java perspective, right clicking on your project folder in the package explorer, and selecting “Submit Project…” from the context menu.

CVS Connection Problems