diff --git a/build.sbt b/build.sbt index 24f3076..f1c32aa 100644 --- a/build.sbt +++ b/build.sbt @@ -1,57 +1,50 @@ + inThisBuild( List( - name:= "HL7-PET", organization := "gov.cdc", organizationName:= "CDC", - homepage := Some(url("https://github.com/cdcgov/hl7-pet")), - description := "This project is a library to Parse HL7 v2 messages", - licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")), - scmInfo:= Some ( - ScmInfo( - url("https://github.com/cdcgov/hl7-pet"), - "scm:git@github.com/cdcgov/hl7-pet.git" - ) - ), - developers := List( - Developer( - id="mcq1", - name="Marcelo Caldas", - email = "mcq1@cdc.com", - url = url ("https://github.com/cdcgov/hl7-pet") - ) - ) ) ) -ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org" -ThisBuild / sonatypeRepository := "https://oss.sonatype.org/service/local/staging/deploy/maven2/" +// Repository for releases on Maven Central using Sonatype +publishTo := sonatypePublishToBundle.value publishMavenStyle := true -scalaVersion := "2.13.13" - -mainClass := Some("gov.cdc.hl7pet.DeIdentifierApp") -Global / excludeLintKeys += mainClass - -libraryDependencies += "org.scalactic" %% "scalactic" % "3.2.14" -libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.14" % "test" -libraryDependencies += "org.scalatest" %% "scalatest-flatspec" % "3.2.14" % Test -libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.14" % Test -libraryDependencies += "com.fasterxml.jackson.core" % "jackson-databind" % "2.14.0" -libraryDependencies += "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.17.0" -libraryDependencies += "com.fasterxml.jackson.module" % "jackson-modules-base" % "2.17.0" pomOnly() -libraryDependencies += "com.google.code.gson" % "gson" % "2.10.1" - -Compile / packageSrc / publishArtifact := true - -onLoadMessage := s"Welcome to sbt-ci-release ${version.value}" - -lazy val plugin = project - .enablePlugins(SbtPlugin) - .settings( - moduleName := "sbt-ci-release", - pluginCrossBuild / sbtVersion := "1.0.4", - addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.0.1"), - addSbtPlugin("com.github.sbt" % "sbt-git" % "2.0.1"), - addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1"), - addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.11.3") - ) \ No newline at end of file +sonatypeProfileName := "gov.cdc" // Your sonatype groupID +// Reference the project OSS repository + +import xerial.sbt.Sonatype.GitHubHosting +sonatypeProjectHosting := Some( + GitHubHosting(user = "Marcelo Caldas", repository = "hl7-pet", email = "mcq1@cdc.gov") +) + +licenses:= Seq( + "APL2" -> url("https://www.apache.org/licenses/LICENSE-2.0.txt")) + +homepage := Some(url("https://cdc.gov")) + +scmInfo := Some( + ScmInfo( + url("https://github.com/cdcgov/hl7-pet"), + "scm:git@github.com/cdcgov/hl7-pet.git" + ) +) + +sonatypeRepository := { + val nexus = "https://s01.oss.sonatype.org/" + if (isSnapshot.value) nexus + "content/repositories/snapshots" + else nexus + "service/local" +} + +import xerial.sbt.Sonatype.sonatypeCentralHost +ThisBuild / sonatypeCredentialHost := sonatypeCentralHost +ThisBuild / sonatypeRepository := "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" +//credentials += Credentials(Path.userHome / ".sbt" / "sonatype_credentials") +//publishTo := Some("Maven Central" at "https://oss.sonatype.org/service/local/staging/deploy/maven2/") +credentials += Credentials( + "Sonatype Nexus Repository Manager", + "oss.sonatype.org", + sys.env.getOrElse("SONATYPE_USERNAME", ""), + sys.env.getOrElse("SONATYPE_PASSWORD", "") +) +publishMavenStyle := true diff --git a/project/plugins.sbt b/project/plugins.sbt index d548539..b43aabd 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,7 +1,7 @@ -//addSbtPlugin("com.codecommit" % "sbt-github-packages" % "0.5.3") -// sbt 1 only, see FAQ for 0.13 support -//addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.6.0") - -//addSbtPlugin("com.typesafe.sbt" % "sbt-pom-reader" % "1.2.0") -addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "2.1.2") -addSbtPlugin("com.typesafe.sbt" % "sbt-sonatype" % "3.9.8") \ No newline at end of file +unmanagedSourceDirectories.in(Compile) += + baseDirectory.in(ThisBuild).value.getParentFile / + "plugin" / "src" / "main" / "scala" +addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.0.1") +addSbtPlugin("com.github.sbt" % "sbt-git" % "2.0.1") +addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1") +addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.11.3") \ No newline at end of file