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._
|
||||||
import sbt.Keys._
|
import sbt.Keys._
|
||||||
import com.lightbend.sbt.publishrsync.PublishRsyncPlugin.autoImport.publishRsyncHost
|
import com.lightbend.sbt.publishrsync.PublishRsyncPlugin.autoImport.publishRsyncHost
|
||||||
import xerial.sbt.Sonatype.autoImport.sonatypeProfileName
|
import xerial.sbt.Sonatype.autoImport._
|
||||||
|
|
||||||
object Publish extends AutoPlugin {
|
object Publish extends AutoPlugin {
|
||||||
|
|
||||||
override def trigger = allRequirements
|
override def trigger = allRequirements
|
||||||
|
|
||||||
|
private val apacheBaseRepo = "repository.apache.org"
|
||||||
|
|
||||||
override lazy val projectSettings = Seq(
|
override lazy val projectSettings = Seq(
|
||||||
publishTo := Some(pekkoPublishTo.value),
|
|
||||||
publishRsyncHost := "akkarepo@gustav.akka.io",
|
publishRsyncHost := "akkarepo@gustav.akka.io",
|
||||||
credentials ++= apacheNexusCredentials,
|
credentials ++= apacheNexusCredentials,
|
||||||
organizationName := "Apache Software Foundation",
|
organizationName := "Apache Software Foundation",
|
||||||
organizationHomepage := Some(url("https://www.apache.org")),
|
organizationHomepage := Some(url("https://www.apache.org")),
|
||||||
|
sonatypeCredentialHost := apacheBaseRepo,
|
||||||
sonatypeProfileName := "org.apache.pekko",
|
sonatypeProfileName := "org.apache.pekko",
|
||||||
startYear := Some(2022),
|
startYear := Some(2022),
|
||||||
developers := List(
|
developers := List(
|
||||||
|
|
@ -39,17 +41,10 @@ object Publish extends AutoPlugin {
|
||||||
publishMavenStyle := true,
|
publishMavenStyle := true,
|
||||||
pomIncludeRepository := (_ => false))
|
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] =
|
private def apacheNexusCredentials: Seq[Credentials] =
|
||||||
(sys.env.get("NEXUS_USER"), sys.env.get("NEXUS_PW")) match {
|
(sys.env.get("NEXUS_USER"), sys.env.get("NEXUS_PW")) match {
|
||||||
case (Some(user), Some(password)) =>
|
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 _ =>
|
case _ =>
|
||||||
Seq.empty
|
Seq.empty
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue