All Products
Search
Document Center

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

Last Updated:Jun 23, 2026

Learn about common dependency packages and configuration classes in the V2.0 SDK to resolve errors quickly and improve development efficiency.

Common dependency packages

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

Note

These packages are automatically installed with the cloud product SDK. If an error occurs, 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

Use this class to configure global parameters such as credentials, endpoints, proxy settings, and timeouts. 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 effect.

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 reside. API calls are routed through this endpoint. For more information, see Configure endpoints.

regionId

The region where your cloud resources reside. If endpoint is not set, the SDK resolves the service endpoint from this region ID. For more information, see Configure endpoints.

network

When regionId is set, specifies the endpoint type to resolve. By default, an Internet endpoint is used. Valid values:

  • vpc: Resolves a VPC endpoint.

For the Simple Log Service SDK (sls20201230), an Internet endpoint is used by default. You can specify a different endpoint type:

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

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

maxIdleConns

The maximum number of idle connections in the connection pool. Excess idle connections are closed to free resources. Default value: 5. For more information, see Configure an HTTP connection pool.

protocol

The request protocol. Valid values: HTTPS and HTTP. Default value: HTTPS. For more information, see Configure HTTPS requests.

readTimeout

The read timeout period. Default value: 10000 milliseconds. For more information, see Timeout mechanism.

connectTimeout

The connection timeout period. Default value: 5000 milliseconds. For more information, see Timeout mechanism.

httpProxy

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

httpsProxy

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

noProxy

A comma-separated list of addresses that bypass the proxy. Domain names and IP addresses are supported. For more information, see Configure a proxy.

com.aliyun.teautil.models.RuntimeOptions

Use this class to configure per-request runtime parameters 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 effect.

Parameter name

Description

autoretry

Specifies whether to enable automatic retries for network errors. Default value: false (disabled). For more information, see Retry mechanism.

maxAttempts

The maximum number of retry attempts when automatic retries are enabled. Default value: 3. For more information, see Retry mechanism.

maxIdleConns

The maximum number of idle connections in the connection pool. Excess idle connections are closed to free resources. Default value: 5. For more information, see Configure an HTTP connection pool.

ignoreSSL

When protocol is set to HTTPS, the SDK validates SSL/TLS certificates by default. If your environment lacks an SSL/TLS certificate, use this parameter to skip validation temporarily. Default value: false (validation 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. Default value: 10000 milliseconds. For more information, see Timeout mechanism.

connectTimeout

The connection timeout period. Default value: 5000 milliseconds. For more information, see Timeout mechanism.

httpProxy

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

httpsProxy

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

noProxy

A comma-separated list of addresses that bypass the proxy. Domain names and IP addresses are supported. For more information, see Configure a proxy.