Help Center/ CodeArts Build/ FAQs/ Maven Builds/ Why Is My Download of Maven Components Slow?
Updated on 2024-10-10 GMT+08:00

Why Is My Download of Maven Components Slow?

Symptoms

Maven components are downloaded slowly during the build process.

Cause Analysis

The Maven build action generates a default settings file with a public network address for the mirror of a Maven repository. This can cause some Maven components to be downloaded from the public network. When public network access times out, the components are then downloaded from the private repository. As a result, downloading all Maven components may take a long time.

Solution

(Recommended) Method 1:
  1. Visit the service homepage.
  2. Upload the modified settings.xml file to the root directory of the code repository. For details, see Customizing the settings.xml File.
  3. On the build task list page, click the name of the target build task.
  4. Click Edit. In the Commands window of the Build with Maven action, add --settings settings.xml to use the added settings.xml file for the Maven build.

Method 2:
  1. Visit the service homepage.
  2. On the build task list page, click the name of the target build task.
  3. Click Edit and add the Download File from File Manager action before the Build with Maven action.
  4. Click Upload to upload the custom settings.xml file. Leave the other parameters as default. For details about how to customize the settings.xml file, see Customizing the settings.xml File.
  5. In the Commands window of the Build with Maven action, add --settings settings.xml to use the added settings.xml file for the Maven build.

Customizing the settings.xml File

  1. In the Commands window of the Build with Maven action, run the cat /home/build/.m2/settings.xml command. After the task is complete, the content of the settings.xml file will be displayed in the build logs.
  2. Customize a new settings.xml file according to the information from the settings.xml file in the build logs.