Help Center > > Developer Guide> Method of Building an MRS Sample Project

Method of Building an MRS Sample Project

Updated at: Nov 06, 2019 GMT+08:00

Procedure

The procedure of building an MRS sample project consists of three steps:

  1. Download the Maven project source code and configuration files of the sample project. For details, see Obtaining a Sample Project.
  2. Configure the Maven mirror repository of the SDK in the HUAWEI CLOUD mirror center. For details, see Configuring an Open Source Mirror on HUAWEI CLOUD.
  3. Build a complete Maven project by following instructions in the environment preparation section of each component based on your requirements.

Obtaining a Sample Project

Figure 1 Downloading sample code

Configuring an Open Source Mirror on HUAWEI CLOUD

HUAWEI CLOUD provides an open source mirror center (https://mirrors.huaweicloud.com/), where you can download all dependency JAR files of the MRS sample project. However, you need to download the rest dependency open source JAR files from the Maven central repository.

Perform the following steps to configure the open source mirror on HUAWEI CLOUD.

  1. Ensure that you have installed JDK 1.8 or later and Maven 3.0 or later.
  2. Visit https://mirrors.huaweicloud.com/.
  3. Locate the HuaweiCloud module and click Try Now. Configure Maven as prompted.
  4. Use either of the following methods to configure the address of the mirror warehouse.

    • Configuration method 1

    Add the following mirror warehouse address to the pom.xml file in the secondary development sample project.

        <repositories>
    
            <repository>
                <id>huaweicloudsdk</id>
                <url>https://mirrors.huaweicloud.com/repository/maven/huaweicloudsdk/</url>
                <releases><enabled>true</enabled></releases>
                <snapshots><enabled>true</enabled></snapshots>
            </repository>
    
            <repository>
                <id>central</id>
                <name>Mavn Centreal</name>
                <url>http://repo2.maven.org/maven2/</url>
            </repository>
    
        </repositories>
    • Configuration method 2

    Add the address of the open source mirror warehouse to the mirrors in setting.xml.

    <mirror>
        <id>repo2</id>
        <mirrorOf>central</mirrorOf>
        <url>http://repo2.maven.org/maven2/</url>
    </mirror>

    Add the following mirror warehouse address to the profiles in setting.xml.

    <profile>
        <id>huaweicloudsdk</id>
        <repositories>
            <repository>
                <id>huaweicloudsdk</id>
                <url>https://repo.huaweicloud.com/repository/maven/huaweicloudsdk/</url>
                <releases><enabled>true</enabled></releases>
                <snapshots><enabled>true</enabled></snapshots>
            </repository>
        </repositories>
    </profile>

    Add the following mirror warehouse address to the activeProfiles in setting.xml.

    <activeProfile>huaweicloudsdk</activeProfile>

    The HUAWEI CLOUD open source mirror center does not provide third-party open source JAR files. After configuring HUAWEI CLOUD open source mirrors, you need to separately configure third-party Maven repository address mirrors.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel