From 99262e57082966fe2c4a750bac4baedd815fcda2 Mon Sep 17 00:00:00 2001
From: Jarek Sacha <jpsacha@gmail.com>
Date: Fri, 20 Sep 2019 15:03:42 -0400
Subject: [PATCH] Update sbt-sonatype setup

---
 build.sbt | 40 +++++++++++-----------------------------
 1 file changed, 11 insertions(+), 29 deletions(-)

diff --git a/build.sbt b/build.sbt
index 2a1cfd8..c398a99 100644
--- a/build.sbt
+++ b/build.sbt
@@ -1,18 +1,20 @@
 import java.net.URL
 
 import sbt.Keys.{licenses, startYear, version}
+import xerial.sbt.Sonatype.GitHubHosting
 // @formatter:off
 
 name := "ijp-debayer2sx"
 
-val _version = "1.0.1"
-
+lazy val _version = "1.0.1"
 lazy val _scalaVersions = Seq("2.13.1", "2.12.10")
-lazy val _scalaVersion = _scalaVersions.head
+lazy val _scalaVersion  = _scalaVersions.head
 
-scalaVersion := _scalaVersion
+version         := _version
+scalaVersion    := _scalaVersion
 publishArtifact := false
 skip in publish := true
+sonatypeProfileName := "net.sf.ij-plugins"
 
 val commonSettings = Seq(
   homepage      := Some(new URL("https://github.com/ij-plugins/ijp-DeBayer2SX")),
@@ -50,33 +52,13 @@ val commonSettings = Seq(
   fork := true,
   //
   manifestSetting,
-  publishSetting,
-  pomExtra :=
-  <scm>
-    <url>https://github.com/ij-plugins/ijp-DeBayer2SX</url>
-    <connection>scm:https://github.com/ij-plugins/ijp-DeBayer2SX.git</connection>
-  </scm>
-    <developers>
-      <developer>
-        <id>jpsacha</id>
-        <name>Jarek Sacha</name>
-        <url>https://github.com/jpsacha</url>
-      </developer>
-    </developers>
+  // Setup publishing
+  publishMavenStyle := true,
+  sonatypeProfileName := "net.sf.ij-plugins",
+  sonatypeProjectHosting := Some(GitHubHosting("ij-plugins", "ijp-debayer2sx", "jpsacha@gmail.com")),
+  publishTo := sonatypePublishTo.value,
 )
 
-// Resolvers
-lazy val sonatypeNexusSnapshots = Resolver.sonatypeRepo("snapshots")
-lazy val sonatypeNexusStaging = "Sonatype Nexus Staging" at "https://oss.sonatype.org/service/local/staging/deploy/maven2"
-
-lazy val publishSetting = publishTo := {
-  val version: String = _version
-  if (version.trim.endsWith("SNAPSHOT"))
-    Some(sonatypeNexusSnapshots)
-  else
-    Some(sonatypeNexusStaging)
-}
-
 lazy val ijp_debayer2sx_core = project.in(file("ijp-debayer2sx-core"))
   .settings(commonSettings,
     name        := "ijp-debayer2sx-core",