How to Set Up AEM Projects Using Eclipse Plugin

 

Pre-Requisite: To have installed AEM Plugin. Refer to my prev blog to install AEM Plugin.

Once you have installed the plugin,

Step 1: Click on New > Project > Select ‘AEM Sample Multi-Module Project’ under AEM and click ‘Next’

Eclipse_AEMProject_New
Eclipse_AEMProject_New

Step 2: Choose a workspace or check on ‘Use default workspace’ and Select an Archetype and Click on ‘Next’. Sometimes, on windows you might have issue in getting Archetype. Then see here

Eclipse_AEMProject_Archetype
Eclipse_AEMProject_Archetype

Step 3: Enter the Project details like Name, Group Id and Artifact Id and Click ‘Next’

Eclipse_AEMProject_Details
Eclipse_AEMProject_Details

Step 4: Set up a new server. Enter the details and credentials. Click on ‘Finish’

Eclipse_AEMProject_ServerDetails
Eclipse_AEMProject_ServerDetails

Step 5: Project gets created with 5 modules. core, apps, content, tests and launcher with the below folder structure.

Eclipse_AEMProject_FolderStructure

  • core: Java bundle containing all core functionality like OSGi services, listeners or schedulers, as well as component-related Java code such as servlets or request filters.
  • ui.apps: contains the /apps (and /etc) parts of the project, ie JS&CSS clientlibs, components, templates, runmode specific configs as well as Hobbes-tests
  • ui.content: contains sample content using the components from the ui.apps
  • ui.tests: Java bundle containing JUnit tests that are executed server-side. This bundle is not to be deployed onto production.
  • ui.launcher: contains code that deploys the ui.tests bundle (and dependent bundles) to the server and triggers the remote JUnit execution

Step 6: Right click on the Servers and Click on ‘Add and Remove’. Add the modules which needs to be synched/deployed on the server and Click ‘Finish’

 

Eclipse_AEMProject_ServerConfig
Eclipse_AEMProject_ServerConfig

After, this once you start the server all the modules which are added gets deployed on the server and further you can develop. You can use ‘Export to Server’ and ‘Import from Server’ to push and pull the code.

In the current version of AEM plugin, there is a known issue in syncing cq node types cq:page, cq:widgetCollections etc.. Click here to see how to resolve the same.

28 thoughts on “How to Set Up AEM Projects Using Eclipse Plugin

  1. Hi,
    Thanks for this article. I could successfully get the Archetype by following the steps mentioned in your other article. But, here I am stuck after step-2. After selecting the archetype:7 and clicking on NEXT , the wizard gets stuck and I am unable to proceed to next step.
    There is no facility for attaching a screenshot here; hence just describing.Any help would be highly appreciated.
    Thanks,
    IP

     
    1. Mine does the same thing.

      For some reason if I choose Archtype 6 it seems to move forward in the project setup screens. Funky issue.

      Whats the difference between the different archtypes? Anyone know?

       
  2. Hi ,

    this is very useful article. But I am also stuck with the same problem that “Indranil Poddar” has mentioned in the above comments. I have also looked at http://adobeaemclub.com/configuring-aem-maven-archetype-for-eclipse-plugin/ and added the local repository. However, the problem is the wizard not showing the options you have shown in

    Step 3: Enter the Project details like Name, Group Id and Artifact Id and Click ‘Next’. However, when I click on next twice, it changes the title to “Create or select server. This step defines which server to use with the new project.”.

    Tried some other options to download the jar using command line as suggested on some other posts, but that also did not help.

    Any help / thoughts ?

    Regards,
    Ronak

     
  3. After clicking finish in last step I am getting the following error:

    Failed installing bundle : Unable to install/update bundle from dir E:\keplerworkspace\aemtestproject\core\target\classes : Unresolved constraint in bundle org.aem.test.aemtestproject.core [335]: Unable to resolve 335.0: missing requirement [335.0] osgi.wiring.package; (&(osgi.wiring.package=org.apache.sling.api)(version>=2.3.0)(!(version>=3.0.0)))
    Unable to install/update bundle from dir E:\keplerworkspace\aemtestproject\core\target\classes : Unresolved constraint in bundle org.aem.test.aemtestproject.core [335]: Unable to resolve 335.0: missing requirement [335.0] osgi.wiring.package; (&(osgi.wiring.package=org.apache.sling.api)(version>=2.3.0)(!(version>=3.0.0)))

    Can you please tell me how to solve this issue.

     
  4. I am not able to see the add/remove section under Servers. how can i sync my eclipse if i make changes directly in crxde. thoughts?

     
      1. Hi,
        I am trying to import vaultclipse path in Eclipse Luna, but i am getting the error “please correct the directory for vault.The current directory is incorrect”
        me vault directory path is :C:\Anjali\AEM\crx-quickstart\opt\vault-cli-3.1.6.

        please help out.

         
        1. Hi Anjali,
          Which version of Eclipse are you using ?
          Some latest eclipse version may not support it. Try the steps below

          1. Uninstall VaultClipse
          2. Install “Eclipse 2.0 Style Plugin Support”[*]
          3. Install VaultClipse

          [*]
          1. Go to Help->Install New Software
          2. Choose “The Eclipse Project Updates – http://download.eclipse.org/eclipse/updates/4.4” in “Work with” combo
          3. Select “Eclipse 2.0 Style Plugin Support” under “Eclipse Tests, Examples, and Extras”
          4. Go ahead

          After this restart Eclipse and try configuring vaultclipse.

           
          1. Hi,

            It’s still not working, I tried with Kepler ,

            Eclipse 2.0 Style Plugin Support”[*] – getting response in eclipse – it can’t be installed.

            Initially I was trying to give below path in vault configuration – E:\AEM\crx-quickstart\opt\filevault\vault-cli-3.1.16

            But it’s giving error –

            “please correct the directory for vault.The current directory is incorrect”

            Kindly help me.

            Thannks in advance !!!
            Even

             
  5. I downloaded Kepler Eclipse, downloaded AEM plugin and after i create project and set up server , i got this error while starting server. Any clue?? what I am missing??

    No repository found at http://localhost:4502/
    http://localhost:4502/server/-/jcr:root : java.net.ConnectException: Connection refused: connect
    http://localhost:4502/crx/-/jcr:root : java.net.ConnectException: Connection refused: connect
    No repository found at http://localhost:4502/
    http://localhost:4502/server/-/jcr:root : java.net.ConnectException: Connection refused: connect
    http://localhost:4502/crx/-/jcr:root : java.net.ConnectException: Connection refused: connect

     
  6. Hi,

    Thanks for sharing this info. This is very useful. However after selecting archetype am not able to proceed.

    As per you,
    Step 3: Enter the Project details like Name, Group Id and Artifact Id and Click ‘Next’.

    However, when I click on next twice, it changes the title to “Create or select server. This step defines which server to use with the new project.”.

    Any help on this would be highly appreciated.

     
    1. Check your proxy settings. It would be blocking from creating the project. Quick check you can try is to create the project from your home network and see if that works

       
        1. Hello Gaurav or anybody else, could you please let us know how you were able to solve the above problem?
          I am facing the same issue Step 3: Enter the Project details like Name, Group Id and Artifact Id and Click ‘Next’. However, when I click on next twice, it changes the title to “Create or select server. This step defines which server to use with the new project.”.
          Also you also asked to check proxy settings – do you mean the proxy settings in Eclipse? or could you elaborate? it doesnt work on my office laptop, it works on my personal laptop.

           
  7. I downloaded mars Eclipse, downloaded AEM plugin and after i create project and set up server , i got this error while starting server. Any clue?? what I am missing??

    No repository found at http://localhost:4502/
    http://localhost:4502/server/-/jcr:root : java.net.ConnectException: Connection refused: connect
    http://localhost:4502/crx/-/jcr:root : java.net.ConnectException: Connection refused: connect
    No repository found at http://localhost:4502/
    http://localhost:4502/server/-/jcr:root : java.net.ConnectException: Connection refused: connect
    http://localhost:4502/crx/-/jcr:root : java.net.ConnectException: Connection refused: connect

     
  8. Hi lokesh,
    I am a fresher from java background and moved to AEM practice.I really want to get expert in these tool but i need some guidance,Can you provide any guidance to start my profession in AEM and to get familiar about the tool

     
  9. Hi BSLOKESH,
    I am trying to import vaultclipse path in Eclipse Luna, but i am getting the error “please correct the directory for vault.The current directory is incorrect”
    me vault directory path is :C:\adobe\AEM\author\crx-quickstart\opt\filevault\vault-cli-3.1.16.
    I have tried with Mars, Luna R, Kepler, but not helping.

    please help out.

     
    1. Hi Radhakrishna,

      Try installing ‘vaultclipse’ plugin for eclipse directly from the marketplace and try.

      I was using this plugin before on Kepler, Luna and currently I use Eclipse Mars which works. You can download the latest eclipse from here https://eclipse.org/downloads/

      Else, Try the steps below

      1. Uninstall VaultClipse
      2. Install “Eclipse 2.0 Style Plugin Support”[*]
      3. Install VaultClipse

      [*]
      1. Go to Help->Install New Software
      2. Choose “The Eclipse Project Updates – http://download.eclipse.org/eclipse/updates/4.4” in “Work with” combo
      3. Select “Eclipse 2.0 Style Plugin Support” under “Eclipse Tests, Examples, and Extras”
      4. Go ahead

      After this restart Eclipse and try configuring vaultclipse.

       
      1. i am getting error while installing “Eclipse 2.0 Style Plugin Support”. could any one please provide another sollution?

         
      2. this is the error message i am getting .

        An error occurred while uninstalling
        session context was:(profile=epp.package.standard, phase=org.eclipse.equinox.internal.p2.engine.phases.Uninstall, operand=[R]org.eclipse.rcp.configuration_root.win32.win32.x86 1.0.0.v20130521-1847 –> null, action=org.eclipse.equinox.internal.p2.touchpoint.natives.actions.CleanupzipAction).
        Backup of file D:\Eclipse_kepler\eclipse-kepler\eclipse-2\eclipse\eclipse.exe failed.
        Can not remove : D:\Eclipse_kepler\eclipse-kepler\eclipse-2\eclipse\eclipse.exe

         
      3. Hi BSLokesh,

        I tried steps given by you but i ma still getting the same error “please correct the directory for vault.The current directory is incorrect”.

        I am using AEM 6.1 and eclipse Mars2. jdk 1.8.

        could you please suggest nay other way .

        –Saurabh

         

Leave a Reply

Your email address will not be published. Required fields are marked *