sign inHome | Recent Changes | All Pages | HelpSearch:

Subversion with Eclipse

I’m posting this so i don’t forget it all the next time i need to do this :) Please edit and correct as you see fit if any of this is misleading.

I’m using the RadRails rails IDE on win XP. RadRails and Eclipse both use a plugin called Subclipse which adds a Subversion repository view.

I had set up my planet argon subversion repository following the clear instructions on this wiki’s Setup Subversion page. My particular repository location looked like this:

svn+ssh://vu2094@neon.planetargon.com/home/vu2094/svn/myProject

I added this as a new repository to RadRails. I was able to brwose the repository through the GUI. The problem was though, that i was asked for my password many times for each operation involving the repository.

Free software

You’ll need a couple of things for the next steps if you don’t have them already.

putty.exe plink.exe puttygen.exe

I downloaded these and put them both in a directory called ‘Putty’ in my programs directory.

Setting up a public/private key pair

In order to avoid having to give a password it’s necessary to set up a public/private keypair. The private key file lives on your local machine, the public key file is placed in a special location on the server that you will be ssh-ing to (ie. on your planet argon server).

Here’s a digest of the steps i took:

  1. Using puttygen.exe i created a public and private SSH-2(RSA) keypair.
  2. From the puttygen interface i saved the private key file to my local machine and took note of the path.
  3. I copied the public key text from the puttygen interface to my system clipboard.
  4. Using putty i logged into my planet argon account via ssh (giving my username and password).
  5. I typed ls -al (enter) to check which directories and files were already present, including hidden files (i was checking whether there was already a ’.ssh’ directory).
  6. there wasn’t. So i ran ‘mkdir .ssh’ to create one (The name of this directory is significant).
  7. ‘cd .ssh’ to enter the new directory
  8. ‘emacs authorized_keys’ creates a new text file in the current directory and opens it in emacs (text editor) for editing.
  9. right clicking in the terminal window should paste the contents of the clipboard into the file.
  10. then [Ctrl]+x followed by [Ctrl]+s saves the file.
  11. [Ctrl]+x followed by [Ctrl]+c to exit emacs.
  12. Follow the directions for setting up the correct permissions for Password-less SSH Login?
  13. At this point you can use putty.exe to test whether the keys are working. Load your planet argon session, then go to the SSH>Auth section, then browse and find your private key for the ‘Private Key File for authentication’ field. Go back to the sessions page and save the session (this time your private key location is included). Optionally store your username too so you don’t have to enter that each time (connection>data>‘auto-login username’).
  14. Clicking ‘open’ in putty should now log you in to an ssh session without asking for your username or password. At this point you knnow the keypair is working.

Configure Subversion to ‘see’ your private keyfile

To get subclipse working properly in Radrails or Eclipse, your copy of Subversion needs to know where your ssh client is (in our case plink.exe) and where your private keyfile is too.

  1. Download the putty tool ‘plink.exe’ and put it somewhere sensible on your system.
  2. Open this file in a text editor C:/Documents and Settings/[username]/Application Data/Subversion/config
  3. Find the line that begins ’## ssh=’
  4. Remove the hashes and edit the line so it points to the location of plink.exe and the location of your private key file. (There are some option codes included too ‘-2’ for the ssh version, and ‘-i’.. i don’t know what that means)

In my case the edited line reads as follows:

ssh = C:/Program Files/Putty/plink.exe -2 -i C:/Documents and Settings/myUserName/My Documents/privatekey2.ppk

edit: Check this page for the options that you can invoke plink with.. it may be simpler to specify a saved putty session name as the only argument.

Configure \RadRails/Subclipse to use the right SVN interface

At this stage subclipse still wasnt managing to connect to the repositories.. it turns out i had to tell Subclipse to use the \JavaSVN SVN interface (and not the \JavaHL one). In \RadRails (and eclipse i think) go to Window > Preferences > Team > SVN and select the ’\JavaSVN (Pure java)’ radio button in the ‘SVN interface’ fieldset.

Now you should be set to have GUI access to your planet argon SVN repository (or repositories) from within RadRails or Eclipse.

To add your repository to RadRails

  1. In RadRails choose Window > Show View > SVN Repository
  2. right-click in the newly opened repository pane and select ‘New > Repository Location’
  3. Type out the full address of the repository, like: svn+ssh://vu2094@neon.planetargon.com/home/vu2094/svn/myProject

Resources

I followed the guides at:

http://www.tartarus.org/~simon/puttydoc/Chapter8.html http://subclipse.tigris.org/servlets/ReadMsg?list=users&msgNo=3334

Update

i have been unable to recreate these results after the first time i had it working :( Now i’ve chosen ‘password authentication’ in the JavaSVN dialogue which seems a bit slow, but works (choosing the private key based authentication option resulted in the connection dialogue box opening repeatedly each time i tried to confirm the settings).


Powered by JunebugWiki v0.0.28 Last edited by robbyrussell on February 06, 2007 02:34 AM (diff)
Version 2 (current) «olderversions