Help Center/ CodeArts Build/ FAQs/ Using Maven for Build/ Incomplete JAR Due to Parallel Build Tasks
Updated on 2023-11-28 GMT+08:00

Incomplete JAR Due to Parallel Build Tasks

Symptoms

If the build environment is abnormal or the build mode is improper, the generated JAR package may be missing, but the build result is successful. As a result, the problem is difficult to locate.

  • Prerequisites: Project A depends on project B. Projects A and B are built concurrently. Dependencies A and B are uploaded at the same time. This scenario occurs when different users run different build tasks together or the build tasks are configured to run in parallel in the pipeline.
  • Build results: Both build task A and build task B succeeded.
  • Problem: Artifact B is normal, but artifact A is occasionally incomplete.

Cause Analysis

If project A depends on project B and projects A and B are built at the same time, there is a possibility that when A starts to download dependency B, B is still being uploaded. As a result, A cannot obtain the full content of artifact B.

Solution

  1. Find out all self-developed projects that A depends on: B1, B2, ... Bn.
  2. Check the pipeline to see whether project A and project Bn are configured to run in parallel.
  3. If they run in parallel, edit the pipeline configurations to make A and B run in serial.
  4. If they do not run in serial, check the build history or build time of A and B to confirm whether they had run concurrently.