From 449ddacd3ec35d35f010c2f9ea4076b3c7e3c0cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93lafur=20P=C3=A1ll=20Geirsson?= Date: Wed, 5 Sep 2018 09:06:21 +0200 Subject: [PATCH] Allow overwrite = true when publishing I've encountered several times that release fails because of the same module being published twice. The recommended solution is to "fix the release step" to avoid duplicate publishing. However, in my case it's happening for a Java-only module with CrossVersion.disabled and crossScalaVersions 2.12 and still it tries to publish for 2.11 and 2.12, causing overwrite = false errors. I've manually tested this change in Scalafix and it resolved the issue I was facing with the Java-only module. --- plugin/src/main/scala/com/geirsson/CiReleasePlugin.scala | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugin/src/main/scala/com/geirsson/CiReleasePlugin.scala b/plugin/src/main/scala/com/geirsson/CiReleasePlugin.scala index cb22a4b..839d7f8 100644 --- a/plugin/src/main/scala/com/geirsson/CiReleasePlugin.scala +++ b/plugin/src/main/scala/com/geirsson/CiReleasePlugin.scala @@ -72,6 +72,10 @@ object CiReleasePlugin extends AutoPlugin { ) override def projectSettings: Seq[Def.Setting[_]] = List( + publishConfiguration := + publishConfiguration.value.withOverwrite(true), + publishLocalConfiguration := + publishLocalConfiguration.value.withOverwrite(true), publishTo := sonatypePublishTo.value )