Help Center/ CodeArts Build/ FAQs/ Using Maven for Build/ Package Remains Old After Code Update
Updated on 2023-11-28 GMT+08:00

Package Remains Old After Code Update

Symptoms

The local code is committed to a remote repository and the code in the remote repository has been updated. However, the code in the package generated after the build is decompressed and decompiled is still the old code.

Cause Analysis

Generally, this problem occurs because the user accidentally uploads the locally compiled file (in the target directory) to the remote repository and does not perform the clean operation before packaging.

Solution

  • Method 1: Delete the target directory of the remote repository.
  • Method 2: Add the clean parameter to the packaging command. For example, if the original packaging command is mvn package -Dmaven.test.skip=true -U -e -X -B, the following information is displayed after the clean parameter is added:
    mvn clean package -Dmaven.test.skip=true -U -e -X -B