使用 "mvn clean install" 构建应用时出现异常



"在 mvn 全新安装期间发生了 Ant BuildException:/api.previous.version 不存在

我正在尝试在 Jenkins 中构建一个应用程序,但它失败了,但出现异常:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.8:run (get-previous-api-version) on project scip: An Ant BuildException has occured: /buildservices/azure/workspace/xyz/target/api.previous.version doesn't exist
[ERROR] around Ant part ...<loadfile property="api.previous.version" srcFile="//target/api.previous.version"/>... @ 5:126 in /buildservices/azure/workspace/target/antrun/build-main.xml
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

Maven 版本 : 3.6.3

命令 :mvn clean install -Dlicense.skipAddThirdParty=true -DskipTests

基于异常,您似乎面临 2 个问题。

  1. Ant 找不到您正在使用的 maven 版本,即 3.6.3,它正在寻找 1.8 版本。尝试在pom.xml中指定版本并查看。

  2. 它在 Azure 工作区中找不到正确的路径。

您可以尝试的另一件事是在没有任何说明符的情况下运行mvn clean install -e,看看结果是什么。我意识到遍历日志可以成为它中断的指标。

我可能是错的,但这是我可以从错误中识别出来的。让我知道它是怎么回事。

最新更新