Esta página ainda não está disponível no idioma selecionado. Estamos trabalhando para adicionar mais opções de idiomas. Agradecemos sua compreensão.

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
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/ CodeArts Build/ Best Practices/ Building with Maven and Uploading the Software Package to the Self-hosted Repo (Built-in Executors, GUI)

Building with Maven and Uploading the Software Package to the Self-hosted Repo (Built-in Executors, GUI)

Updated on 2024-11-21 GMT+08:00

Scenario

CodeArts Build provides default dependency repositories. If they fall short of your service needs, you can create custom repositories for your builds. In this practice, you build with Maven and upload the resulting package to the self-hosted repo for future use. Same procedures apply when you work with other programming languages.

These steps depend on the following services:

Requirements

  • You have permissions for CodeArts Artifact.
  • You have permissions for CodeArts Repo.

Procedure

Table 1 Steps

Step

Description

Creating a Project

Create a project.

Creating a Self-hosted Repo

Create a self-hosted repo.

Creating a CodeArts Repo Repository

Create a code repository.

Creating and Running a Build Task

Create, configure, and run a build task.

Viewing the Build Results

Check the build logs and result files to verify the build results.

Creating a Project

  1. Log in to the Huawei Cloud console with your Huawei Cloud account.
  2. Click in the upper left corner and choose Developer Services > CodeArts from the service list.
  3. Click Access Service. The homepage of CodeArts is displayed.
  4. Click Create Project, and select the Scrum template.
  5. Set the project name to build-bestpractice, and leave the other parameters as default.
  6. Click OK to access the project.

Creating a Self-hosted Repo

  1. In the navigation pane, choose Artifact > Self-hosted Repos.
  2. Click Create and set parameters according to Table 2.

    Table 2 Parameters for creating a self-hosted repo

    Parameter

    Description

    Repository Type

    Select Local Repository.

    Repository Name

    Assign a custom name to the repository, for example, maven_repository.

    Package Type

    Select Maven.

    Project

    Leave the value as default. The field is autofilled with build-bestpractice in this practice.

    Include Patterns

    Leave it blank.

    Version Policy

    Specify the version of artifacts stored in the repository. Select either Release (the release version with stable functions) or Snapshot (the development version with unstable functions). You can also select both of them if needed. In this practice, select both Release and Snapshot.

    Description

    Enter additional information to describe the repository. Use no more than 200 characters.

  3. Click Submit. The details page of maven_repository is displayed. Figure 1 shows the created self-hosted repo.

    Figure 1 Self-hosted repo

Creating a CodeArts Repo Repository

  1. In the navigation pane, choose Code > Repo.
  2. On the displayed page, click New Repository. Select Template, and click Next.
  3. On the template selection page, select the Java Maven Demo template and click Next.
  4. On the repository creation page, type maven_private_repository_repo in the Repository Name field, and leave the other parameters as default.
  5. Click OK. The code repository details page is displayed. Figure 2 shows the directory that stores files of the code repository.

    Figure 2 Directory

Creating and Running a Build Task

  1. Access CodeArts Build. Click Create Task. On the displayed Basic Information page, set the following parameters. Leave the other parameters as default.

    • Name: Assign a custom name to the build task, for example, maven_private_repository_task.
    • Code Source: Select the code source from which code will be pulled for this build. In this practice, select Repo.
    • Repository: Select maven_private_repository_repo, the code repository created in Creating a CodeArts Repo Repository.

  2. Click Next and select the Maven template. Click OK. The Build Actions page is displayed.
  3. On the Build Actions page, click the GUI tab. Click the Build with Maven action on the left, and set the following parameters. Leave the other parameters as default.

    • Commands: Add a number sign (#) before the mvn package -Dmaven.test.skip=true -U -e -X -B command and delete the number sign before the #mvn deploy -Dmaven.test.skip=true -U -e -X -B command.
    • Release to Self-hosted Repos: Select Configure all POMs.
    • Release and Snapshot: Select the name (maven_repository is used in this practice) of the created self-hosted repo.
      Figure 3 Configuring the action of building with Maven

  4. Click Save and Run in the upper right corner. In the displayed dialog box, click Confirm. The build task run page is displayed.

Viewing the Build Results

  1. After the build task is successfully run, go to the Actions tab page. Click the Build with Maven action. The build log window will display the information about the upload of the Maven build product to the self-hosted repo.
  2. In the navigation pane, choose Artifact > Self-hosted Repos. On the displayed page, expand the directory of maven_repository (Snapshot) to view the released dependencies, as shown in Figure 4.

    Figure 4 Checking the software package

Related Information

This practice shows how to archive Snapshot, the unreleased development version. To archive the unchanged Release version, remove the snapshot suffix from the version (change 1.0.0-SNAPSHOT to 1.0.0) in the pom.xml file of the CodeArts Repo repository you created, commit the file change, and run the build task again.

During a build process, Maven differentiates between snapshot and release versions by the occurrence of the -SNAPSHOT suffix in the module's version number (the value of version in the pom.xml file).

Usamos cookies para aprimorar nosso site e sua experiência. Ao continuar a navegar em nosso site, você aceita nossa política de cookies. Saiba mais

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback