From 23d625efaf63edaf797fa6b8c0d8ca1495831053 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 28 Sep 2025 16:09:47 +0800 Subject: [PATCH 1/4] update gradle plugin with new depedencies --- .../build.gradle | 90 +------------------ 1 file changed, 3 insertions(+), 87 deletions(-) diff --git a/modules/openapi-generator-gradle-plugin/build.gradle b/modules/openapi-generator-gradle-plugin/build.gradle index 5bfe8171199d..cd4f6a44fce4 100644 --- a/modules/openapi-generator-gradle-plugin/build.gradle +++ b/modules/openapi-generator-gradle-plugin/build.gradle @@ -1,13 +1,8 @@ -import io.github.gradlenexus.publishplugin.CloseNexusStagingRepository -import io.github.gradlenexus.publishplugin.ReleaseNexusStagingRepository import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { - id("com.gradle.plugin-publish") version "1.1.0" - id("io.github.gradle-nexus.publish-plugin") version "1.1.0" - id("java-gradle-plugin") - id("maven-publish") - id("org.gradle.kotlin.kotlin-dsl") version "2.4.1" + id("com.gradle.plugin-publish") version "1.3.1" + id("org.gradle.kotlin.kotlin-dsl") version "4.2.1" id("org.jetbrains.kotlin.jvm") version "1.9.0" id("signing") } @@ -33,10 +28,6 @@ java { repositories { mavenLocal() mavenCentral() - maven { - name = "Sonatype Snapshots" - url "https://oss.sonatype.org/content/repositories/snapshots/" - } } dependencies { @@ -73,14 +64,6 @@ tasks.withType(Javadoc).configureEach { } } -tasks.withType(CloseNexusStagingRepository).configureEach { - onlyIf { nexusPublishing.useStaging.get() } -} - -tasks.withType(ReleaseNexusStagingRepository).configureEach { - onlyIf { nexusPublishing.useStaging.get() } -} - tasks.named("validatePlugins").configure { enableStricterValidation = true } @@ -94,76 +77,9 @@ gradlePlugin { description = "OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)." displayName = "OpenAPI Generator Gradle Plugin" implementationClass = "org.openapitools.generator.gradle.plugin.OpenApiGeneratorPlugin" - tags.addAll("openapi-3.0", "openapi-2.0", "openapi", "swagger", "codegen", "sdk") - } - } -} - -nexusPublishing { - repositories { - sonatype { - username = project.properties["ossrhUsername"] - password = project.properties["ossrhPassword"] - - // To retrieve: ./gradlew -Psigning.keyId="$SIGNING_KEY" -Psigning.password="$SIGNING_PASSPHRASE" -Psigning.secretKeyRingFile="$SIGNING_SECRET" getStagingProfile - stagingProfileId = "456297f829bbbe" + tags.addAll("openapi-3.1", "openapi-3.0", "openapi-2.0", "openapi", "swagger", "codegen", "sdk") } } } -// Signing requires three keys to be defined: signing.keyId, signing.password, and signing.secretKeyRingFile. -// These can be passed to the Gradle command: -// ./gradlew -Psigning.keyId=yourid -// or stored as key=value pairs in ~/.gradle/gradle.properties -// You can also apply them in CI via environment variables. See Gradle's docs for details. -signing { - required { isReleaseVersion && gradle.taskGraph.hasTask("publishPluginMavenPublicationToSonatypeRepository") } - sign(publishing.publications) -} - -// afterEvaluate is necessary because java-gradle-plugin -// creates its publications in an afterEvaluate callback -afterEvaluate { - tasks.named("publishToSonatype").configure { - dependsOn("check") - } - publishing { - publications { - pluginMaven { - pom { - name = "OpenAPI-Generator Contributors" - description = project.description - url = "https://openapi-generator.tech" - organization { - name = "org.openapitools" - url = "https://github.com/OpenAPITools" - } - licenses { - license { - name = "The Apache Software License, Version 2.0" - url = "https://www.apache.org/licenses/LICENSE-2.0.txt" - distribution = "repo" - } - } - developers { - developer { - id = "openapitools" - name = "OpenAPI-Generator Contributors" - email = "team@openapitools.org" - } - } - scm { - url = "https://github.com/OpenAPITools/openapi-generator" - connection = "scm:git:git://github.com/OpenAPITools/openapi-generator.git" - developerConnection = "scm:git:ssh://git@github.com:OpenAPITools/openapi-generator.git" - } - issueManagement { - system = "GitHub" - url = "https://github.com/OpenAPITools/openapi-generator/issues" - } - } - } - } - } -} From 4786a663b921045a1cb74fec270880ed7c9ded4c Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 1 Sep 2025 21:34:40 +0800 Subject: [PATCH 2/4] fix install errors --- .../openapi-generator-gradle-plugin/build.gradle | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/modules/openapi-generator-gradle-plugin/build.gradle b/modules/openapi-generator-gradle-plugin/build.gradle index cd4f6a44fce4..941c16879c9d 100644 --- a/modules/openapi-generator-gradle-plugin/build.gradle +++ b/modules/openapi-generator-gradle-plugin/build.gradle @@ -1,9 +1,5 @@ -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - plugins { id("com.gradle.plugin-publish") version "1.3.1" - id("org.gradle.kotlin.kotlin-dsl") version "4.2.1" - id("org.jetbrains.kotlin.jvm") version "1.9.0" id("signing") } @@ -52,12 +48,6 @@ tasks.named("test", Test).configure { } } -tasks.withType(KotlinCompile).configureEach { - kotlinOptions { - jvmTarget = "11" - } -} - tasks.withType(Javadoc).configureEach { if (JavaVersion.current().isJava9Compatible()) { options.addBooleanOption("html5", true) @@ -80,6 +70,4 @@ gradlePlugin { tags.addAll("openapi-3.1", "openapi-3.0", "openapi-2.0", "openapi", "swagger", "codegen", "sdk") } } -} - - +} \ No newline at end of file From 8776a00d8a5d0d4f90769244ca24f5c282ce8a70 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 1 Sep 2025 21:56:36 +0800 Subject: [PATCH 3/4] comment out signing --- modules/openapi-generator-gradle-plugin/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator-gradle-plugin/build.gradle b/modules/openapi-generator-gradle-plugin/build.gradle index 941c16879c9d..e79f8b66eb3d 100644 --- a/modules/openapi-generator-gradle-plugin/build.gradle +++ b/modules/openapi-generator-gradle-plugin/build.gradle @@ -1,6 +1,6 @@ plugins { id("com.gradle.plugin-publish") version "1.3.1" - id("signing") + //id("signing") } group = "org.openapitools" From 11e0873fd1293cd5b480c503b7c35f7ba0ae0756 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 1 Sep 2025 22:21:32 +0800 Subject: [PATCH 4/4] Revert "comment out signing" This reverts commit cc95de4bfc2999f65c16919b6fe2620a9c67054b. --- modules/openapi-generator-gradle-plugin/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator-gradle-plugin/build.gradle b/modules/openapi-generator-gradle-plugin/build.gradle index e79f8b66eb3d..941c16879c9d 100644 --- a/modules/openapi-generator-gradle-plugin/build.gradle +++ b/modules/openapi-generator-gradle-plugin/build.gradle @@ -1,6 +1,6 @@ plugins { id("com.gradle.plugin-publish") version "1.3.1" - //id("signing") + id("signing") } group = "org.openapitools"