Class Installation

java.lang.Object
com.commercetools.docs.meta.Installation

public class Installation extends Object
Table of content
  • Installation
    • Modules
    • Gradle
    • Maven
    • Troubleshooting
      • Spring Framework

Installation

Modules

For each of our APIs there is a separate module with all type and request classes.

commercetools-sdk-java-api
models and request builders for the product API
commercetools-sdk-java-importapi
models and request builders for the import API
commercetools-sdk-java-ml
models and request builders for the machine learning API
commercetools-sdk-java-history
models and request builders for the audit API

The SDK provides three HTTP client modules and one default module which serves as alias.

commercetools-okhttp-client4
uses OkHttp client 4.0
commercetools-okhttp-client3
uses OkHttp client 3.0
commercetools-apachehttp-client
uses Apache HTTP async client 5.1
commercetools-http-client
alias for commercetools-okhttp-client4

The module rmf-java-base provides the base classes and common abstractions like ApiHttpClient, Middleware etc.

All modules are published to Maven Central.

Gradle


 ext {
     versions = [
         commercetools: "<latest version>"
     ]
 }

 repositories {
     mavenCentral()
 }

 dependencies {
     implementation "com.commercetools.sdk:commercetools-http-client:${versions.commercetools}"
     implementation "com.commercetools.sdk:commercetools-sdk-java-api:${versions.commercetools}"
     implementation "com.commercetools.sdk:commercetools-sdk-java-importapi:${versions.commercetools}"
     implementation "com.commercetools.sdk:commercetools-sdk-java-ml:${versions.commercetools}"
 }
 

Maven


 <properties>
     <commercetools.version><!-- latest version --></commercetools.version>
 </properties>
 <dependencies>
     <dependency>
       <groupId>com.commercetools.sdk</groupId>
       <artifactId>commercetools-http-client</artifactId>
       <version>${commercetools.version}</version>
     </dependency>
     <dependency>
       <groupId>com.commercetools.sdk</groupId>
       <artifactId>commercetools-sdk-java-api</artifactId>
       <version>${commercetools.version}</version>
     </dependency>
     <dependency>
       <groupId>com.commercetools.sdk</groupId>
       <artifactId>commercetools-sdk-java-importapi</artifactId>
       <version>${commercetools.version}</version>
     </dependency>
     <dependency>
       <groupId>com.commercetools.sdk</groupId>
       <artifactId>commercetools-sdk-java-ml</artifactId>
       <version>${commercetools.version}</version>
     </dependency>
 </dependencies>
 

Troubleshooting

Spring Framework

The Spring Boot Framework before version 2.7 has an optional dependency to OkHttp in version 3.x. To avoid problems use the commercetools-okhttp-client3 or commercetools-apachehttp-client module instead of the module commercetools-http-client

  • Constructor Details

    • Installation

      public Installation()