May 13, 2020
Estimated Post Reading Time ~

Including the AEM Core Component 2.0 in your project

1) Edit aem-guides-wknd/pom.xml and add the following dependencies in the <dependencies> section:

<dependencies>
...
<dependency>
    <groupId>com.adobe.cq</groupId>
    <artifactId>core.wcm.components.core</artifactId>
    <version>2.0.0</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>com.adobe.cq</groupId>
    <artifactId>core.wcm.components.all</artifactId>
    <type>zip</type>
    <version>2.0.0</version>
    <scope>provided</scope>
</dependency>
...
</dependencies>

2) Edit aem-guides-wknd/core/pom.xml. Add the core.wcm.components.core dependency on the dependency list. Notice that it is not necessary to specify a version, as the version is managed at the Parent pom. It is a best practice to always manage dependency versions within the Parent pom.

//core/pom.xml

<dependencies>
...
<dependency>
    <groupId>com.adobe.cq</groupId>
    <artifactId>core.wcm.components.core</artifactId>
</dependency>
...
</dependencies>

3) Edit aem-guides-wknd/ui.apps/pom.xml. Add the core.wcm.components.all zip as a dependency in the dependency list.

//ui.apps/pom.xml

<dependencies>
...
<dependency>
   <groupId>com.adobe.cq</groupId>
    <artifactId>core.wcm.components.all</artifactId>
    <type>zip</type>
</dependency>
...
</dependencies>

4) Edit aem-guides-wknd/ui.apps/pom.xml. Include core.wcm.components.all zip as a sub-package. This will deploy the Core Components package along with the WKND code each time. Beneath the embeddeds tag adds a new tag for subPackages and specifies the core.wcm.components.all artifactId.

//ui.apps/pom.xml
<plugins>
...

<plugin>
    <groupId>com.day.jcr.vault</groupId>
    <artifactId>content-package-maven-plugin</artifactId>
    <extensions>true</extensions>
    <configuration>
        <group>aem-guides/wknd</group>
        <filterSource>src/main/content/META-INF/vault/filter.xml</filterSource>
        <properties>
              <acHandling>merge_preserve</acHandling>
        </properties>
        <embeddeds>
            <embedded>
                <groupId>com.adobe.aem.guides</groupId>
                <artifactId>wknd-sites-guide.core</artifactId>
                <target>/apps/wknd/install</target>
            </embedded>
            </embeddeds>

            <subPackages>
                <subPackage>
                    <groupId>com.adobe.cq</groupId>
                <artifactId>core.wcm.components.all</artifactId>
                    <filter>true</filter>
                </subPackage>
            </subPackages>
    <targetURL>http://${crx.host}:${crx.port}/crx/packmgr/service.jsp</targetURL>
    </configuration>
</plugin>
...
</plugins>

5) To verify that it works, go to the Package Manager. You should see listed three new items:
  • core.wcm.components.content-2.0.0.zip
  • core.wcm.components.config-2.0.0.zip
  • core.wcm.components.all-2.0.0.zip


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.