Skip to content

Commit

Permalink
Clarify differences between AEMaaCS and AEM 6.5 for embedding (#265)
Browse files Browse the repository at this point in the history
List AEMaaCS first, still leverage subpackage for AEM6.5
  • Loading branch information
kwin authored Jun 6, 2024
1 parent a8b3481 commit f021de7
Showing 1 changed file with 86 additions and 35 deletions.
121 changes: 86 additions & 35 deletions acs-aem-commons/pages/maven.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,48 +14,59 @@ Please refer to [Compatibility](/acs-aem-commons/pages/compatibility.html) to ch

## ACS AEM Commons 6.0.0+

### AEM 6.5
*In ACS AEM Commons 6.0.0, the main dependency artifact ID was renamed from `acs-aem-commons-content` to `acs-aem-commons-all`.*

In ACS AEM Commons 6.0.0, the main dependency artifact ID was renamed from `acs-aem-commons-content` to `acs-aem-commons-all`.
The setup for embedding/depending on ACS AEM Commons in your code base differs slightly between AEMaaCS and AEM 6.5.

#### Your all/pom.xml
### AEM as a Cloud Service

In the `filevault-package-maven-plugin` plugin configuration of your _all project's pom.xml_ file, add this:
#### Your Container Content Package (usually called `all/pom.xml `)

{% highlight xml %}
<plugins>
<plugin>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>filevault-package-maven-plugin</artifactId>
...
<configuration>
<embeddeds>
...
<embedded>
<groupId>com.adobe.acs</groupId>
<artifactId>acs-aem-commons-all</artifactId>
<type>zip</type>
<target>/apps/my-app-vendor-packages/container/install</target>
<filter>true</filter>
<isAllVersionsFilter>true</isAllVersionsFilter>
</embedded>
...
{% endhighlight %}
In your _container content package module's pom.xml_ file you extend both the

In the `<dependencies>` section of your _all (container-package) project's pom.xml_ file, add this:
* `dependencies` section and the
* `filevault-package-maven-plugin` configuration

like this:

{% highlight xml %}
<dependency>
<plugins>
<plugin>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>filevault-package-maven-plugin</artifactId>
...
<configuration>
<embeddeds>
<embedded>
<!-- the artifact with the given id from the project dependencies is embedded -->
<artifactId>acs-aem-commons-all</artifactId>
<target>/apps/my-app-vendor-packages/container/install</target>
<filter>true</filter>
<isAllVersionsFilter>true</isAllVersionsFilter>
</embedded>
...
</embeddeds>
...
</configuration>
...
</plugin>
</plugins>
...
<dependencies>
<dependency>
<groupId>com.adobe.acs</groupId>
<artifactId>acs-aem-commons-all</artifactId>
<classifier>cloud</classifier>
<version>{{ site.data.acs-aem-commons.version }}</version>
<type>zip</type>
</dependency>
</dependency>
...
</dependencies>
{% endhighlight %}

#### Your core/pom.xml (Optional)
#### Your OSGi Bundle(s) (usually called `core`) (Optional)

To use [Java APIs](https://javadoc.io/doc/com.adobe.acs/acs-aem-commons-bundle/latest/index.html) provided by ACS AEM Commons in your code, add a dependency on on the `acs-aem-commons-bundle` in your OSGi bundle Maven project.
To use [Java APIs](https://javadoc.io/doc/com.adobe.acs/acs-aem-commons-bundle/latest/index.html) provided by ACS AEM Commons in your code, add a dependency on the `acs-aem-commons-bundle` in your OSGi bundle Maven project.

{% highlight xml %}
<dependency>
Expand All @@ -66,21 +77,63 @@ To use [Java APIs](https://javadoc.io/doc/com.adobe.acs/acs-aem-commons-bundle/l
</dependency>
{% endhighlight %}

## AEM as a Cloud Service
### AEM 6.5

All information of AEM as a Cloud Service above applies, but instead of using the specific *classifier* `cloud`, you don't use any classifier at all. Also instead of `embeddeds` one leverages `subpackages`

#### Your Container Content Package (usually called `all`)

All information of AEM 6.5 above applies, but instead of using the `acs-aem-commons-all`, a specific classifier for cloud is foreseen.
In your _container content package module's pom.xml_ file, add this:

{% highlight xml %}
<dependency>
<plugins>
<plugin>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>filevault-package-maven-plugin</artifactId>
...
<configuration>
<subpackages>
<subpackage>
<!-- the artifact with the given id from the project dependencies is embedded -->
<artifactId>acs-aem-commons-all</artifactId>
<filter>true</filter>
<isAllVersionsFilter>true</isAllVersionsFilter>
</subpackage>
...
</subpackages>
...
</configuration>
...
</plugin>
</plugins>
...
<dependencies>
<dependency>
<groupId>com.adobe.acs</groupId>
<artifactId>acs-aem-commons-all</artifactId>
<classifier>cloud</classifier>
<version>{{ site.data.acs-aem-commons.version }}</version>
<type>zip</type>
</dependency>
...
</dependencies>
{% endhighlight %}

#### Your OSGi Bundle(s) (usually called `core`) (Optional)

In your _OSGi bundle module's pom.xml_ file, add this:.

{% highlight xml %}
<dependency>
<groupId>com.adobe.acs</groupId>
<artifactId>acs-aem-commons-bundle</artifactId>
<version>{{ site.data.acs-aem-commons.version }}</version>
<scope>provided</scope>
</dependency>
{% endhighlight %}

## ACS AEM Commons < 6.0.0

Prior to ACS AEM Commons 6.0.0, the main dependency artifact ID was named from `acs-aem-commons-content`.
Prior to ACS AEM Commons 6.0.0, the main dependency artifact ID was named `acs-aem-commons-content`.

### Your all/pom.xml

Expand All @@ -96,9 +149,7 @@ In the `filevault-package-maven-plugin` plugin configuration of your _all projec
<embeddeds>
...
<embedded>
<groupId>com.adobe.acs</groupId>
<artifactId>acs-aem-commons-all</artifactId>
<type>zip</type>
<target>/apps/my-app-vendor-packages/container/install</target>
<filter>true</filter>
<isAllVersionsFilter>true</isAllVersionsFilter>
Expand Down

0 comments on commit f021de7

Please sign in to comment.