From 5056e591f14ffb21f86ad983d7beedb163dda7f6 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 26 Feb 2024 00:24:07 +0800 Subject: [PATCH] publish to sonatype --- build.sbt | 5 ----- project/plugin.sbt | 3 ++- publish.sbt | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 publish.sbt diff --git a/build.sbt b/build.sbt index 17ae5e1..3d09040 100644 --- a/build.sbt +++ b/build.sbt @@ -16,11 +16,6 @@ lazy val `sbt-openapi-generator` = (project in file(".")) publishMavenStyle := false, - bintrayRepository := "sbt-plugins", - bintrayOrganization := Option("openapitools"), - bintrayPackageLabels := Seq("sbt", "plugin", "oas", "openapi", "openapi-generator"), - bintrayVcsUrl := Some("git@github.com:OpenAPITools/sbt-openapi-generator.git"), - scriptedLaunchOpts := { scriptedLaunchOpts.value ++ Seq("-Xmx1024M", "-server", "-Dplugin.version=" + version.value) }, diff --git a/project/plugin.sbt b/project/plugin.sbt index a13d930..dd6af8b 100644 --- a/project/plugin.sbt +++ b/project/plugin.sbt @@ -1,5 +1,6 @@ // Manages publishing. -addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.6") +//addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.6") +addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.13") // Versions the build. addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1") diff --git a/publish.sbt b/publish.sbt new file mode 100644 index 0000000..7f74659 --- /dev/null +++ b/publish.sbt @@ -0,0 +1,36 @@ +ThisBuild / organization := "org.openapitools.sbt-openapi-generator" +ThisBuild / organizationName := "OpenAPITools" +ThisBuild / organizationHomepage := Some(url("http://openapitools.org")) + +ThisBuild / scmInfo := Some( + ScmInfo( + url("https://github.com/openapitools/sbt-openapi-generator"), + "scm:git@github.com:openapitools/sbt-openapi-generator.git" + ) +) +ThisBuild / developers := List( + Developer( + id = "openapitools", + name = "OpenAPI Tools", + email = "team@openapitools.org", + url = url("http://openapitools.org") + ) +) + +ThisBuild / description := "openapi-generator sbt plugin." +ThisBuild / licenses := List( + "Apache 2" -> new URL("http://www.apache.org/licenses/LICENSE-2.0.txt") +) +ThisBuild / homepage := Some(url("https://github.com/openapitools/sbt-openapi-generator")) + +// Remove all additional repository other than Maven Central from POM +ThisBuild / pomIncludeRepository := { _ => false } +ThisBuild / publishTo := { + // For accounts created after Feb 2021: + // val nexus = "https://s01.oss.sonatype.org/" + val nexus = "https://oss.sonatype.org/" + //if (isSnapshot.value) Some("snapshots" at nexus + "content/repositories/snapshots") + //else Some("releases" at nexus + "service/local/staging/deploy/maven2") + Some("releases" at nexus + "service/local/staging/deploy/maven2") +} +ThisBuild / publishMavenStyle := true