Hi Mike.

I'm using the almost the same config as you but subclipse instead of subversive and the easiest way I've found to get and build Sling in Eclipse is to use the "import..." option the the File menu. I also turn of the automatic build in Eclipse and instead use a run configuration to build Sling.

First create a new Workspace
1. Menu: File->Switch Workspace->Other...
2. Enter a path for the new workspace and click OK

When Eclipse has restarted its time to adjust some configs
1. Turn off automatic build (Menu: Project->Build Automatically)
2. Menu: Window->Preferences
3. In the preferences dialog select Java->Compiler->Errors/Warnings
4. Expand the "Deprecated and restricted API" and change "Forbidden references (access rules)" from "Error" to "Warning"
5. Click OK

Now its time to fetch 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.

When I've used Import to fetch Sling something in sling-builder seem to get a bit messed up but that can
simply be fixed with revert.
1. In the Project Explorer right click on the "sling-builder" project and select the Team->Revert... menu
2. A couple of changes (9 in my case) will be displayed
3. Click OK

Now its time to create a new run config used to build Sling
1. Make sure you're in the Java perspective (Menu: Window->Open Perspective)
2. Menu: Run->Run Configurations...
3. In the Run Configurationa dialog right click on "Maven Build" and select "New"
4. Change Name to "Build Sling"
5. Click "Browse Workspace..." and select "sling-builder"
6. Enter "clean install" in Goals
7. Click on the JRE tab
8. Enter "-Xmx256m -XX:MaxPermSize=128m" in "VM arguments"
11. Click Apply
12. Click Run

This should build Sling.

/Pontus

Mike Müller wrote:
Hi

I've got some problems to build sling in eclipse. Have tried no for hours to 
get rid off the error, but haven't succeeded, maybe just a little thing which I 
can't see, hope someone can help:

my environment:
windows xp sp 3
eclipse 3.4 with maven2-plugin (sonatype, newest) and subversive
installed maven 2.1.0
jre 1.5 und jdk 1.6

What I've done so far:

1) getting the sling source from svn (with eclipse subversive) which creates a 
java project with no builders called sling in the workspace
2) building the source with maven -> no problem
3) calling mvn eclipse:eclipse
4) import projects in eclipse with File/Import, choosing "Existing projects into 
Workspace", selecting the folder <workspace>/sling/bundles (because eclipse can't find the 
projects in the subfolders if I select only <workspace>/sling. choosing all projects.
5) eclipse tries to build the projects but gets a lot of following errors: xy 
cannot be resolved (Java Problem), first error is AdapterType cannot be 
resolved in ScriptableResourceTest.java, line 215.

It seems that eclipse tries to build with Java 1.4 (can't recognize 
generics...). But eclipse points to jdk 6, and there's no problem in other 
projects. I tried java 1.5 as well, no luck.

what have I missed?

best regards
mike


Reply via email to