This project could be used to start developing long-term project based on AEM.
To start developing application/library based on AEM it is recommended to use Gradle AEM Single instead.
Documentation for AEM plugin is available in project Gradle AEM Plugin.
Main motivation of this project is to automate all aspects of AEM development and make it a breeze.
Archetyping:
Environment:
Back-end:
Front-end:
Testing:
Maintenance:
Fork project using command:
git clone https://github.com/wttech/gradle-aem-multi.git && cd gradle-aem-multi && sh gradlew fork
and specify properties:
and wait until project is forked then enter configured target directory.
Setup user specific project configuration using command:
sh gradlew props
and specify properties:
Setup local AEM instances with dependencies and AEM dispatcher (see prerequisites) then build application using command:
sh gradlew environmentHosts
sh gradlew setup
and wait till complete AEM environment will be ready to use.
Develop continuously application using command:
sh gradlew
which is an alias for:
sh gradlew develop
or to just deploy AEM application (without running anything else):
sh gradlew :app:aem:all:packageDeploy
Tested on:
Project is configured to have local environment which consists of:
Assumptions:
/content/example
content root on publishgradlew
so that Gradle in version according to project will be downloaded automatically.sh gradlew
<=> sh gradlew :develop
sh gradlew :app:aem:all:packageDeploy
sh gradlew :app:aem:core::bundleInstall
,sh gradlew :app:aem:ui.apps:packageDeploy
,sh gradlew :app:aem:ui.content:packageDeploy
.sh gradlew :app:aem:ui.frontend:build
sh gradlew instanceTail
sh gradlew :app:aem:ui.content:packageSync
sh gradlew environmentDev
sh gradlew instanceRcp -Pinstance.rcp.source=http://user:pass@x.x.x.x:4502 -Pinstance.rcp.target=local-author -Pinstance.rcp.paths=[/content/example,/content/dam/example]
sh gradlew :app:aem:ui.content:packageDeploy
.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.
-Dorg.gradle.debug=true --no-daemon
, it will suspend,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.