Installing the SDK

If you have any questions during development, post them on the Issues page of GitHub. For details about parameters and usage of each API, see the API Reference

Use the Maven central repository to download and install OBS Java SDK. The Maven configuration and Gradle configuration are supported. The procedure is as follows:

  • Maven configuration

    Open the pom.xml file of the Maven project and add the following configuration to the <dependencies> node:

           
    <dependency>
       <groupId>com.huaweicloud</groupId>
       <artifactId>esdk-obs-java</artifactId>
       <version>[3.21.4,)</version>
    </dependency>
  • Gradle configuration

    Open the build.gradle file of the Gradle project and add the following configuration to dependencies:

    api 'com.huaweicloud:esdk-obs-java:3.21.4'

Method 2: Use the image library to download and install OBS Java SDK. Maven is used as an example for demonstration. The procedure is as follows:

  1. On the displayed page, click HuaweiCloud SDK to enter the description page of the dependency management tool.
  2. On the description page of the dependency management tool, click Download Configuration File in the upper right corner to download and save the Maven configuration file.
  3. Use the downloaded Maven configuration file settings.xml to replace the global configuration file of the local Maven. For example, in the Windows operating system, the file is usually located in C:\Users\<administrator>\.m2.
  4. Open the pom.xml file of the Maven project and add the following configuration to the <dependencies> node:

    <!-- OBS Java SDK -->
    <dependency>
       <groupId>com.huawei.storage</groupId>
       <artifactId>esdk-obs-java</artifactId>
       <version>[3.21.4,)</version>
    </dependency>

  5. Run the Maven command (for example, mvn package) to download the SDK.

Method 3: Compile the JAR package:

  1. Download the source code from SDK Download Links and decompress it.
  2. Configure your local Java and Maven environments.
  3. Go to the directory where the source code is decompressed using commands.
  4. Run the following command:

    mvn clean package -Dmaven.test.skip=true -f pom-java.xml

  5. Store the build product in the target directory of the decompressed directory.