Setting up Eclipse IDE has been edited by Janandith Uditha Jayawardena (May 28, 2008).

(View changes)

Content:

Eclipse is one of the favourite development environments among JAVA developers. At first glance setting up Eclipse to work with Sling is confusing so this article is  intended to help you get going with Sling development using Eclipse without pain.

Eclipse can be used to checkout code from the Sling repository and source build using maven. You can add new modules and re-build using maven inside Eclipse.

The tutorial describes how to setup the development environment for Eclipse version 3.3.2 (Europa). 

Here is how you work this magic.

Install Subclipse plug-in for Eclipse

To use subversion in eclipse you have to install the Subclipse plug-in using the following Eclipse update location,

        http://subclipse.tigris.org/update_1.2.x

Steps to install Subclipse plug-in,

    1.  In Eclipse IDE go to Help - > Software Updates - >  Find and Install.

    2.  Select "Search for new features to Install" and clickk next.

    3.  Click on the button "New Remote Site" in the window and enter a name ex: Subclipse and the URL specified above in the URL: field and click "OK".

    4.  The new name you specified will appear in the "Sites to include in search:" window select this and click finish.

    5.  In "Select  features to install" window select Subclipse and click "Finish" button. Deselect Mylin and Buckminister Integrations if "Finish" Button appears inactive.( I didn't find any use in the integrations and the "Finish" button was not active until I deselected them).

   6.   Agree to the licence agreement and proceed to install once Eclipse prompts you.

   7.   After installing you have to restart Eclipse. You can view repositories by going to Open Perspective - > Other - > SVN Repository Exploring.

Install Maven2 plugin for Eclipse

 To use the maven 2 plug-in you have to install the maven 2  plug-in using the following Eclipse update location,

         http://m2eclipse.sonatype.org/update/

    Please follow the steps 1 to 4 described in "Install Subclipse plug-in for Eclipse" section using the above URL.

    in Step 5 as before deselect Mylin Integration if "Finish" Button appears inactive.( I didn't find any use in the integrations and the "Finish" button was not active until I deselected them).

    Then agree to the licence agreement and proceed to install once Eclipse prompts you. Once you restart it's possible to use maven.

Creating a Maven 2 + Java  project.

 To checkout and edit or add new modules to Sling you have to first create a Java + Maven 2 project in eclipse. You must see a red "m" icon and blue "J" icon on the project directory.

 Follow these steps to create a Maven 2 + Java project.

   1. Go to File - > New - > Project and select Maven Project by expanding Maven folder in the "Select a wizard" menu and click next.

   2. select the location to you want to checkout source from the repository. and click next.

   3. Click next in this screen and when you come to the next screen then set the following.

      Group Id : org.apache
      Artifact Id : Sling

      Click finish.

      This is a step where the IDE creates a pom.xml file for the new project using the details entered in Step 3.
      The values we enter here are not important because we will be replacing this pom.xml when we are checking out the source.

      The IDE insists that there should be values entered in this step or you will not be allowed to create the project. Therefore don't worry much about what you entered in Step 3 before clicking "Finish".

     

Reply via email to