Skip to content

Commit b9d4b56

Browse files
authored
added ability to publish kotlin-client to maven local repo (#22438)
* this allows pushing client jar to local maven repository gradle -i clean jar publishToMavenLocal; also generates jar with sources; * this allows pushing client jar to local maven repository gradle -i clean jar publishToMavenLocal; also generates jar with sources;
1 parent ea62c67 commit b9d4b56

File tree

50 files changed

+750
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+750
-0
lines changed

modules/openapi-generator/src/main/resources/kotlin-client/build.gradle.mustache

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,3 +233,18 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
233233
}
234234
}
235235
{{/kotlinx_serialization}}
236+
237+
java {
238+
withSourcesJar()
239+
}
240+
241+
publishing {
242+
publications {
243+
maven(MavenPublication) {
244+
groupId = '{{groupId}}'
245+
artifactId = '{{artifactId}}'
246+
version = '{{artifactVersion}}'
247+
from components.java
248+
}
249+
}
250+
}

samples/client/echo_api/kotlin-jvm-okhttp/build.gradle

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,18 @@ dependencies {
6060
implementation "com.squareup.okhttp3:okhttp:5.1.0"
6161
testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2"
6262
}
63+
64+
java {
65+
withSourcesJar()
66+
}
67+
68+
publishing {
69+
publications {
70+
maven(MavenPublication) {
71+
groupId = 'org.openapitools'
72+
artifactId = 'kotlin-jvm-okhttp-echo-api'
73+
version = '1.0.0'
74+
from components.java
75+
}
76+
}
77+
}

samples/client/echo_api/kotlin-jvm-spring-3-restclient/build.gradle

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,18 @@ dependencies {
6666
implementation "org.springframework.boot:spring-boot-starter-web:$spring_boot_version"
6767
testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2"
6868
}
69+
70+
java {
71+
withSourcesJar()
72+
}
73+
74+
publishing {
75+
publications {
76+
maven(MavenPublication) {
77+
groupId = 'org.openapitools'
78+
artifactId = 'kotlin-client'
79+
version = '1.0.0'
80+
from components.java
81+
}
82+
}
83+
}

samples/client/echo_api/kotlin-jvm-spring-3-webclient/build.gradle

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,18 @@ dependencies {
6868
implementation "io.projectreactor:reactor-core:3.7.11"
6969
testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2"
7070
}
71+
72+
java {
73+
withSourcesJar()
74+
}
75+
76+
publishing {
77+
publications {
78+
maven(MavenPublication) {
79+
groupId = 'org.openapitools'
80+
artifactId = 'kotlin-client'
81+
version = '1.0.0'
82+
from components.java
83+
}
84+
}
85+
}

samples/client/echo_api/kotlin-model-prefix-type-mappings/build.gradle

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,18 @@ dependencies {
6363
implementation "com.squareup.retrofit2:converter-scalars:$retrofitVersion"
6464
testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2"
6565
}
66+
67+
java {
68+
withSourcesJar()
69+
}
70+
71+
publishing {
72+
publications {
73+
maven(MavenPublication) {
74+
groupId = 'org.openapitools'
75+
artifactId = 'kotlin-client-prefix-mapping'
76+
version = '1.0.0'
77+
from components.java
78+
}
79+
}
80+
}

samples/client/others/kotlin-integer-enum/build.gradle

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,18 @@ dependencies {
6060
implementation "com.squareup.okhttp3:okhttp:5.1.0"
6161
testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2"
6262
}
63+
64+
java {
65+
withSourcesJar()
66+
}
67+
68+
publishing {
69+
publications {
70+
maven(MavenPublication) {
71+
groupId = 'org.openapitools'
72+
artifactId = 'kotlin-integer-enum'
73+
version = '1.0.0'
74+
from components.java
75+
}
76+
}
77+
}

samples/client/others/kotlin-jvm-okhttp-non-ascii-headers/build.gradle

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,18 @@ dependencies {
6060
implementation "com.squareup.okhttp3:okhttp:5.1.0"
6161
testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2"
6262
}
63+
64+
java {
65+
withSourcesJar()
66+
}
67+
68+
publishing {
69+
publications {
70+
maven(MavenPublication) {
71+
groupId = 'org.openapitools'
72+
artifactId = 'kotlin-petstore-jvm-okhttp-non-ascii-headers'
73+
version = '1.0.0'
74+
from components.java
75+
}
76+
}
77+
}

samples/client/others/kotlin-jvm-okhttp-parameter-tests/build.gradle

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,18 @@ dependencies {
6060
implementation "com.squareup.okhttp3:okhttp:5.1.0"
6161
testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2"
6262
}
63+
64+
java {
65+
withSourcesJar()
66+
}
67+
68+
publishing {
69+
publications {
70+
maven(MavenPublication) {
71+
groupId = 'org.openapitools'
72+
artifactId = 'kotlin-petstore-okhttp4-parameter-tests'
73+
version = '1.0.0'
74+
from components.java
75+
}
76+
}
77+
}

samples/client/others/kotlin-jvm-okhttp-path-comments/build.gradle

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,18 @@ dependencies {
6060
implementation "com.squareup.okhttp3:okhttp:5.1.0"
6161
testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2"
6262
}
63+
64+
java {
65+
withSourcesJar()
66+
}
67+
68+
publishing {
69+
publications {
70+
maven(MavenPublication) {
71+
groupId = 'org.openapitools'
72+
artifactId = 'kotlin-petstore-okhttp4-path-comments'
73+
version = '1.0.0'
74+
from components.java
75+
}
76+
}
77+
}

samples/client/others/kotlin-oneOf-discriminator-kotlinx-serialization/build.gradle

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,18 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
7070
freeCompilerArgs += "-Xopt-in=kotlinx.serialization.ExperimentalSerializationApi"
7171
}
7272
}
73+
74+
java {
75+
withSourcesJar()
76+
}
77+
78+
publishing {
79+
publications {
80+
maven(MavenPublication) {
81+
groupId = 'org.openapitools'
82+
artifactId = 'kotlin-oneOf-discriminator'
83+
version = '1.0.0'
84+
from components.java
85+
}
86+
}
87+
}

0 commit comments

Comments
 (0)