Import Sakai source into Eclipse

  1. Startup eclipse if it is not running
  2. Create a new workspace for Sakai
    1. Click on File -> Switch Workspace
    2. Enter "WS-Sakai" in place of the default "workspace" directory
    3. Click OK (eclipse will restart)
      • The following steps should be done in the WS-Sakai workspace
  3. Add Maven Repository libraries to classpath
    1. Select Window -> Preferences -> Java -> Build Path -> Classpath Variables
    2. Add MAVEN_REPO classpath variable with the path to the local maven repository (Sakai 2.4 or lower)
      • The path should be: $USER_HOME/.maven/repository
    3. Add M2_REPO classpath variable with the path to the local maven repository (Sakai 2.5 or higher)
      • The path should be: $USER_HOME/.m2/repository
  4. Switch to the Java perspective (Window -> Open Perspective -> Java)
    • Make sure you are in the package explorer
  5. Turn off Automatic builds
    • Select Project and uncheck Build automatically
  6. Select File -> Import -> Existing Projects into Workspace
    1. Enter the full path to the sakai source directory for the root directory
      • This should be /opt/cafe-2.2.x if you followed the steps in this document
    2. Click Deselect All to unselect all projects
    3. Select the following projects (you only need most of the APIs, a few utils, and all of the db projects)
      alias-api
      announcement-api
      archive-api
      authz-api
      component-api
      content-api
      courier-api
      cm-api
      db-api
      db-impl
      db-util
      entity-api
      email-api
      event-api
      jsf
      message-api
      master
      site-api
      site-manage-api
      tool-api
      user-api
      user-util
      util-api
      util-util
      velocity
      • NOTE: You can just import all the projects also, this tends to work fine for me
    4. Click Finish to import the selected projects
      • This will take awhile, probably 5+ minutes
  7. Create a working set for Sakai (optional)
    • You do not have to create a working set, these are here in case you want to
    1. Switch to the Java perspective
    2. In the Package Explorer pane click the drop-down arrow menu and choose Select Working Set
    3. Click the New button from the Select Working Set Dialog window
    4. Choose Java for the Working Set Type and click Next
    5. Enter Sakai as the name for your Working Set
    6. Select the imported Sakai projects and click Finish
  8. Build Sakai in Eclipse
    • Initially you will get build failures on almost every Sakai project, this is because they are building in the default order and their dependencies are in a different order, this has been partially addressed in Sakai 2.2
    1. Clean all Sakai projects
      1. Select Project -> Clean
      2. Select Clean all projects
      3. Check Start a build immediately
      4. Click OK
    2. Build All (Project -> Build All)
      • Do this if using working sets:
        Build the Sakai working set (Select Project -> Build Working Set -> Sakai)
      • Repeat this step until no errors remain (should be no more than 3-4 times)
      • There will be hundreds of warnings, do not worry about these
  9. Turn back on Automatic builds
    • Select Project and check Build automatically
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.