diff --git a/build.sbt b/build.sbt index 441976e..640e10d 100644 --- a/build.sbt +++ b/build.sbt @@ -24,14 +24,19 @@ resolvers in ThisBuild ++= Seq( Resolver.mavenLocal ) +lazy val noPublishSetting = Seq( + publish := {}, + publishLocal := {}, + publishArtifact := false +) + lazy val root = project .in(file(".")) + .settings(noPublishSetting) .enablePlugins(ScalaUnidocPlugin) .settings( name := "flink-jpmml", crossScalaVersions := Seq("2.10.6", "2.11.11"), - publish := {}, - publishLocal := {}, unidocProjectFilter in (ScalaUnidoc, unidoc) := inAnyProject -- inProjects(`flink-jpmml-examples`, `flink-jpmml-assets`) ) diff --git a/project/PublishSettings.scala b/project/PublishSettings.scala index 7c2c92e..ffe330e 100644 --- a/project/PublishSettings.scala +++ b/project/PublishSettings.scala @@ -19,22 +19,50 @@ * */ -import sbt.Keys._ -import sbt._ +import com.typesafe.sbt.SbtPgp.autoImportImpl.PgpKeys +import sbt.Keys.{publishMavenStyle, _} +import sbt.{Def, url, _} +import sbtrelease.ReleasePlugin.autoImport.{releaseCrossBuild, releasePublishArtifactsAction} +import xerial.sbt.Sonatype._ object PublishSettings { - lazy val settings: Seq[Def.Setting[_]] = Seq( - publishArtifact := true, - publishArtifact in (Compile, packageDoc) := false, - publishMavenStyle := true, - publishTo := version { (v: String) => - if (v.trim.endsWith("SNAPSHOT")) - Some("Radicalbit Snapshots" at "https://tools.radicalbit.io/maven/repository/snapshots/") + lazy val settings: Seq[Def.Setting[_]] = sonatypeSettings ++ Seq( + publishTo := Some( + if (isSnapshot.value) + Opts.resolver.sonatypeSnapshots else - Some("Radicalbit Releases" at "https://tools.radicalbit.io/maven/repository/internal/") - }.value, - credentials += Credentials(Path.userHome / ".artifactory" / ".archiva-snapshots"), - credentials += Credentials(Path.userHome / ".artifactory" / ".archiva-releases") + Opts.resolver.sonatypeStaging + ), + publishMavenStyle := true, + licenses := Seq("AGPL-3.0" -> url("https://opensource.org/licenses/AGPL-3.0")), + homepage := Some(url("https://github.com/FlinkML/flink-jpmml")), + scmInfo := Some( + ScmInfo( + url("https://github.com/FlinkML/flink-jpmml"), + "scm:git:git@github.com:FlinkML/flink-jpmml.git" + ) + ), + developers := List( + Developer(id = "spi-x-i", + name = "Andrea Spina", + email = "andrea.spina@radicalbit.io", + url = url("https://github.com/spi-x-i")), + Developer(id = "francescofrontera", + name = "Francesco Frontera", + email = "francesco.frontera@radicalbit.io", + url = url("https://github.com/francescofrontera")), + Developer(id = "riccardo14", + name = "Riccardo Diomedi", + email = "riccardo.diomedi@radicalbit.io", + url = url("https://github.com/riccardo14")), + Developer(id = "maocorte", + name = "Mauro Cortellazzi", + email = "mauro.cortellazzi@radicalbit.io", + url = url("https://github.com/maocorte")) + ), + autoAPIMappings := true, + releaseCrossBuild := true, + releasePublishArtifactsAction := PgpKeys.publishSigned.value ) } diff --git a/project/plugins.sbt b/project/plugins.sbt index 40adeaf..a0b0489 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -25,4 +25,10 @@ addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.0") addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "latest.release") -addSbtPlugin("de.heikoseeberger" % "sbt-header" % "2.0.0") \ No newline at end of file +addSbtPlugin("de.heikoseeberger" % "sbt-header" % "2.0.0") + +addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.6") + +addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1") + +addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")