并行使用适用于 Java 的 SDK 1.x 和 2.x 版 - Amazon SDK for Java 2.x
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

并行使用适用于 Java 的 SDK 1.x 和 2.x 版

您可以在项目中同时使用 Amazon SDK for Java 的两个版本。

下面显示了使用版本 1.x 中的 Amazon S3 和版本 2.16.1 中的 DynamoDB 的项目的 pom.xml 文件示例。

例 POM 示例

此示例显示了同时使用 SDK 的 1.x 和 2.x 版本的项目的 pom.xml 文件条目。

<dependencyManagement> <dependencies> <dependency> <groupId>com.amazonaws</groupId> <artifactId>aws-java-sdk-bom</artifactId> <version>1.12.1</version> <type>pom</type> <scope>import</scope> </dependency> <dependency> <groupId>software.amazon.awssdk</groupId> <artifactId>bom</artifactId> <version>2.16.1</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>com.amazonaws</groupId> <artifactId>aws-java-sdk-s3</artifactId> </dependency> <dependency> <groupId>software.amazon.awssdk</groupId> <artifactId>dynamodb</artifactId> </dependency> </dependencies>