-
Notifications
You must be signed in to change notification settings - Fork 20
Dependency Management
##Java dependencies for DD4T and Tridion
Install all Tridion dependencies (aka JAR files) in your local Maven repository as these are not available in Maven Central. The general command to do this is:
mvn -q install:install-file -DgroupId=com.tridion -DartifactId=cd_broker -Dversion=7.1.0 -Dpackaging=jar -Dfile=cd_broker-7.1.0.jar
To make this process a little more convenient, an install script was created to do this for all other required jars which are not in Maven Central.
- Windows: https://raw.githubusercontent.com/dd4t/dd4t-2-java/master/dd4t-providers/mvn-install.bat
- Linux, OS X: https://raw.githubusercontent.com/dd4t/dd4t-2-java/master/dd4t-providers/mvn-install.sh
Run this script in the directory where your Tridion jars are. Note that you have to rename them. For example, cd_core.jar has to become cd_core-7.1.0.jar. In addition to the Tridion jar, the script also installs the third party dependencies easylicense-2.5.jar,sqljdbc4-4.0.0.jar, jdbcpool-1.0.jar and the Tridion Contextual Web Delivery libraries should you need them.
In the above example, we install the Tridion 2013 SP1 Jar files, to which we have appended the version number. For older versions or for other version type (eg. -Dversion=2013SP1), you have to change the version property on your POM and in the script as well:
<!-- Set the correct version for your local or central setup -->
<properties>
<tridion.version>7.1.0</tridion.version>
</properties>
A fairly normal setup for a DD4T 2 web application with Tridion dependencies included is:
<dependency>
<groupId>com.tridion</groupId>
<artifactId>cd_ambient</artifactId>
<version>${tridion.version}</version>
</dependency>
<dependency>
<groupId>com.tridion</groupId>
<artifactId>cd_broker</artifactId>
<version>${tridion.version}</version>
</dependency>
<dependency>
<groupId>com.tridion</groupId>
<artifactId>cd_cache</artifactId>
<version>${tridion.version}</version>
</dependency>
<dependency>
<groupId>com.tridion</groupId>
<artifactId>cd_core</artifactId>
<version>${tridion.version}</version>
</dependency>
<dependency>
<groupId>com.tridion</groupId>
<artifactId>cd_datalayer</artifactId>
<version>${tridion.version}</version>
</dependency>
<dependency>
<groupId>com.tridion</groupId>
<artifactId>cd_dynamic</artifactId>
<version>${tridion.version}</version>
</dependency>
<dependency>
<groupId>com.tridion</groupId>
<artifactId>cd_linking</artifactId>
<version>${tridion.version}</version>
</dependency>
<dependency>
<groupId>com.tridion</groupId>
<artifactId>cd_model</artifactId>
<version>${tridion.version}</version>
</dependency>
Next, Tridion expects the following third party dependencies which are not in Maven Central and therefore have to be installed locally as well:
<dependency>
<groupId>com.vs.ezlicrun</groupId>
<artifactId>easylicense</artifactId>
<version>${easylicense-version}</version>
<scope>runtime</scope>
</dependency>
<!-- SQL Server.
If you use Oracle, please consult the SDL Installation manual for the current proper dependency
-->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<version>${sqljdbc4-version}</version>
<scope>runtime</scope>
</dependency>
These dependencies depend on the following properties in your POM:
<properties>
<sqljdbc4-version>4.0.0</sqljdbc4-version>
<easylicense-version>2.5</easylicense-version>
<properties>
Note that depending on your requirements or already present setup, version numbers may differ. Further reading on this can be done here.
##Fetching the latest DD4T version from Maven Central
dd4t-2-java is released to Maven Central, which means you do not have to download the source and embed it into your project anymore. The following core dependencies are usually always required:
<dependency>
<groupId>org.dd4t</groupId>
<artifactId>dd4t-core</artifactId>
<version>${dd4t.version}</version>
</dependency>
<dependency>
<groupId>org.dd4t</groupId>
<artifactId>dd4t-mvc-support</artifactId>
<version>${dd4t.version}</version>
</dependency>
<dependency>
<groupId>org.dd4t</groupId>
<artifactId>dd4t-api</artifactId>
<version>${dd4t.version}</version>
</dependency>
<dependency>
<groupId>org.dd4t</groupId>
<artifactId>dd4t-providers</artifactId>
<version>${dd4t.version}</version>
</dependency>
<dependency>
<groupId>org.dd4t</groupId>
<artifactId>dd4t-caching</artifactId>
<version>${dd4t.version}</version>
</dependency>
For backwards compatibility with DD4T 1, add the following dependency:
<dependencies>
<dependency>
<groupId>org.dd4t</groupId>
<artifactId>dd4t-compatibility</artifactId>
<version>${dd4t.version}</version>
</dependency>
<dependencies>
DD4T 2 requires quite a few sub dependencies. Depending on your need, you will need to adjust them and add or change them in your POM. In general, the minimal list of dependencies can be found in the dependencyManagement
section of dd4t-2-java's parent pom, located here: https://raw.githubusercontent.com/dd4t/dd4t-2-java/release/pom.xml
In addition to dd4t-2's native dependencies, your web application and embedded Tridion stack may require extra dependencies. You can check the set dependencies in the following projects as a guide for establishing your set: