Properly set sonatype repo settings for publishTo
This commit is contained in:
parent
1cca2212d6
commit
beb13d23ef
1 changed files with 5 additions and 10 deletions
|
|
@ -16,18 +16,20 @@ package org.apache.pekko
|
|||
import sbt._
|
||||
import sbt.Keys._
|
||||
import com.lightbend.sbt.publishrsync.PublishRsyncPlugin.autoImport.publishRsyncHost
|
||||
import xerial.sbt.Sonatype.autoImport.sonatypeProfileName
|
||||
import xerial.sbt.Sonatype.autoImport._
|
||||
|
||||
object Publish extends AutoPlugin {
|
||||
|
||||
override def trigger = allRequirements
|
||||
|
||||
private val apacheBaseRepo = "repository.apache.org"
|
||||
|
||||
override lazy val projectSettings = Seq(
|
||||
publishTo := Some(pekkoPublishTo.value),
|
||||
publishRsyncHost := "akkarepo@gustav.akka.io",
|
||||
credentials ++= apacheNexusCredentials,
|
||||
organizationName := "Apache Software Foundation",
|
||||
organizationHomepage := Some(url("https://www.apache.org")),
|
||||
sonatypeCredentialHost := apacheBaseRepo,
|
||||
sonatypeProfileName := "org.apache.pekko",
|
||||
startYear := Some(2022),
|
||||
developers := List(
|
||||
|
|
@ -39,17 +41,10 @@ object Publish extends AutoPlugin {
|
|||
publishMavenStyle := true,
|
||||
pomIncludeRepository := (_ => false))
|
||||
|
||||
private def pekkoPublishTo = Def.setting {
|
||||
if (isSnapshot.value)
|
||||
"apache-snapshots".at("https://repository.apache.org/content/repositories/snapshots")
|
||||
else
|
||||
Opts.resolver.sonatypeStaging
|
||||
}
|
||||
|
||||
private def apacheNexusCredentials: Seq[Credentials] =
|
||||
(sys.env.get("NEXUS_USER"), sys.env.get("NEXUS_PW")) match {
|
||||
case (Some(user), Some(password)) =>
|
||||
Seq(Credentials("Apache Nexus Repository Manager", "repository.apache.org", user, password))
|
||||
Seq(Credentials("Apache Nexus Repository Manager", apacheBaseRepo, user, password))
|
||||
case _ =>
|
||||
Seq.empty
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue