1+ plugins {
2+ id ' java-library'
3+ id ' maven-publish'
4+ id ' signing'
5+ id ' org.openapi.generator' version ' 7.5.0'
6+ id ' org.kordamp.gradle.jandex' version ' 2.0.0'
7+ }
8+
9+ version = " 1.4.1"
10+
11+ dependencies {
12+ implementation " jakarta.annotation:jakarta.annotation-api:3.0.0"
13+ implementation " com.google.code.findbugs:jsr305:3.0.2"
14+ implementation " com.fasterxml.jackson.core:jackson-core:2.17.1"
15+ implementation " com.fasterxml.jackson.core:jackson-annotations:2.17.1"
16+ implementation " com.fasterxml.jackson.core:jackson-databind:2.17.1"
17+ implementation " com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.1"
18+ implementation " org.openapitools:jackson-databind-nullable:0.2.6"
19+ implementation " io.mikael:urlbuilder:2.0.9"
20+
21+ testImplementation " org.wiremock:wiremock:3.9.1"
22+ testImplementation " org.junit.jupiter:junit-jupiter-api:5.10.2"
23+ testRuntimeOnly " org.junit.jupiter:junit-jupiter-engine:5.10.2"
24+ }
25+
26+ java {
27+ toolchain {
28+ languageVersion = JavaLanguageVersion . of(11 )
29+ }
30+
31+ withJavadocJar()
32+ withSourcesJar()
33+ }
34+
35+ test {
36+ useJUnitPlatform()
37+ }
38+
39+ sourceSets {
40+ main {
41+ java {
42+ srcDir " $buildDir /generated/sources/openapi/src/main/java"
43+ }
44+ }
45+ }
46+
47+ jar {
48+ manifest {
49+ attributes(
50+ " Implementation-Title" : " APIstax Java Client" ,
51+ " Implementation-Vendor" : " instant:solutions OG" ,
52+ " Implementation-URL" : " https://apistax.io" ,
53+ " Bundle-License" : " https://raw.githubusercontent.com/APIstax/client-java/main/LICENSE" ,
54+ " Scm-Connection" : " scm:git:github.com/apistax/client-java.git" ,
55+ " Scm-Url" : " https://github.com/apistax/client-java" ,
56+ " Build-Jdk-Spec" : java. toolchain. languageVersion. get(). asInt()
57+ )
58+ }
59+ }
60+
61+ openApiGenerate {
62+ generatorName = ' java'
63+ inputSpec = " $projectDir /api.yml"
64+ outputDir = " $buildDir /generated/sources/openapi"
65+ packageName = ' io.apistax'
66+ modelPackage = ' io.apistax.models'
67+ apiPackage = ' io.apistax.apis'
68+ library = ' native'
69+
70+ globalProperties = [
71+ apis : ' false' ,
72+ models : ' ' ,
73+ modelDocs : ' false' ,
74+ modelTests : ' false' ,
75+ supportingFiles : ' false'
76+ ]
77+
78+ configOptions = [
79+ dateLibrary : ' java8' ,
80+ useRuntimeException : ' true' ,
81+ useJakartaEe : ' true'
82+ ]
83+ }
84+
85+ Properties properties = new Properties ()
86+ if (System . getenv(" OSSRH_USERNAME" ) == null ) {
87+ properties. load(project. rootProject. file(' local.properties' ). newDataInputStream())
88+ } else {
89+ properties. put(" ossrhUsername" , System . getenv(" OSSRH_USERNAME" ))
90+ properties. put(" ossrhPassword" , System . getenv(" OSSRH_PASSWORD" ))
91+ }
92+
93+ publishing {
94+ publications {
95+ apistax(MavenPublication ) {
96+ groupId = ' io.apistax'
97+ artifactId = ' apistax-client'
98+ from components. java
99+
100+ pom {
101+ name = ' apistax-client'
102+ description = ' Secure and reliable APIs for your common business needs.'
103+ url = ' https://apistax.io'
104+ inceptionYear = ' 2022'
105+
106+ licenses {
107+ license {
108+ name = ' Apache License 2.0'
109+ url = ' https://raw.githubusercontent.com/APIstax/client-java/main/LICENSE'
110+ }
111+ }
112+
113+ organization {
114+ name = ' instant:solutions OG'
115+ url = ' https://instant-it.at'
116+ }
117+
118+ developers {
119+ developer {
120+ id = ' holzleitner'
121+ name = ' Max Holzleitner'
122+ email = ' max.holzleitner@instant-it.at'
123+ organization = ' instant:solutions OG'
124+ organizationUrl = ' https://instant-it.at'
125+ timezone = ' Europe/Vienna'
126+ }
127+
128+ developer {
129+ id = ' andlinger'
130+ name = ' David Andlinger'
131+ email = ' david.andlinger@instant-it.at'
132+ organization = ' instant:solutions OG'
133+ organizationUrl = ' https://instant-it.at'
134+ timezone = ' Europe/Vienna'
135+ }
136+ }
137+
138+ scm {
139+ connection = ' scm:git:github.com/apistax/client-java.git'
140+ developerConnection = ' scm:git:github.com/apistax/client-java.git'
141+ url = ' https://github.com/apistax/client-java'
142+ }
143+ }
144+ }
145+ }
146+
147+ repositories {
148+ maven {
149+ name = " ossrh"
150+ url = " https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
151+ credentials {
152+ username = properties. getProperty(' ossrhUsername' )
153+ password = properties. getProperty(' ossrhPassword' )
154+ }
155+ }
156+
157+ maven {
158+ name = " ossrhSnapshot"
159+ url = " https://s01.oss.sonatype.org/content/repositories/snapshots/"
160+ credentials {
161+ username = properties. getProperty(' ossrhUsername' )
162+ password = properties. getProperty(' ossrhPassword' )
163+ }
164+ }
165+ }
166+ }
167+
168+ signing {
169+ sign publishing. publications. apistax
170+ }
171+
172+ compileJava. dependsOn tasks. openApiGenerate
173+ sourcesJar. dependsOn tasks. openApiGenerate
174+ compileTestJava. dependsOn tasks. jandex
175+ javadoc. dependsOn tasks. jandex
0 commit comments