Creating a Project

This section uses the Maven project tcpdemo as an example to describe how to create a project.

Procedure

  1. Download the SDK package dmssdk.zip.

    Download address

    The dmssdk.zip contains the following files:

    • dms.sdk-1.0.0.jar: DMS TCP SDK package
    • dms.protocol-1.0.0.jar: DMS TCP SDK package
    • dms.client.properties: configuration file
    • README.txt: release description file
    • third_lib.zip: third-party JAR package on which DMS TCP SDK depends
    • dms.sdk.api.chm: API reference

  2. On Eclipse (the recommended version is 4.6 or later), create a Maven project. The project name tcpdemo is used as an example.

  3. Click Finish.
  4. Import the DMS TCP SDK JAR packages.

    1. Right-click the new project tcpdemo, and create a libs folder.
    2. Copy dms.sdk-1.0.0.jar and dms.protocol-1.0.0.jar to the libs directory.
    3. Add the following information to the pom.xml file to import the JAR packages into the Maven repository:
        <dependency>
            <groupId>com.huawei.middleware.dms</groupId>
            <artifactId>dms.protocol</artifactId>
            <version>1.0.0</version>
            <type>jar</type>
            <scope>system</scope>
            <systemPath>${basedir}/libs/dms.protocol-1.0.0.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>com.huawei.middleware.dms</groupId>
            <artifactId>dms.sdk</artifactId>
            <version>1.0.0</version>
            <type>jar</type>
            <scope>system</scope>
            <systemPath>${basedir}/libs/dms.sdk-1.0.0.jar</systemPath>
        </dependency>
    4. Save the pom.xml file.
    5. If the third-party dependency package is not automatically imported, import the package in third_lib.zip into the Maven repository by referring to Compiling the Sample Project Code.