我在我的项目中使用 Maven。如果我的项目不使用某些本地资源,这不是问题。因此,我按照本指南 /sf/answers/4310368121/ 将本地 jar 复制到本地 Maven 存储库并由 Maven 进行验证。
正如您所看到的,在 中maven-install-plugin
,我设置为在clean
阶段安装本地存储库。这意味着mvn clean
,maven 会将我的 jar 复制到 maven 本地存储库。
问题是,如果我分别运行mvn clean
和mvn install
两个命令 => 没有问题如果我运行mvn clean install
=> 构建失败,如日志所示
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project xxxx:xxxx:war:0.0.1-SNAPSHOT: Failure to find org.xxxx:xxxx-ws:jar:1.0.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
Run Code Online (Sandbox Code Playgroud)
看起来默认情况下,maven 总是执行以下顺序:验证>编译>清理>安装。我也尝试过“mvn clean …