This project should be used while starting new project based on AEM. Currently Gradle does not support Maven's like archetypes, so you have to copy this project at start and customize it for your needs. Documentation for AEM plugin is available in project Gradle AEM Plugin.
Tested on:
- Java 1.8
- Gradle 3.5
- Adobe AEM 6.2
- Install Gradle
- Use bundled wrapper (always use command
sh gradlew
instead ofgradle
). It will be downloaded automatically. - Use standalone from here.
- Use bundled wrapper (always use command
- Run
gradle idea
orgradle eclipse
to generate configuration for your favourite IDE. - Build application using commands:
gradle contentDeploy
or justgradle
,gradle bundleDeploy
.
- To run some task only for subproject, use project name as a prefix, for instance:
sh gradlew :content:aemSync
. - Bundle & content project can be combined into one. There is absolutely no need to have separate projects. Example project structure just tries to reflect Adobe Multi-Module Project Archetype.
- Declare bundle dependencies available on AEM (Maven's provided scope) in root project build.gradle in section
plugins.withId 'org.dm.bundle'
to avoid defining them separately for each subproject. - According to recommendations, Gradle daemon should be:
- enabled on development environments,
- disabled on continuous integration environments.
- If build caches to much, you could try with
--rerun-tasks
option. See this link for more details. - To see more descriptive details about errors, you could use
-i
,--stacktrace
,--debug
options. - To skip tests or any other task by name use
-x test
- Execute build with options
-Dorg.gradle.debug=true --no-daemon
, it will suspend, - Attach debugger on port 5005,
- Suspension will be released and build should stop at breakpoint.
For defining new tasks directly in build see:
The easiest way to implement custom plugins and use them in project is a technique related with buildSrc/ directory. For more details please read documentation.