diff --git a/build.sbt b/build.sbt index b5d0df5a..405163a8 100755 --- a/build.sbt +++ b/build.sbt @@ -23,7 +23,7 @@ lazy val buildSettings: Seq[Setting[_]] = Seq( organizationName := "Xerial project", organizationHomepage := Some(new URL("http://xerial.org/")), description := "A sbt plugin for publishing Scala/Java projects to the Maven Central through Sonatype Nexus REST API", - publishArtifact in Test := false, + Test / publishArtifact := false, sbtPlugin := true, parallelExecution := true, scalacOptions ++= Seq("-encoding", "UTF-8", "-deprecation", "-unchecked"), @@ -33,7 +33,7 @@ lazy val buildSettings: Seq[Setting[_]] = Seq( }, crossSbtVersions := Vector("1.2.8"), releaseCrossBuild := false, - releaseTagName := { (version in ThisBuild).value }, + releaseTagName := { (ThisBuild / version).value }, releasePublishArtifactsAction := PgpKeys.publishSigned.value, releaseProcess := Seq[ReleaseStep]( checkSnapshotDependencies, diff --git a/src/main/scala/xerial/sbt/Sonatype.scala b/src/main/scala/xerial/sbt/Sonatype.scala index 357819c4..c7eb192a 100755 --- a/src/main/scala/xerial/sbt/Sonatype.scala +++ b/src/main/scala/xerial/sbt/Sonatype.scala @@ -65,7 +65,7 @@ object Sonatype extends AutoPlugin with LogSupport { ) lazy val sonatypeSettings = Seq[Def.Setting[_]]( sonatypeProfileName := organization.value, - sonatypeRepository := s"https://${sonatypeCredentialHost.value}/service/local", + sonatypeRepository := s"https://${(ThisBuild / sonatypeCredentialHost).value}/service/local", sonatypeProjectHosting := None, publishMavenStyle := true, pomIncludeRepository := { _ => @@ -413,10 +413,13 @@ object Sonatype extends AutoPlugin with LogSupport { val logLevel = LogLevel(extracted.get(sonatypeLogLevel)) wvlet.log.Logger.setDefaultLogLevel(logLevel) - val repositoryUrl = extracted.get(sonatypeRepository) - val creds = getCredentials(extracted, state) - val credentialHost = extracted.get(sonatypeCredentialHost) + // #276 Need to use the root configuration + val credentialHost = extracted.get(ThisBuild / sonatypeCredentialHost) + val currentSonatypeProfile = profileName.getOrElse(extracted.get(sonatypeProfileName)) + val repositoryUrl = extracted.get(sonatypeRepository) + val timeoutMillis = extracted.get(sonatypeTimeoutMillis) + val creds = getCredentials(extracted, state) val hashsum: String = { val input = Vector(repositoryUrl, creds.toString(), credentialHost).mkString("-") MurmurHash3.stringHash(input).abs.toString() @@ -426,11 +429,11 @@ object Sonatype extends AutoPlugin with LogSupport { repositoryUrl = repositoryUrl, cred = creds, credentialHost = credentialHost, - timeoutMillis = extracted.get(sonatypeTimeoutMillis) + timeoutMillis = timeoutMillis ) val service = new SonatypeService( sonatypeClient, - profileName.getOrElse(extracted.get(sonatypeProfileName)), + currentSonatypeProfile, Some(hashsum) ) try {