This topic describes how to install ApsaraVideo VOD SDK for Java. This topic also provides sample code that you can use to add the required Maven repository and JAR file dependencies.

Environment preparation

JDK 6 or later is installed.

Install Java SDK

Add the Maven repository and JAR file dependencies.

  1. Add the Maven repository.
        <repositories>
          <repository>
            <id>sonatype-nexus-staging</id>
            <name>Sonatype Nexus Staging</name>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
          </repository>
        </repositories>
  2. Add JAR file dependencies.
    <dependency>
      <groupId>com.aliyun</groupId>
      <artifactId>aliyun-java-sdk-core</artifactId>
      <version>4.5.1</version>
    </dependency>
    <dependency>
      <groupId>com.aliyun</groupId>
      <artifactId>aliyun-java-sdk-vod</artifactId>
      <version>2.15.11</version>
    </dependency>
    <dependency>
      <groupId>com.alibaba</groupId>
      <artifactId>fastjson</artifactId>
      <version>1.2.62</version>
    </dependency>
    <dependency>
      <groupId>com.aliyun</groupId>
      <artifactId>aliyun-java-sdk-kms</artifactId>
      <version>2.10.1</version>
    </dependency>
    Note
    • The version of the aliyun-java-sdk-core SDK is 4.4.5 or later.
    • For more information about the latest version of the aliyun-java-sdk-vod SDK, see the Version column of the first table in Release notes of server operation SDKs.
    • aliyun-java-sdk-kms is a dependency of Key Management Service (KMS). If you do not want to use KMS, you do not need to add this dependency.