首页 > 解决方案 > 为什么 SBT 发布一个被跳过的 JAR?

问题描述

需要帮助了解为什么 SBT 会尝试发布已被跳过的 JAR?以及如何解决这个问题?就像在下面的构建日志中一样,发布my-service_2.13-0.45.13-tests.jar被跳过,但仍然sbt publish显示[error] java.io.IOException将它放在工件上。

[warn] Skipping publication of already published artifact: my-service_2.13-0.45.13-tests.jar
[warn] Skipping publication of already published artifact: my-service_2.13-0.45.13-sources.jar
[warn] Skipping publication of already published artifact: my-service_2.13-0.45.13.pom
[warn] Skipping publication of already published artifact: my-service_2.13-0.45.13-it.jar
[warn] Skipping publication of already published artifact: my-service_2.13-0.45.13.jar
[error] java.io.IOException: PUT operation failed because the destination file exists and overwriting is disabled:
[error]     source     : /home/my-system/my-service/target/scala-2.13/my-service_2.13-0.45.13-tests.jar
[error]     destination: https://my-artifactory.com/artifactory/com/my-org/my-service_2.13/0.45.13/my-service_2.13-0.45.13-tests.jar
[error] If you have a staging repository that has failed, drop it and start over.
[error] Otherwise fix the double publishing, or relax the setting as follows:
[error]     publishConfiguration := publishConfiguration.value.withOverwrite(true)
[error]     publishLocalConfiguration := publishLocalConfiguration.value.withOverwrite(true)

我将 SBT 1.3.13 与 Scala 2.13.3 一起使用

标签: scalasbt

解决方案


推荐阅读