This project could be used to start developing application based on AEM.
To start developing project based on AEM it is recommended to use Gradle AEM Multi instead.
Documentation for AEM plugin is available in project Gradle AEM Plugin.
Gradle AEM Plugin 6.x serie and upper will no longer support Groovy DSL and stands on Kotlin DSL coming with Gradle 5.0.
Documentation for:
- migrating Groovy DSL to Kotlin DSL (official Gradle docs).
- previous 5.x serie (navigates to branch
groovy
),
-
Fork project using command:
git clone [email protected]:Cognifide/gradle-aem-single.git && cd gradle-aem-single && ./gradlew fork
and specify properties:
and wait until project is forked then enter configured target directory.
-
Setup user specific project configuration using command:
./gradlew props
and specify properties:
-
Setup local AEM instances and dependencies then build application using command:
./gradlew setup
and wait till complete AEM environment will be ready to use.
-
Develop continuously application using command:
./gradlew
Tested on:
- Java 1.8
- Gradle 5.4.1
- Adobe AEM 6.5
- Install Gradle
- Use bundled wrapper (always use command
gradlew
instead ofgradle
). It will be downloaded automatically (recommended). - Use standalone from here.
- Use bundled wrapper (always use command
- Run
gradlew idea
orgradlew eclipse
to generate configuration for your favourite IDE. - Build application and deploy using command:
gradlew
<=>:aemSatisfy :aemDeploy :aemAwait
- To run some task only for subproject, use project path as a prefix, for instance:
gradlew :aem:app.design:aemSync
. - According to recommendations, Gradle daemon should be:
- enabled on development environments,
- disabled on continuous integration environments.
- To see more descriptive errors or want to skip some tasks, see command line documentation.
Certain unit tests may depend on the results of running gradle tasks. One such example is the testing of OSGi Services using OSGi Mocks where in order to run a test, the SCR metadata must be available for a class. Running a test like this in IntelliJ results in errors because the IDE is not aware of the Bundle plugin.
This can be worked around by configuring IntelliJ to delegate test execution to Gradle. In order to set this up, go to Settings > Build, Execution, Deployment > Gradle > Runner and set your IDE to delegate IDE build/run actions to Gradle. Alternatively, you can use a dropdown menu to use a specific runner or to decide on a test-by-test basis.
- 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.