Setting up Eclipse 3.4 for Sling has been created by Mike Mueller (Apr 16, 2009).

Content:

To setup the Eclipse IDE to work with the Sling project properly seems to be not very straightforward at a first look, but be calm, it's not rocket science to do. This little manual should help you to setup Eclipse for Sling fast:

Prerequisites

  • Installed Eclipse Ganymede (tested with 3.4.2 on Win XP, SP3)
  • Installed Maven2 (tested with 2.1.0)
  • Installed M2Eclipse plugin for Eclipse (sonytype) -> instructions
  • Installed Subversive plugin or Subclipse-plugin for Eclipse

If you use the Subversive plugin make sure you have installed the "Subversive Integration for M2Eclipse Project" which can be found under the following Eclipse update site: http://community.polarion.com/projects/subversive/download/integrations/update-site/.

Make also sure, that you have installed either the "Maven SCM handler for Subclipse" or the "Maven SCM handler for Subversive"

Create a new workspace

It's best to create a new workspace for the sling project:

  1. Menu: File->Switch Workspace->Other...
  2. Enter a path for the new workspace and click OK
  3. When Eclipse has restarted its time to adjust some configs
  4. Turn off automatic build (Menu: Project->Build Automatically)
  5. Go to menu: Window->Preferences, in the preferences dialog select Java -> Compiler -> Errors/Warnings
  6. Expand the "Deprecated and restricted API" and change  "Forbidden references (access rules)" from "Error" to "Warning"
  7. Click OK 

Get the Sling source

  1. Menu: File->Import
  2. In the Import wizard select Maven->"Check out Maven Projects from SCM"
  3. Click next
  4. In the "SCM URL" field pick "SVN" and enter the url "http://svn.apache.org/repos/asf/incubator/sling/trunk"
  5. Click Finish

Eclipse will now start to download the source and import the Maven projects. You might encounter some "Problem Occured" dialogs about "An internal error..." but just click OK on those and let Eclipse continue with the import. Be warned: This could take some time (it was 30 minutes on my lap)!

Reply via email to