El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ MapReduce Service/ Developer Guide (Normal_3.x)/ Obtaining the MRS Application Development Sample Project

Obtaining the MRS Application Development Sample Project

Updated on 2024-08-12 GMT+08:00

Process for Building an MRS Sample Project

Building a sample project includes the following operations:

  1. Download the Maven project source code and configuration files of the sample project. For details, see Obtaining the MRS Sample Project.
  2. Configure the Maven mirror repository of the SDK in Huawei Mirrors. For details, see Configuring Huawei Open-Source Mirrors.
  3. Build a complete Maven project based on user requirements.

Obtaining the MRS Sample Project

Figure 1 Downloading sample code

Download the package to the local host and decompress it to obtain the sample code of the components.

NOTE:

For details about how to obtain the sample project of MRS 3.1.2-LTS, see Obtaining Sample Projects from Huawei Mirrors.

Configuring Huawei Open-Source Mirrors

Huawei provides Huawei Mirrors for you to download all dependency JAR files of sample projects. However, you need to download the rest dependency open-source JAR files from the Maven central repository or other custom repository address.

NOTE:

Before using a development tool to download the dependency JAR files in the local environment, ensure that the following conditions are met:

  • The local network is normal.

    Uses a browser and visit Huawei Mirrors to check whether the website can be accessed. If the access is abnormal, connect the local network.

  • The proxy is disabled for the development tool.

    Take the IntelliJ IDEA development tool of version 2020.2 as an example. Choose File > Settings > Appearance & Behavior > System Settings > HTTP Proxy, select No proxy, and click OK to save the configuration.

Perform the following steps to configure the open-source mirror warehouse.

  1. Check that JDK 1.8 or later and Maven 3.0 or later have been installed.
  2. Configure the Maven configuration file.

    • To overwrite the Maven configuration file, choose Huawei SDK > HuaweiCloud SDK at Huawei Mirrors, download the settings.xml file, and overwrite the <Maven installation directory>/conf/settings.xml file with the downloaded file.
    • (Optional) If you do not want to overwrite the Maven configuration file, manually modify the settings.xml configuration file or the pom.xml file of the component sample project to configure the mirror repository address. The configuration methods are as follows:
      • Configuration method 1: Modify the settings.xml configuration file.

        Add the following open-source mirror repository address to mirrors in the settings.xml configuration file.

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

        Add the following mirror repository address to profiles in the settings.xml configuration file.

        <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 repository address to the activeProfiles node in the settings.xml file.

        <activeProfile>huaweicloudsdk</activeProfile>
        NOTE:
        • Huawei Mirrors does not provide third-party open-source JAR files. After configuring Huawei open-source mirrors, you need to separately configure third-party Maven mirror repository address.
        • When using the IntelliJ IDEA development tool, you can choose File > Settings > Build, Execution, Deployment > Build Tools > Maven to view the directory where the settings.xml file is stored.

      • Configuration method 2: Modify the pom.xml configuration file.
        Add the following mirror repository address directly 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>Maven Central</name>
                    <url>https://repo1.maven.org/maven2/</url>
                </repository>
        
            </repositories>

  3. Configure the default Maven code and JDK. Add the following information to profiles in the settings.xml configuration file:

    <profile>
    <id>JDK1.8</id>
    <activation>
    <activeByDefault>true</activeByDefault>
    <jdk>1.8</jdk>
    </activation>
    <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <maven.compiler.encoding>UTF-8</maven.compiler.encoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
    </properties>
    </profile>

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback