AEM Developer Tools for Eclipse aem-developer-tools-for-eclipse
Overview overview
Experience Manager Developer Tools for Eclipse is an Eclipse plugin based on the Eclipse plugin for Apache Sling released under the Apache License 2.
It offers several features that make AEM development easier:
- Seamless integration with AEM instances through Eclipse Server Connector
- Synchronization for both content and OSGi bundles
- Debugging support with code hot-swapping capability
- Simple Bootstrap of AEM Projects by way of a specific Project Creation Wizard
- Easy editing of JCR properties
Requirements requirements
Before using the AEM Developer Tools, you need to:
- Download and install Eclipse IDE for Enterprise Java™ Developers.
- Configure your eclipse installation to ensure that you have at least 1 GB of heap memory by editing your
eclipse.ini
configuration file as described in the Eclipse FAQ.
eclipse.ini
.How to Install the AEM Developer Tools for Eclipse how-to-install-the-aem-developer-tools-for-eclipse
When you have fulfilled the requirements above, you can install the plugin as follows:
-
Open the AEM Developer Tools Web Site.
-
Copy the Installation Link.
Alternatively you can download an archive instead of using the installation link. This method allows offline installation but you do not receive miss automatic update notifications this way.
-
In Eclipse, open the Help menu.
-
Click Install New Software.
-
Click Add….
-
In the Name field, enter
AEM Developer Tools
. -
In the Location field, copy the installation URL.
-
Click Add.
-
Check both AEM and Sling plugins.
-
Click Next.
-
In the Install Details window, click Next again.
-
Accept the license agreements and click Finish.
-
Click RestartNow to restart Eclipse.
The AEM Perspective the-aem-perspective
In Eclipse, a Perspective determines the actions and views available within a window and enables task-oriented interaction with resources in Eclipse. For more details about Perspective, see the Eclipse documentation.
Experience Manager Development Tools for Eclipse provide an AEM Perspective that offers you full control over your AEM Projects and instances. To open the AEM Perspective:
- From the Eclipse menu bar, select Window > Perspective > Open Perspective > Other.
- Select AEM in the dialog and click Open.
Sample Multi-Module Project sample-multi-module-project
The Experience Manager Developer Tools for Eclipse comes with a sample, multi-module project that helps you quickly get up to speed with a project setup in Eclipse. It also serves as a best-practice guide to several AEM features. Learn more about the Project Archetype.
Follow these steps to create the sample project:
-
In the File > New > Project menu, browse to the AEM section and select AEM Sample Multi-Module Project.
-
Click Next.
note note NOTE This step might take a moment because m2eclipse must scan the archetype catalogs. -
Choose
com.adobe.granite.archetypes : sample-project-archetype : <highest-number>
from the menu, then click Next. -
Provide the following fields for the sample project:
- Name
- Group Id
- Artifact Id
- appId - You may need to expand the Advanced options to set this value.
- appTitle - You may need to expand the Advanced options to set this value.
- Package - You may need to expand the Advanced options to set this value.
-
Click Next.
-
You then configure an AEM server to which Eclipse connects.
To use the debugger feature, you need to have started AEM in debug mode - which can be achieved, for by adding the following to the command line:
code language-text -nofork -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=10123
-
Click Finish. The project structure is created.
note note NOTE On a fresh installation (more specifically, when maven dependencies have never been downloaded) you might get the project created with errors. In this case, follow the procedure describe in Resolving Invalid Project Definition.
How To Import Existing Projects how-to-import-existing-projects
You can use the New Project feature to create the right structure for you:
-
Follow the instructions to create a Sample Multi-Module Project and you have the following projects created for you, which permit a healthy separation of concerns:
PROJECT.ui.apps
for/apps
and/etc
contentPROJECT.ui.content
for/content
that is authoredPROJECT.core
for Java™ bundles (these become interesting when you want to add Java™ code)PROJECT.it.launcher
andPROJECT.it.tests
for integration tests
-
Replace the content of your
PROJECT.ui.apps
project with theapps
andetc
folders of your package:- In the Project Explorer panel, unfold
PROJECT.ui.apps
>src
>main
>content
>jcr_root
>apps
. - Right-click the
apps
folder and choose Show In > System Explorer. - Delete the
apps
andetc
folders that you should now see and place here theapps
andetc
folders of your content package. - In Eclipse, right-click the
PROJECT.ui.apps
project and choose Refresh.
- In the Project Explorer panel, unfold
-
Then do the same for the
PROJECT.ui.content
and replace its content folder with the one of your packages:- In the Project Explorer panel, unfold
PROJECT.ui.content
>src
>main
>content
>jcr_root
>content
. - Right-click the deeper content folder and choose Show In > System Explorer.
- Delete the content folder that you should now see and place here the content folder of your content package.
- In Eclipse, right-click the
PROJECT.ui.content
project and choose Refresh.
- In the Project Explorer panel, unfold
-
Now you have to update the
filter.xml
files of these two projects to correspond to the content of your content package. For that, open theMETA-INF/vault/filter.xml
file of your content package in a separate text/code editor.- This is an example of how your
filter.xml
file can look:
code language-xml <?xml version="1.0" encoding="UTF-8"?> <workspaceFilter version="1.0"> <filter root="/apps/foo"/> <filter root="/apps/foundation/components/bar"/> <filter root="/etc/designs/foo"/> <filter root="/content/foo"/> <filter root="/content/dam/foo"/> <filter root="/content/usergenerated/content/foo"/> </workspaceFilter>
- This is an example of how your
-
As for the content of your package that was split into two projects, you must also split these filter rules into two and update accordingly the
filter.xml
files of the two projects.-
In Eclipse, open
PROJECT.ui.apps/src/main/content/META-INF/filter.xml
. -
Replace the content of the
<workspaceFilter>
element with the rules of your package that start with/apps
and/etc
-
For example:
code language-xml <?xml version="1.0" encoding="UTF-8"?> <workspaceFilter version="1.0"> <filter root="/apps/foo"/> <filter root="/apps/foundation/components/bar"/> <filter root="/etc/designs/foo"/> </workspaceFilter>
-
-
Then open
PROJECT.ui.content/src/main/content/META-INF/filter.xml
. -
Replace the rules with the ones of your package that start with
/content
.-
For example:
code language-xml <?xml version="1.0" encoding="UTF-8"?> <workspaceFilter version="1.0"> <filter root="/content/foo"/> <filter root="/content/dam/foo"/> <filter root="/content/usergenerated/content/foo"/> </workspaceFilter>
-
-
-
Make sure to save all your changes. You can now synchronize that new content to your AEM instance.
-
In the Servers panel, make sure that your connection is started, and if not start it.
-
Click the Clean and Publish icon.
Once done, you should have your package running on your instance, and on save, any change automatically gets synchronized to the instance.
If you want to re-build a package out of your project, right-click the PROJECT.ui.apps
or PROJECT.ui.content
and choose Run As > Maven Install.
You now have a target folder created with your package inside (called, for example, PROJECT.ui.apps-0.0.1-SNAPSHOT.zip
).
Troubleshooting troubleshooting
Resolving Invalid Project Definition resolving-invalid-project-definition
To resolve invalid dependencies and project definition proceed as follows:
- Select all created projects.
- Right-click.
- In the context menu, select Maven > Update Projects.
- Check Force Updates of Snapshot/Releases.
- Click OK.
Eclipse downloads the required dependencies. This may take a moment.
More information more-information
The official Apache Sling IDE tooling for Eclipse website provides you with useful information:
- The Apache Sling IDE tooling for Eclipse User Guide, this documentation guides you through the overall concepts, server integration, and deployment capabilities supported by the AEM Development Tools.
- The Troubleshooting section.
- The Known issues list.
The following official Eclipse documentation can help to set up your environment: