Skip to content

Commit

Permalink
Scrooge: Fix SBT Publish Build
Browse files Browse the repository at this point in the history
**Problem**
Currently the sbt build fails with the following error

```
 (scrooge-thriftValidation / publishM2) java.io.IOException: PUT operation failed because the destination file exists and overwriting is disabled:
Error:      source     : /home/runner/.dodo/clones/scrooge/scrooge-thrift-validation/target/scala-2.10/scrooge-thriftvalidation_2.10-24.2.0.pom
Error:      destination: file:/home/runner/.m2/repository/com/twitter/scrooge-thriftvalidation_2.10/24.2.0/scrooge-thriftvalidation_2.10-24.2.0.pom
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)
Error:
Error:  If you have a remote cache repository, you can enable overwriting as follows:
Error:      pushRemoteCacheConfiguration := pushRemoteCacheConfiguration.value.withOverwrite(true)
```

**Solution**
Try setting it as snapshot to allow overwrites and set overwrite as true to remote repos

Differential Revision: https://phabricator.twitter.biz/D1141310
  • Loading branch information
ctutika authored and jenkins committed May 6, 2024
1 parent 93087dd commit b9ecf0c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ val sharedSettingsWithoutScalaVersion = Seq(
Test / publishArtifact := false,
pomIncludeRepository := { _ => false },
publishMavenStyle := true,
isSnapshot := true,
publishConfiguration := publishConfiguration.value.withOverwrite(true),
publishLocalConfiguration := publishLocalConfiguration.value.withOverwrite(true),
pomExtra :=
Expand Down

0 comments on commit b9ecf0c

Please sign in to comment.