All Products
Search
Document Center

Alibaba Cloud SDK:Dependencies

Last Updated:Sep 06, 2022

This topic describes how to configure both the SDK of an Alibaba Cloud service and the core library as dependencies.

Configure the Classic SDK of an Alibaba Cloud service as a dependency

The following code provides an example on how to configure the Classic SDK of ECS as a Maven dependency:

<dependencies>
  <!--  The Classic SDK  -->
  <dependency>
    <groupId>com.aliyun</groupId>
    <artifactId>aliyun-java-sdk-ecs</artifactId>
    <version>4.23.12</version>
  </dependency>
</dependencies>

The Classic SDK of each Alibaba Cloud service is named by using the aliyun-java-sdk-${Service name} format. If you want to view the information about the Classic SDK of each Alibaba Cloud service, visit SDK Center.

Configure the core library as a dependency

The Classic SDK of each Alibaba Cloud service contains information such as the request and response objects in the API and the unmarshaller object that can be used to serialize the return value. You must also configure the core library as a dependency. The core library contains the logic for HTTP-based API calls, authentication information, signature algorithms, and exception handling. We recommend that you configure the core library as a Maven dependency. The following code provides a configuration example:

<dependency>
  <groupId>com.aliyun</groupId>
  <artifactId>aliyun-java-sdk-core</artifactId>
  <version>[4.0.0,5.0.0)</version>
</dependency
Notice

We recommend that you use the latest core library. The latest version of the core library is an update of previous versions and fixes vulnerabilities in the previous versions.