Skip to content

Commit

Permalink
Scope sonatypeCredentialHost to the build instead of projects. (#242)
Browse files Browse the repository at this point in the history
Previously, the `sonatypeCredentialHost` setting had to be redefined
inside every project even if the sbt-sonatype readme documents that
the setting can be configured once via `ThisBuild /` at the root of
build.sbt. This commit moves the definition of that setting to the build
scope so that the behavior is consistent with the documentation.

Related sbt/sbt-ci-release#173
  • Loading branch information
olafurpg authored Aug 14, 2021
1 parent f21a6d5 commit 7074090
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/scala/xerial/sbt/Sonatype.scala
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ object Sonatype extends AutoPlugin with LogSupport {

override def trigger = allRequirements
override def projectSettings = sonatypeSettings
override def buildSettings = sonatypeBuildSettings

import autoImport._
import complete.DefaultParsers._
Expand All @@ -58,10 +59,12 @@ object Sonatype extends AutoPlugin with LogSupport {
val sonatypeLegacy = "oss.sonatype.org"
val sonatype01 = "s01.oss.sonatype.org"

lazy val sonatypeBuildSettings = Seq[Def.Setting[_]](
sonatypeCredentialHost := sonatypeLegacy
)
lazy val sonatypeSettings = Seq[Def.Setting[_]](
sonatypeProfileName := organization.value,
sonatypeRepository := s"https://${sonatypeCredentialHost.value}/service/local",
sonatypeCredentialHost := sonatypeLegacy,
sonatypeProjectHosting := None,
publishMavenStyle := true,
pomIncludeRepository := { _ =>
Expand Down

0 comments on commit 7074090

Please sign in to comment.