Checkout Drupal CVS into the Eclipse Workspace

Last modified: December 6, 2007 - 19:13

Eclipse is a good way for developers to contribute to Drupal, it has integrated CVS Support and a good PHP Plugin for full PHP4/PHP5 support including a debugger, syntax highlighting, code completion and more.

Installing Eclipse with PHP Support

Grab a copy of Eclipse from eclipse.org/pdt. The installation is easy. Extract the zip file and start Eclipse.

Checkout Drupal in your Eclipse workspace

The easiest way to get Drupal into your Eclipse Workbench is the "Import from CVS" feature.

  1. Start Eclipse and open the File/Import... Dialog.
  2. Choose "Checkout Projects from CVS", click Next then choose "Create a new repository location" and click "Next"again.
  3. For Anonymous Access to the Drupal CVS insert the following information:
    • Host: cvs.drupal.org
    • Repository Path: /cvs/drupal
    • User: anonymous
    • Password: anonymous
    • Connection type: pserver
    • Also make sure "Save Password" is checked.
  4. As a developer for contrib you must type:
    • Repository Path: /cvs/drupal-contrib
    • User: your username as filled out in the CVS access form
    • Password: your password
  5. In the "checkout Module" dialog select "Use an existing module" and choose the module you want, "drupal" for the Drupal core, or "contribution" for the 3rd party modules and themes. Click "Next".
  6. Check out the module with the "New Project Wizard" and select the branch you want, this is usually "HEAD", now press "Finish".
  7. In the "New Project Wizard" select PHP/PHP Project as project type. This project type only appears if you have PHP Eclipse installed, if you don't have PHP Eclipse installed use "Simple/Project" instead.
  8. Give the module an useful name like "drupal-contrib" and press finish.
  9. Once the CVS checkout starts, the contrib module take a long time (around 15 Minutes), so don't be impatient.

If you want multiple Drupal versions...

Owen Barton - April 4, 2007 - 22:25

...then an easier way is to use the team project set over at http://drupal.org/node/80667

This can checkout all core version branches and also contrib branches and create projects for each in a single swoop!

Try not to use the checkout wizard

yettyn - September 12, 2007 - 13:34

I found it better to NOT use the New Project Wizard but instead the "checkout as project in the workspace" option. It gives more control and I also found the wizard liked to do some fancy tricks without asking me first, merging with another project I had "next door". It will also put the checked out folder as a sub folder of the project folder. the "checkout as project in the workspace" option gives the possibility to checkout and project folder as one and the same root folder, if you want to.

Drawbacks of not using the checkout wizard

flobruit - February 1, 2008 - 19:38

The drawback to using "checkout as project in the workspace" is that eclipse will not recognize the project as a php project, so all of the php-related functionalities (autocompletion, function browser, etc) will not be available.

you can do r.m.b. 'Configure > Add PHP Support' for a project

aenw - October 4, 2009 - 00:26

disclaimer: I'm new to Eclipse (well, last time I tried it was when it was originally released. Been just a wee while.) and just figuring out how to get things set up for Drupal development with it. But that said...

I'm using Eclipse 3.5.1 with PDT 2.1.3, and once I've checked out a project using CVS, I can then select the project and bring up a context menu using the right mouse button (r.m.b.), then select Configure > Add PHP Support and that enables those "php-related functionalities."

I bet there's a configuration you can change in Eclipse so that the default project type created is what you want (PHP).

At the moment checking out

whatdoesitwant - January 15, 2010 - 08:47

At the moment checking out Drupal HEAD gives me the current version of D7. What is the command for getting the current version of D6? The suggested team project is supposedly set to checkout Drupal 4 and 5 as well but i do not need them.

...of je stopt de stekker erin.

 
 

Drupal is a registered trademark of Dries Buytaert.