Configuring the pom.xml project file
In the Adobe Experience Manager system, the pom.xml configuration file contains the settings for integrating XTM Connect – AEM as a Cloud Service. This file configures the development project that contains the Client's instance of XTM Connect – AEM as a Cloud Service, which runs on the Adobe Experience Manager system.
Open the pom.xml file in your local Adobe Experience Manager system.
In the
<properties>
section, add a new Maven property that specifies the XTM Connect – AEM as a Cloud Service version that you want to include in the package. Example:... <properties> ... <xtm.connector.version>X.Y.Z1</xtm.connector.version> ... </properties> ...
Replace with the correct version of XTM Connect – AEM as a Cloud Service.
In the
<repositories>
section, add an XTM Cloud code repository:... <repositories> <repository> <id>xtm-artifactory</id> <name>XTM Artifactory</name> <url>https://jfrog.aem.xtm-intl.com/artifactory/aem-maven-repository</url> </repository> </repositories> ...
In the
<dependencies>
section, define the dependency to XTM Connect – AEM as a Cloud Service so that Maven downloads it during the build:... <dependencies> <dependency> <groupId>com.xtm.translation.connector</groupId> <artifactId>xtm-for-aem.all</artifactId> <version>${xtm.connector.version}1</version> <type>zip</type> </dependency> </dependencies> ...
Enter the same property (version value) as you entered in step 2. You might need to adjust it according to your needs.
In the
<plugin>
section, thecontent-package-maven-plugin
setting is used when a CRX package is assembled. In the pom.xml file, change this setting so that the package with the XTM Connect – AEM as a Cloud Service connector is also included in the build:... <plugin> <groupId>com.day.jcr.vault</groupId> <artifactId>content-package-maven-plugin</artifactId> <configuration> <embeddeds> <embedded> <groupId>com.xtm.translation.connector</groupId> <artifactId>xtm-for-aem.all</artifactId> * <target>/apps/<APP_NAME>/install</target> </embedded> ... </embeddeds> </configuration> </plugin> ...
* Adjust the "target" for your application. Whichever package you add here will be automatically installed in the Adobe Experience Manager system as well. (Omit the asterisk "*" and the space after it from your listing.)
Example of complete pom.xml configuration file
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.xtm.translation.connector</groupId> <artifactId>xtm-for-aem-cloud-demo</artifactId> <packaging>content-package</packaging> <version>1.0.0-SNAPSHOT</version> <name>XTM Translation Connector - AEM Cloud Demo</name> <description>XTM Translation Connector - AEM Cloud Demo</description> <properties> <aem.host>localhost</aem.host> <aem.port>4502</aem.port> <aem.publish.host>localhost</aem.publish.host> <aem.publish.port>4503</aem.publish.port> <sling.user>admin</sling.user> <sling.password>admin</sling.password> <vault.user>admin</vault.user> <vault.password>admin</vault.password> <bnd.version>5.1.2</bnd.version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <aem.sdk.api>2021.5.5257.20210505T101930Z-210429</aem.sdk.api> <aemanalyser.version>0.9.2</aemanalyser.version> <componentGroupName>XTM Translation Connector - AEM Cloud Demo</componentGroupName> <xtm.connector.version>2.4.2</xtm.connector.version> </properties> <repositories> <repository> <id>xtm-artifactory</id> <name>XTM Artifactory</name> <url>https://jfrog.aem.xtm-intl.com/artifactory/aem-maven-repository</url> </repository> </repositories> <!-- ====================================================================== --> <!-- B U I L D D E F I N I T I O N --> <!-- ====================================================================== --> <build> <sourceDirectory>src/main/content/jcr_root</sourceDirectory> <resources> <resource> <!-- we want to keep some of the META-INF files and not configure everything in the plugin. --> <directory>${basedir}/src/main/content/META-INF</directory> <targetPath>../vault-work/META-INF</targetPath> </resource> <!-- define the resources that will go into the package --> <resource> <directory>${basedir}/src/main/content/jcr_root</directory> <excludes> <!-- exclude .vlt control files in the package --> <exclude>**/.vlt</exclude> <exclude>**/.vltignore</exclude> <exclude>**/.gitignore</exclude> <exclude>**/*.iml</exclude> <exclude>**/.classpath</exclude> <exclude>**/.project</exclude> <exclude>**/.settings</exclude> <exclude>**/.DS_Store</exclude> <exclude>**/target/**</exclude> <exclude>**/pom.xml</exclude> </excludes> </resource> </resources> <pluginManagement> <plugins> <plugin> <groupId>com.day.jcr.vault</groupId> <artifactId>content-package-maven-plugin</artifactId> <version>0.5.1</version> <extensions>true</extensions> <configuration> <filterSource>src/main/content/META-INF/vault/filter.xml</filterSource> <verbose>true</verbose> <failOnError>true</failOnError> <targetURL>http://${aem.host}:${aem.port}/crx/packmgr/service.jsp</targetURL> <failOnError>true</failOnError> <failOnMissingEmbed>true</failOnMissingEmbed> <userId>${vault.user}</userId> <password>${vault.password}</password> </configuration> </plugin> </plugins> </pluginManagement> <plugins> <plugin> <groupId>com.day.jcr.vault</groupId> <artifactId>content-package-maven-plugin</artifactId> <configuration> <embeddeds> <embedded> <groupId>com.xtm.translation.connector</groupId> <artifactId>xtm-for-aem.all</artifactId> <target>/apps/xtm-for-aem-cloud-demo/install</target> </embedded> </embeddeds> </configuration> </plugin> <plugin> <artifactId>maven-clean-plugin</artifactId> <executions> <execution> <id>auto-clean</id> <phase>initialize</phase> <goals> <goal>clean</goal> </goals> </execution> </executions> </plugin> </plugins> </build> <!-- ====================================================================== --> <!-- P R O F I L E S --> <!-- ====================================================================== --> <profiles> <profile> <id>autoInstallPackage</id> <activation> <activeByDefault>false</activeByDefault> </activation> <build> <plugins> <plugin> <groupId>com.day.jcr.vault</groupId> <artifactId>content-package-maven-plugin</artifactId> <executions> <execution> <id>install-package</id> <goals> <goal>install</goal> </goals> <configuration> <targetURL>http://${aem.host}:${aem.port}/crx/packmgr/service.jsp</targetURL> <failOnError>true</failOnError> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile> <profile> <id>autoInstallPackagePublish</id> <activation> <activeByDefault>false</activeByDefault> </activation> <build> <plugins> <plugin> <groupId>com.day.jcr.vault</groupId> <artifactId>content-package-maven-plugin</artifactId> <executions> <execution> <id>install-package-publish</id> <goals> <goal>install</goal> </goals> <configuration> <targetURL>http://${aem.publish.host}:${aem.publish.port}/crx/packmgr/service.jsp</targetURL> <failOnError>true</failOnError> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile> </profiles> <!-- ====================================================================== --> <!-- D E P E N D E N C I E S --> <!-- ====================================================================== --> <dependencies> <dependency> <groupId>com.xtm.translation.connector</groupId> <artifactId>xtm-for-aem.all</artifactId> <version>${xtm.connector.version}</version> <type>zip</type> </dependency> </dependencies> </project>