IDE Tutorials CSE 219 Fall 2005


  TOC: AkA Tactical Operations Center
Table of Contents: NetBeans Eclipse
Basics Tutorial NetBeans Eclipse
Debugging Tutorial NetBeans Eclipse
JUnit Testing Tutorial NetBeans Eclipse
CVS Tutorial NetBeans Eclipse
JAR Files Tutorial NetBeans Eclipse
CSE 219 HomePage

Eclipse and cvs

Eclipse has rather extensive support for cvs across all kinds of connections. This tutorial will show you how to setup a repository and connect to it through ssh via eclipse.

http://www.eclipse.org/

  Back to the old School
Since we are going to use cvs by hand for the first few setps the first step is to log into the server with your cvs repository. In our case this is ug.cs.sunysb.edu. Connect to this through ssh. Type bash to start the bash shell. This will make your life easier.




  Setting up our repository
We now have to create our repository. If you already have one then you can skip the mkdir part and fill in the rest of the steps with your directory. cvs will look at the environment variable CVSROOT to find where the repository is. so follow the steps in the image filling in the directory you chose as your cvs root in plave of my directories. If you do not want to set the CVSROOT variable every time you do this you can open the .bashrc file in your home directory with a text exitor and place the lines under mkdir into tht file excluding the echo. This will automatically set the variable for you every time you log in.




  Initializing the repository
This step tells cvs to put all the important files that are needed to use a cvs repository into our cvsroot. NOTE!!!! only do this step once. If you do it again you will destroy your repository with no hope of getting it back.




  Getting our cvsroot
Eclipse does not know how to resolve the ~ in a path so we have to explicity give the path to our repository. To get the path go into the directory and type pwd.




  Enter Eclipse
Once we have done the other steps we can get to eclipse. Open eclipse and then open a project in it. Then goto window open perspective. If cvs repository exploring isnt there then click on other and select it from the menu.




  Adding a repository.
Now that we have the repository browser we can add our repository. To do this either right click and select add repository or click the new repository icon on the bar at the top of the browser.




  Our new repository 1
There are several important fields here. First enter the ug server's address into host and for repository path place the full path that we obtained from pwd earlier. After that put your user name and password into authentication. Now this is important. For connection type select extssh. After this you can select to save your passworf if you want and then click finish.




  Our new repository 2
You will not notice that we have a repository in the browser expand it by clicking on the + next to the name. and then click on the + next to the HEAD folder.




  The Content
you will notice that there is a CVSROOT folder here. you should never touch this folder because it can cause tremendous problems with your repository. Any new projects you add to the repository will be under the HEAD folder in here just like CVSROOT.




  Sharing
You have 2 options for sharing a project. You can either go into the resource browser, then right click ont he project then goto team and click share. or you can open up the Team Synchronization perspective then select the project in the resource manager and under project click share project.




  Selecting our repos
A new window will pop up with which repositories that you have added into eclipse. I have two in the image but you will only have one. Select the one you want and click next.




  Naming
On this page you select the name for your module in CVS. It is just fine to use the project name and click next again.




  Importing
At this point you have added everything to be imported so just click finish.




  Importing part 2
Just click yes here we skipped a step that would require us to do this manually for every file.




  The message
This sections is the same as if we specified -m for an import. This will associate the message you enter with version 1.0 of all the files you are adding.




  Checking the import
At this point if you go back to your repository browser you will see a new folder under the HEAD folder. This will be the code you just commited.




  Checking file histories
To check the history of a file just right click on it in the CVS browser and click show history and it will show you all the commits and the comments forthem. For all other cvs oporations you can just right click the project or file in the resource browser and goto the team sub menue to see them all.




  Questions Comments Complaints?
If you have any questions or a way to make the tutorials better please speak with me or email me at dquigley at ic dot sunysb dot edu



(c) David Quigley