Troubleshoot common build errors

Updated at:

1. Maven dependency download fails

This issue typically occurs when you use an internal dependency. To resolve this, first confirm the URL of the private repository used for the download. By default, the configuration is in the ~/.m2/settings.xml file. Then, log in to the repository to verify that the dependency exists.

If the dependency exists and you are using the private repository provided by Alibaba Cloud DevOps (repo.rdc.aliyun.com), contact Alibaba Cloud DevOps support for assistance.

2. Go mirror source access fails

This error often occurs due to unstable connections to overseas Go mirror sources. We recommend using the Alibaba Cloud mirror source at https://developer.aliyun.com/mirror.

3. Code download fails

This error usually occurs because the identity that triggers the pipeline lacks permission to access the code, or the branch configured in the input source does not exist. Verify your permission and branch configuration.

4. npm build fails

This error typically occurs because cnpm install was not executed. Check the commands in the relevant task and add cnpm install if it is missing.

5. Upload file path not found

Ensure that the local build artifact path matches the artifact upload path configured in the pipeline.

6. Missing pom.xml file

Verify that the code cloned successfully, and then confirm that a pom.xml file exists in the code repository's root directory.

7. Docker build permission error

Check if the base image specified in the FROM instruction of your Dockerfile is a public image.

8. File for COPY instruction not found

Ensure the file referenced by the COPY instruction exists within the build context. Then, verify that its path in your Dockerfile is correct relative to the build context.

9. Code cloning fails during Docker build

Check if the code repository being cloned is public. If you are cloning a private code repository, you must provide authorization in the Dockerfile or the base image.

10. Regular expressions not supported in upload path

The artifact upload path does not support regular expressions. Use a specific path format, such as target/ or target/app.jar.

11. Access Java artifacts in image build

In a Flow pipeline, each task node runs in an independent workspace. To use artifacts from a Java build step in an image build step, you must place both steps within the same task node. You can do this by selecting the appropriate combined task.

In the task group selection panel, open the Image Build category, and then choose the Java Image Build task.