- Service Overview
- Getting Started
-
User Guide
- Before You Start
- Roles & Permissions
- Process
- Logging In to the CodeArts Build Homepage
- Creating a Build Task
-
Configuring Build Actions
- Introduction
-
Graphical Build
- Configuring Build Environment
- Configuring Code Download
- Build with Maven
- Build with Android
- Sign Android APK
- Build with npm
- Build with Gradle
- Build with Yarn
- Build with Gulp
- Build with Grunt
- Build with Mono
- Build in PHP
- Build with Setuptools
- Build with PyInstaller
- Run Shell Commands
- Build with GNU Arm
- Build with CMake
- Build with Ant
- Build with Go
- Build Android Quick App
- Creating Images and Pushing to SWR
- Using SWR Public Images
- Uploading Software Packages to Release Repos
- Uploading Files to OBS
- Running Docker Commands
- Downloading Package from Release Repos
- Downloading File from File Manager
-
Code-based Build
-
Configuring a Task
- Introducing the YAML File Structure
- Using YAML for Build
- Using YAML to Configure Code Download
- Using YAML to Configure Manifest File Download from Repositories
- Using YAML to Configure and Execute Shell Commands
- Using YAML to Configure a Maven Build
- Using YAML to Configure an npm Build
- Using YAML to Configure a Yarn Build
- Using YAML to Configure a Build with Go
- Using YAML to Configure a Build with Gulp
- Using YAML to Configure a Build with Grunt
- Using YAML to Configure a PHP Build
- Using YAML to Configure a Build with GNU Arm
- Using YAML to Configure a Build with Setuptools
- Using YAML to Configure a Build with PyInstaller
- Using YAML to Configure a Python Build
- Using YAML to Configure a Gradle Build
- Using YAML to Configure an Ant Build
- Using YAML to Configure a CMake Build
- Using YAML to Configure a Mono Build
- Using YAML to Configure a Build with Flutter
- Using YAML to Configure an sbt Build
- Using YAML to Configure an Android Build
- Using YAML to Sign Android APK
- Using YAML to Inject an APM Probe into an Android App
- Using YAML to Build an Android Quick App
- Using YAML to Configure a Bazel Build
- Using YAML to Configure a Build with Grails
- Using YAML to Build an Android App with Ionic
- Using YAML to Configure a Fortran Build
- Using YAML to Configure a Build with MSBuild
- Using YAML to Create an Image and Upload It to SWR
- Using YAML to Specify SWR Public Images
- Using YAML to Upload Files to OBS
- Using YAML to Download Files
- Using YAML to Upload Binary Packages to a Repository
- Using YAML to Download Binary Packages
- Using YAML to Run Docker Commands
- Configuring Tasks
-
Configuring a Task
- Running a Build Task
- Viewing a Build Task
- Managing and Configuring a Build Task
- Other Operations
- Best Practices
-
API Reference
- Before You Start
- API Overview
- Calling APIs
-
Task APIs
- View the build task build history list based on the start time and end time.
- Viewing the Build History List of build task
- Downloading the Keystore File
- Viewing the Running Status of a Task
- Viewing the build task List of Users in a Project
- Execute the build job.
- Querying the Latest Successful Build History of a Specified Code Repository
- API for Obtaining Construction History Details
- View the build task construction success rate based on the start time and end time.
- Download Full Build Log
- Download Build Step Log
- Obtaining Construction Record Information
- Obtaining Build Product Details
- Stopping a Build
- Deleting the Build Task
- Disabling build task
- Restoring the build task
- Creating a Build Job
- Updating the build task
- Querying a Build Template
- Creating a Build Template
- Deleting a Build Template
- Query a Notification
- Sending Asynchronous Notifications When Updating Resource Types
- Cancel Notification
- Obtaining build task Details
- Out-of-DateAPIs (Unavailable Soon)
- Application Examples
- Appendix
- Change History
-
FAQs
-
General FAQs
- What Is CodeArts Build?
- Can I Specify a Server or Server Configuration for Running a Build Task?
- Does CodeArts Build Support iOS?
- Is There a Limit on the Size of the Build Package to Be Uploaded?
- Project Files Not Found During Builds
- Files Not Found During Software Package Upload
- Insufficient Permissions
- Task Not Found
- Task Aborted
- Migrating Common Java Projects to Cloud by Eclipse
- Fetching Code
-
Using Maven for Build
- Failed License Check
- Failed to Upload a Package Using the maven deploy Command
- POM Not Found
- Package or Symbol Not Found
- Incomplete JAR Due to Parallel Build Tasks
- Using the exec-maven-plugin Extension for Maven and NPM Hybrid Builds
- Referencing Between Parent and Child POMs
- Configuring and Clearing Maven Build Cache
- Finding the Correct Build Package Directory
- Using the jib-maven-plugin Extension to Build a Maven Project and Create an Image
- Package Remains Old After Code Update
- Service Endpoint Did Not Exist
- Using Android for Build
- Using Gradle for Build
-
Using npm for Build
- JavaScript heap out of memory
- enoent ENOENT: no such file or directory
- Module not found: Error: Can't resolve ...
- No Error Displayed for Failed Build with npm
- npm cb() never called
- gyp ERR! stack Error: EACCES: permission denied
- eslint: error 'CLODOP' is not defined
- Failed to Download node-sass
- error: could not write config file
- Low Efficiency and Slow Dependency Installation During Build with npm
- Using Docker for Build
- Creating Images and Pushing to SWR
-
General FAQs
Using the exec-maven-plugin Extension for Maven and NPM Hybrid Builds
Symptoms
The Maven project contains front-end code and requires a build with npm. However, the provided Maven image does not contain the npm build environment.
Solution
You can use exec-maven-plugin for hybrid compilation. First configure the plug-in, and then configure the npm environment, and finally run the build task.
- Configure the POM file.
Each npm command is an <execution> in the <executions> tag. You are advised not to configure a proxy or a private npm image repository. Instead, use CodeArts Mirror. The configuration is as follows:
<build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <executions> <execution> <id>exec-npm-config</id> <phase>prepare-package</phase> <goals> <goal>exec</goal> </goals> <configuration> <executable>npm</executable> <arguments> <argument>config</argument> <argument>set</argument> <argument>registry</argument> <argument>https://mirrors.xxcloud.com/repository/npm/</argument> </arguments> <!-- <workingDirectory>${basedir}</workingDirectory>--> </configuration> </execution> <execution> <id>exec-npm-config-4</id> <phase>prepare-package</phase> <goals> <goal>exec</goal> </goals> <configuration> <executable>npm</executable> <arguments> <argument>config</argument> <argument>set</argument> <argument>sass_binary_site</argument> <argument>https://repo.huaweicloud.com/node-sass</argument> </arguments> <!-- <workingDirectory>${basedir}</workingDirectory>--> </configuration> </execution> <execution> <id>exec-npm-install</id> <phase>prepare-package</phase> <goals> <goal>exec</goal> </goals> <configuration> <executable>npm</executable> <arguments> <argument>install</argument> </arguments> <workingDirectory>${basedir}</workingDirectory> </configuration> </execution> <execution> <id>exec-npm-run-build</id> <phase>prepare-package</phase> <goals> <goal>exec</goal> </goals> <configuration> <executable>npm</executable> <arguments> <argument>run</argument> <argument>build</argument> </arguments> <workingDirectory>${basedir}</workingDirectory> </configuration> </execution> </executions> </plugin> </plugins> </build>
- Create a Maven build task.
- Add the following npm installation and environment configuration commands to the Maven build task:
# Create a directory.
mkdir ./node
# Run the curl command to download the Node.js software package.
curl -kv https://mirrors.xxxcloud.com/nodejs/v10.15.3/node-v10.15.3-linux-x64.tar.gz -o ./node/node-v10.15.3-linux-x64.tar.gz
Run the tar command to decompress the package:
1
tar -zxvf ./node/node-v10.15.3-linux-x64.tar.gz -C ./node
# Configure environment variables.
export NODEJS_HOME="${WORKSPACE}/node/node-v10.15.3-linux-x64" export PATH="${NODEJS_HOME}/bin:${PATH}"
- Save the settings and verify the build.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.