You are looking at documentation for an older release. Not what you want? See the current release documentation.
You can, of course, add any eXo artifact as a dependency of your project. To avoid losing time looking for the good version of the artifacts you want to add as dependencies, eXo Platform provides an import dependency which defines all of the versions for you. You just need to give the version of eXo Platform you are using, without concerning about proper versions of all artifacts. To import the right eXo dependencies, you can choose between the 2 ways below.
Inheriting dependency version from eXo Platform
You can refer to Dependency Management for more details.
Here is an example of the pom.xml
file using implicit variables to indicate the artifact version:
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>my-project</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>My project</name>
<properties>
<exoplatform.version>4.2.0</exoplatform.version>
</properties>
<dependencyManagement>
<dependencies>
<!-- Import versions from platform project -->
<dependency>
<groupId>org.exoplatform.platform</groupId>
<artifactId>platform</artifactId>
<version>${exoplatform.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
In this file, the property exoplatform.version
was declared under properties
tag, indicating a specific platform version used for the project. After that, each dependency (under dependencyManagement
tag) can reuse this parameter as an implicit variable ${exoplatform.version}
without specifying its artifact version.
Declaring exact versions
In case you want to control the versions of artifact, you can add them manually. For each dependency, do as below:
Select the version of eXo Platform you are using at here.
Select the targeted .pom
file and open it to see its configurations.
Find the artifactId
you need to include in your project, for instance platform-ui
. You will see its version which was declared in the implicit variable as ${org.exoplatform.platform-ui.version}
.
Search for this variable under properties
tag to get the exact version of the artifact and include it in your pom.xml
file, for example:
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>my-project</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>My project</name>
<dependencies>
<dependency>
<groupId>org.exoplatform.platform-ui</groupId>
<artifactId>platform-ui</artifactId>
<version>4.2</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
In the sample projects of this book, notice that you need to check the artifact versions of each dependency (using this link) to be sure whether they are suitable with your platform package or not.