All Products
Search
Document Center

Alibaba Cloud SDK:V2.0 Java SDK (recommended)

Last Updated:Aug 14, 2025

This topic describes the common dependency packages and configuration classes for the V2.0 SDK. This information helps you resolve errors more quickly and develop more efficiently.

Common dependency packages

Most cloud products in the V2.0 SDK require the common dependency packages listed below. You can obtain the latest versions from the Maven repository. If you encounter package conflicts in your project, manually add the latest dependency package versions.

Note

The packages in the list are automatically installed when you install the cloud product SDK. If an error occurs during use, manually add the latest version.

Package name

Maven address

GitHub code repository address

tea-util

Maven Central: com.aliyun:tea-util

tea-util

tea

Maven Central: com.aliyun:tea

tea-java

credentials-java

Maven Central: com.aliyun:credentials-java

credentials-java

credentials-api

Maven Central: com.aliyun:credentials-api

credentials-api

openapiutil

Maven Central: com.aliyun:openapiutil

openapiutil

alibabacloud-gateway-spi

Maven Central: com.aliyun:alibabacloud-gateway-spi

alibabacloud-gateway-spi

tea-xml

Maven Central: com.aliyun:tea-xml

tea-xml

tea-openapi

Maven Central: com.aliyun:tea-openapi

tea-openapi

Configuration classes

com.aliyun.teaopenapi.models.Config

This class configures global parameters, such as credential information, endpoints, proxy configurations, and timeout configurations. The following table describes the parameters.

Note

Do not use parameters that are not listed in the table. They may be deprecated or have no practical meaning.

Parameter name

Description

credential

The credential client. In the V2.0 SDK, credential information is managed by the credentials tool. For more information, see Manage access credentials.

accessKeyId

The AccessKey ID. Set either this parameter or credential. If both credential and accessKeyId are set, the credentials in credential are used.

accessKeySecret

The AccessKey secret. Set either this parameter or credential. If both credential and accessKeySecret are set, the credentials in credential are used.

securityToken

The Security Token Service (STS) token. Set either this parameter or credential. If both credential and securityToken are set, the credentials in credential are used.

bearerToken

The bearer token. Set either this parameter or credential. If both credential and bearerToken are set, the credentials in credential are used.

endpoint

The service endpoint for the region where your cloud resources are located. Call APIs through this endpoint to access your cloud resources. For more information, see Configure endpoints.

regionId

The region where your cloud resources are located. If you do not set the endpoint parameter, you can set this parameter to get the service endpoint for the specified regionId. For more information, see Configure endpoints.

network

When you set regionId, you can use this parameter to specify the type of service endpoint to get. By default, an Internet endpoint is used. Valid values:

  • vpc: Gets a VPC endpoint.

When you use the Simple Log Service SDK (sls20201230), an Internet endpoint is used by default. You can use the following values to select a different endpoint:

  • intranet: Gets the VPC endpoint for Simple Log Service.

  • accelerate: Gets the transfer acceleration endpoint for Simple Log Service.

maxIdleConns

The maximum number of idle connections to keep in the connection pool. When the number of connections exceeds this value, the excess idle connections are closed to release resources. The default value is 5. For more information, see Configure an HTTP connection pool.

protocol

The request protocol. Supported protocols are HTTPS and HTTP. The default value is HTTPS. For more information, see Configure HTTPS requests.

readTimeout

The read timeout period. The default value is 10000 milliseconds. For more information, see Timeout mechanism.

connectTimeout

The connection timeout period. The default value is 5000 milliseconds. For more information, see Timeout mechanism.

httpProxy

Specifies the address and port of the proxy server. The format is http://proxyServer:port. For more information, see Configure a proxy.

httpsProxy

Specifies the address and port of the proxy server. The format is https://username:password@proxyServer:port. If proxy authentication is not required, the format is https://proxyServer:port. For more information, see Configure a proxy.

noProxy

Specifies a list of addresses that can be accessed without a proxy. Separate multiple addresses with commas. Domain names and IP addresses are supported. For more information, see Configure a proxy.

com.aliyun.teautil.models.RuntimeOptions

This class configures runtime parameters for a specific API request, such as proxy and timeout settings. The following table describes the parameters.

Note

Do not use parameters that are not listed in the table. They may be deprecated or have no practical meaning.

Parameter name

Description

autoretry

Specifies whether to enable the retry feature. This feature applies only to errors caused by network issues. The default value is false, which means the retry feature is disabled. For more information, see Retry mechanism.

maxAttempts

When the retry feature is enabled, you can use this parameter to set the number of retries. The default value is 3. For more information, see Retry mechanism.

maxIdleConns

The maximum number of idle connections to keep in the connection pool. When the number of connections exceeds this value, the excess idle connections are closed to release resources. The default value is 5. For more information, see Configure an HTTP connection pool.

ignoreSSL

When protocol is set to HTTPS, the SDK enables SSL/TLS certificate validation by default. If your runtime environment does not have an SSL/TLS certificate, you can use this parameter to temporarily ignore certificate validation. The default value is false, which means certificate validation is required. For more information, see Configure HTTPS requests.

Note

To ensure communication security in your production environment, enable certificate validation.

readTimeout

The read timeout period. The default value is 10000 milliseconds. For more information, see Timeout mechanism.

connectTimeout

The connection timeout period. The default value is 5000 milliseconds. For more information, see Timeout mechanism.

httpProxy

Specifies the address and port of the proxy server. The format is http://proxyServer:port. For more information, see Configure a proxy.

httpsProxy

Specifies the address and port of the proxy server. The format is https://username:password@proxyServer:port. If proxy authentication is not required, the format is https://proxyServer:port. For more information, see Configure a proxy.

noProxy

Specifies a list of addresses that can be accessed without a proxy. Separate multiple addresses with commas. Domain names and IP addresses are supported. For more information, see Configure a proxy.