Giter Site home page Giter Site logo

wttech / gradle-aem-single Goto Github PK

View Code? Open in Web Editor NEW
9.0 14.0 7.0 1.38 MB

Example Single-Module AEM application built by Gradle Build System

Home Page: https://tech.cognifide.com/tag/gradle-aem-plugin

License: Apache License 2.0

Shell 23.98% Java 6.48% Kotlin 68.97% Groovy 0.56%
aem aem-tools adobe-experience-manager cq apache-sling java kotlin gradle gradle-aem-plugin

gradle-aem-single's Introduction

WTT logo

Gradle Status Apache License, Version 2.0, January 2004

Gradle AEM Plugin logo

AEM Single-Project Example

Description

This project could be used to start developing application/library based on AEM.

To start developing long-term project based on AEM it is recommended to use Gradle AEM Multi instead.

Documentation for AEM plugin is available in project Gradle AEM Plugin.

Table of Contents

Quickstart

  1. Fork project using command:

    git clone https://github.com/wttech/gradle-aem-single.git && cd gradle-aem-single && sh gradlew fork

    and specify properties:

    Fork Props Dialog

    and wait until project is forked then enter configured target directory.

  2. Setup user specific project configuration using command:

    sh gradlew props

    and specify properties:

    Fork Props Dialog

  3. Setup local AEM instances and dependencies then build application using command:

    sh gradlew setup

    and wait till complete AEM environment will be ready to use.

  4. Develop continuously application using command:

    sh gradlew

Environment

Tested on:

  • Java 1.8
  • Gradle 6.3
  • Adobe AEM 6.5

Building

  1. Use command gradlew so that Gradle in version according to project will be downloaded automatically.
  2. Deploy application: sh gradlew <=> sh gradlew :packageDeploy

Tooling

  1. Monitoring errors in logs: sh gradlew :instanceTail,
  2. Synchronizing JCR content from AEM to local file system: sh gradlew :sync,
  3. Copying JCR content between AEM instances: sh gradlew :rcp -Prcp.source=http://user:[email protected]:4502 -Prcp.target=local-author -Prcp.paths=[/content/example,/content/dam/example]

Tips & tricks

  • 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.

Running tests

IntelliJ

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.

Attaching debugger

  1. Execute build with options -Dorg.gradle.debug=true --no-daemon, it will suspend,
  2. Attach debugger on port 5005,
  3. Suspension will be released and build should stop at breakpoint.

Extending build

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.

gradle-aem-single's People

Contributors

ahmed-musallam avatar dawidklos avatar devzbysiu avatar mierzwid avatar pun-ky avatar twiernik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gradle-aem-single's Issues

Introduce Baseline Report for Validating Bundle Versions

The Maven Bundle Plugin automatically detects changes in public packages and checks if a version update is required.
Example:

[INFO] Baseline Report - Generated by Apache Felix Maven Bundle Plugin on 2018-08-17T12:30Z based on Bnd - see http://www.aqute.biz/Bnd/Bnd
[INFO] Comparing bundle org.apache.sling.dynamic-include version 3.2.0-SNAPSHOT to version 3.1.2
[INFO]
[INFO]   PACKAGE_NAME                                       DELTA      CUR_VER    BASE_VER   REC_VER    WARNINGS
[INFO] = ================================================== ========== ========== ========== ========== ==========
[INFO] * org.apache.sling.dynamicinclude                    major      4.0.0      4.1.0      5.0.0      Version increase required
[INFO]      > class org.apache.sling.dynamicinclude.Configuration
[INFO]          - method getExtension()
[INFO]              - return java.lang.String
[INFO]          - method hasExtension(org.apache.sling.api.SlingHttpServletRequest)
[INFO]              - return boolean
[INFO]          - method hasExtensionSet()
[INFO]              - return boolean
[INFO]      < class org.apache.sling.dynamicinclude.IncludeTagFilter
[INFO]          + method foo()
[INFO]              + return java.lang.String
[INFO]      + version 4.0.0
[INFO]      - version 4.1.0
[INFO] -----------------------------------------------------------------------------------------------------------
[INFO]   org.apache.sling.dynamicinclude.generator          unchanged  3.0.0      3.0.0      3.0.0      -
[INFO] -----------------------------------------------------------------------------------------------------------
[INFO]   org.apache.sling.dynamicinclude.generator.types    unchanged  3.0.0      3.0.0      3.0.0      -
[INFO] -----------------------------------------------------------------------------------------------------------
[INFO]   org.apache.sling.dynamicinclude.pathmatcher        unchanged  3.0.0      3.0.0      3.0.0      -
[INFO] -----------------------------------------------------------------------------------------------------------
[ERROR] org.apache.sling.dynamicinclude: Version increase required; detected 4.0.0, suggested 5.0.0
[INFO] Baseline analysis complete, 1 error(s), 0 warning(s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25.715 s
[INFO] Finished at: 2018-08-17T12:30:27+02:00
[INFO] Final Memory: 42M/377M
[INFO] ------------------------------------------------------------------------

Consider introducing this feature in the OOTB setup. Since this project is aimed at libraries and tools rather than projects, maintaining this kind of compatibility should be enabled by deafult.

Error when running gradlew props on forked project

There is error after forking the project and running gradlew props:

> Could not create task ':props'.
   > Could not create task of type 'Props'.
      > Attribute [USERDOMAIN] of [java.util.Collections$UnmodifiableMap] does not exist or can not be accessed and strict variables is set to true. ({{aemSmbDomain | default(env['USERDOMAIN'])}}:1)```

[Question] Project vs application (multi vs single)

Hey, quick question, in the readme of this project it says:

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.

I'm just wondering what your definition, use-case, and differences of application based on AEM and project based on AEM are?

Thanks a ton!

Change quickstart commend in docs

Please change quickstart commend in docs from:
git clone [email protected]:Cognifide/gradle-aem-single.git && cd gradle-aem-single && ./gradlew fork (SSH)
to:
git clone https://github.com/Cognifide/gradle-aem-single.git && cd gradle-aem-single && ./gradlew fork (HTTP)

Cloning repo via ssh ends with error caused by lack of write access:

[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Default user intent is clone-only the repository.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.