Gradle Aem Plugin Versions Save

Swiss army knife for Adobe Experience Manager related automation. Environment setup & incremental AEM application build which takes seconds, not minutes.

16.0.9

11 months ago

16.0.8

1 year ago

16.0.7

1 year ago

16.0.5

1 year ago

16.0.4

1 year ago

#943

16.0.3

1 year ago

16.0.2

1 year ago

16.0.1

1 year ago

What's new

GAP Launcher works with projects generated from recent AEM archetype

Tested with: https://github.com/adobe/aem-project-archetype/releases/tag/aem-project-archetype-39 GAP launcher should scaffold properly Gradle build files correctly with

  • aemVersion=cloud
  • aemVersion=6.5.13 (6.5.14 does not work as there is no uber-jar published here)

Scaffolding with config plugin instead of fork

See: https://github.com/wttech/gradle-config-plugin

image

Setting up local AEM environment directly from AEMaaCS SDK archive

To setup or upgrade AEM SDK now it is needed to only change reference to the recent AEM SDK ZIP archive. GAP will automatically unpack it then GEP could load automatically and use dispatcher AEM Dispatcher Ethos Docker image. GAP will determine valid image file included in AEM SDK even when using Mac M1 laptops with Rosetta emulation. It is because AEM instances should be rather running on x86_64 Java rather on arm64 because not all AEM features are working on Java for ARM (e.g Scene7 seems that it is not working).

Since now, a new property distUrl accepts both AEM SDK ZIP and AEM On-prem JAR to be able to setup instances:

localInstance.quickstart.distUrl=/home/john-doe/aem/aem-sdk-quickstart-2022.7.8005.zip

or

localInstance.quickstart.distUrl=/home/john-doe/aem/cq-quickstart-6.5.0.jar

To upgrade local environment it is needed only to update this single property and resetup everything by using command:

gradlew instanceResetup -Pforce

Connecting to a remote AEMaaCS author instance

Now GAP could use Adobe IMS to connect to AEMaaCS author instance. Content synchronization features, accessing repository in AEM DSL scripting using Repository instance service is now available. Since now it is possible to implement e.g. migration tasks that are grabbing content from an on-prem instance and deploying it on a cloud instance.

tasks.register("migrate") {
  doLast {
    val author1 = aem.instance("http://<username>:<password>@localhost:4502")

    val author2 = aem.instance("https://<author-name>.adobeaemcloud.com")
    author2.serviceCredentials.set(File("/path/to/service_token.json"))

    val pkg = author1.sync.packageManager.download {
      filters("/content/foo")
    }
    
    author2.sync.packageManager.deploy(pkg)
  }
}

Environment variables support for AEM SDK instances

To simplify passing environment variables and secret files, GAP now consider VCS-ignored dirs to grab override files from. Also it will pass env vars to AEM process automatically when env var files is created at approriate location. Addresses things described here.

It is also possible to configure env vars passed to AEM process via DSL:

aem {
  localInstance { 
    defined {
      envVars.put("AIO_...", "foo")
      envPass("AIO_*")
    }
  }
}

The env vars per particular type of instances could be put under:

  • VCS-ignored:env/.gradle/aem/localInstance/override/[common|author|publish]/env.properties
  • VCS-tracked: env/src/aem/localInstance/override/[common|author|publish]//env.properties

To setup secrets, consider adding file at path 'env/src/aem/localInstance/override/common/crx-quickstart/conf/sling.properties' with following content:

org.apache.felix.configadmin.plugin.interpolation.secretsdir=${sling.home}/secret

Then for each secret create a file at path following pattern env/src/aem/localInstance/override/common/crx-quickstart/secret/${ENV_VAR_NAME}

replace ${ENV_VAR_NAME} with your own env var name e.g AIO_RUNTIME_XXX. Be sure to set file name which is exactly the same as environment variable name (typically all uppercase) without extension. Put the value of environment secret as file content.

Related changes: https://github.com/wttech/gradle-aem-plugin/pull/936/files

Troubleshooting when HTTP or debug ports are already bound

When instance cannot be started properly since now GAP will display automatically last 30 lines of stdout.log.

image

JVM agent DSL & automated setup

Since now it is easy to configure OpenTelemetry, Jacoco or any other Java Agent within single line of code.

aem {
  localInstance {
    defined {
      jvmAgents {
        openTelemetry()
      }
    }
  }
}

Instance workflow task

Now it is super easy to execute workflow for any resource from CLI. Read more here: https://github.com/wttech/gradle-aem-plugin/blob/master/docs/instance-plugin.md#task-instanceworkflow

Upgrade notes

API changes

Instance object now uses Gradle Provider API properties instead of raw values. To read these values in build scripts now it is required to supplement a usage of each property with.get().

Other notable changes:

  • Instance.physicalType renamed to Instance.location
  • Instance.id renamed to Instance.purposeId
  • Instance.type renamed to Instance.purpose

Configuration precedence

Now environment variables could be used to override Gradle properties, see: https://github.com/wttech/gradle-common-plugin/pull/16

Maven builds task names

Prefix is added to straightforwardly indicate that artifact is built using Maven under the hood:

zip -> mvnZip pom -> mvnPom jar -> mvnJar

Also alignment is done of origin GAP tasks names with the Maven build task names:

deploy -> packageDeploy deployAll -> packageDeployAll cleanAll -> packageCleanAll sync -> packageSync config -> packageConfig

Contributors

  • thanks @mariusz-pacyga-wttech for implementing #898
  • thanks @jean-khechfe-wttech for implementing #908

16.0.0-beta9

1 year ago

16.0.0-beta8

1 year ago