Building with Maven
Graphical Build
Add Build with Maven, when configuring build actions.
The parameters are described in the following table.
| Parameter | Description |
|---|---|
| Action Name | Assign a custom name to the build action. |
| Tool Version | Select a tool version. |
| Commands | Configure Maven commands. You can also use default commands. |
| setting File Configuration |
NOTE: Release and Snapshot are two types of repositories. Pay attention to their differences. If you upload a dependency to a release repository, it cannot be downloaded during a build.
|
| Release to Self-hosted Repos | By default, CodeArts Build uses the self-hosted repos as the download source of private dependency. The configuration is required for uploading build products to the self-hosted repos and store the build products as dependencies for other projects. Before the configuration, . The configuration procedure is as follows:
The uploaded private dependency can be referenced by adding the groupId, artifactId, and version coordinates in the pom.xml file to other projects. |
| Unit Test | To process unit test results, set the parameters. For details, see Configuring a Unit Test. |
| Cache | Opt to use the cache to improve the build speed. If you set Use Dependency Cache to Yes, the downloaded dependency package is cached during each build. In this way, the dependency package does not need to be pulled repeatedly during subsequent builds, which effectively improves the build speed. NOTE: After the dependency package built by Maven is stored in the cache, the cache directory is updated only when a new dependency package is introduced to the project built by the tenant. The existing dependency package cache file cannot be updated. |
Code-based Build
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | version: 2.0 # The value must be 2.0. steps: BUILD: - maven: image: cloudbuild@maven3.5.3-jdk8-open # You can customize the image path. inputs: settings: public_repos: - https://mirrors.example.com/maven cache: true # Indicates whether to enable the cache. unit_test: coverage: true ignore_errors: false report_path: "**/TEST*.xml" enable: true coverage_report_path: "**/site/jacoco" command: mvn package -Dmaven.test.failure.ignore=true -U -e -X -B |
| Parameter | Type | Description | Mandatory | Default Value |
|---|---|---|---|---|
| image | String | The image address can be in any of the following formats:
| Yes | None |
| settings | Map | Setting for Maven builds. | No | None |
| cache | Bool | Whether to enable cache. | No | false |
| command | String | Commands to be run. | Yes | None |
| unit_test | Map | Unit test. | No | None |
Parameters for unit_test are described in the following table.
| Parameter | Type | Description | Mandatory | Default Value |
|---|---|---|---|---|
| enable | Bool | Whether to process test data. | No | true |
| ignore_errors | Bool | Whether to ignore unit test errors. | No | true |
| report_path | String | Unit test data path. | Yes | None |
| coverage | Bool | Whether to process coverage data. | No | false |
| coverage_report_path | String | Coverage data path. | No | None |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot