1- import io.github.gradlenexus.publishplugin.CloseNexusStagingRepository
2- import io.github.gradlenexus.publishplugin.ReleaseNexusStagingRepository
31import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
42
53plugins {
6- id(" com.gradle.plugin-publish" ) version " 1.1.0"
7- id(" io.github.gradle-nexus.publish-plugin" ) version " 1.1.0"
8- id(" java-gradle-plugin" )
9- id(" maven-publish" )
10- id(" org.gradle.kotlin.kotlin-dsl" ) version " 2.4.1"
4+ id(" com.gradle.plugin-publish" ) version " 1.3.1"
5+ id(" org.gradle.kotlin.kotlin-dsl" ) version " 4.2.1"
116 id(" org.jetbrains.kotlin.jvm" ) version " 1.9.0"
127 id(" signing" )
138}
@@ -33,10 +28,6 @@ java {
3328repositories {
3429 mavenLocal()
3530 mavenCentral()
36- maven {
37- name = " Sonatype Snapshots"
38- url " https://oss.sonatype.org/content/repositories/snapshots/"
39- }
4031}
4132
4233dependencies {
@@ -73,14 +64,6 @@ tasks.withType(Javadoc).configureEach {
7364 }
7465}
7566
76- tasks. withType(CloseNexusStagingRepository ). configureEach {
77- onlyIf { nexusPublishing. useStaging. get() }
78- }
79-
80- tasks. withType(ReleaseNexusStagingRepository ). configureEach {
81- onlyIf { nexusPublishing. useStaging. get() }
82- }
83-
8467tasks. named(" validatePlugins" ). configure {
8568 enableStricterValidation = true
8669}
@@ -94,76 +77,9 @@ gradlePlugin {
9477 description = " OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)."
9578 displayName = " OpenAPI Generator Gradle Plugin"
9679 implementationClass = " org.openapitools.generator.gradle.plugin.OpenApiGeneratorPlugin"
97- tags. addAll(" openapi-3.0" , " openapi-2.0" , " openapi" , " swagger" , " codegen" , " sdk" )
98- }
99- }
100- }
101-
102- nexusPublishing {
103- repositories {
104- sonatype {
105- username = project. properties[" ossrhUsername" ]
106- password = project. properties[" ossrhPassword" ]
107-
108- // To retrieve: ./gradlew -Psigning.keyId="$SIGNING_KEY" -Psigning.password="$SIGNING_PASSPHRASE" -Psigning.secretKeyRingFile="$SIGNING_SECRET" getStagingProfile
109- stagingProfileId = " 456297f829bbbe"
80+ tags. addAll(" openapi-3.1" , " openapi-3.0" , " openapi-2.0" , " openapi" , " swagger" , " codegen" , " sdk" )
11081 }
11182 }
11283}
11384
114- // Signing requires three keys to be defined: signing.keyId, signing.password, and signing.secretKeyRingFile.
115- // These can be passed to the Gradle command:
116- // ./gradlew -Psigning.keyId=yourid
117- // or stored as key=value pairs in ~/.gradle/gradle.properties
118- // You can also apply them in CI via environment variables. See Gradle's docs for details.
119- signing {
120- required { isReleaseVersion && gradle. taskGraph. hasTask(" publishPluginMavenPublicationToSonatypeRepository" ) }
121- sign(publishing. publications)
122- }
123-
124- // afterEvaluate is necessary because java-gradle-plugin
125- // creates its publications in an afterEvaluate callback
126- afterEvaluate {
127- tasks. named(" publishToSonatype" ). configure {
128- dependsOn(" check" )
129- }
13085
131- publishing {
132- publications {
133- pluginMaven {
134- pom {
135- name = " OpenAPI-Generator Contributors"
136- description = project. description
137- url = " https://openapi-generator.tech"
138- organization {
139- name = " org.openapitools"
140- url = " https://github.com/OpenAPITools"
141- }
142- licenses {
143- license {
144- name = " The Apache Software License, Version 2.0"
145- url = " https://www.apache.org/licenses/LICENSE-2.0.txt"
146- distribution = " repo"
147- }
148- }
149- developers {
150- developer {
151- id = " openapitools"
152- name = " OpenAPI-Generator Contributors"
153- email = " team@openapitools.org"
154- }
155- }
156- scm {
157- url = " https://github.com/OpenAPITools/openapi-generator"
158- connection = " scm:git:git://github.com/OpenAPITools/openapi-generator.git"
159- developerConnection = " scm:git:ssh://git@github.com:OpenAPITools/openapi-generator.git"
160- }
161- issueManagement {
162- system = " GitHub"
163- url = " https://github.com/OpenAPITools/openapi-generator/issues"
164- }
165- }
166- }
167- }
168- }
169- }
0 commit comments