|
1 | | -import java.net.URI |
| 1 | +import net.thebugmc.gradle.sonatypepublisher.PublishingType |
2 | 2 | import java.util.Properties |
3 | 3 |
|
4 | 4 | plugins { |
5 | 5 | id("java-library") |
6 | | - id("maven-publish") |
7 | | - id("signing") |
8 | 6 | id("org.openapi.generator") version "7.5.0" |
9 | 7 | id("org.kordamp.gradle.jandex") version "2.0.0" |
10 | 8 | id("com.github.gmazzo.buildconfig") version "5.6.2" |
| 9 | + id("net.thebugmc.gradle.sonatype-central-portal-publisher") version "1.2.4" |
11 | 10 | } |
12 | 11 |
|
| 12 | +group = "io.apistax" |
13 | 13 | version = "1.6.0" |
14 | 14 |
|
15 | 15 | dependencies { |
@@ -104,91 +104,71 @@ openApiGenerate { |
104 | 104 | } |
105 | 105 |
|
106 | 106 | val properties = Properties().apply { |
107 | | - if (System.getenv().containsKey("OSSRH_USERNAME")) { |
108 | | - put("ossrhUsername", System.getenv("OSSRH_USERNAME")) |
109 | | - put("ossrhPassword", System.getenv("OSSRH_PASSWORD")) |
| 107 | + if (System.getenv().containsKey("PORTAL_USERNAME")) { |
| 108 | + put("portalUsername", System.getenv("PORTAL_USERNAME")) |
| 109 | + put("portalPassword", System.getenv("PORTAL_PASSWORD")) |
110 | 110 | } else { |
111 | 111 | load(project.rootProject.file("local.properties").inputStream()) |
112 | 112 | } |
113 | 113 | } |
114 | 114 |
|
115 | | -publishing { |
116 | | - publications { |
117 | | - create<MavenPublication>("apistax") { |
118 | | - groupId = "io.apistax" |
119 | | - artifactId = "apistax-client" |
120 | | - from(components["java"]) |
121 | | - |
122 | | - pom { |
123 | | - name = "apistax-client" |
124 | | - description = "Secure and reliable APIs for your common business needs." |
125 | | - url = "https://apistax.io/" |
126 | | - inceptionYear = "2022" |
127 | | - |
128 | | - licenses { |
129 | | - license { |
130 | | - name = "Apache License 2.0" |
131 | | - url = "https://raw.githubusercontent.com/APIstax/client-java/main/LICENSE" |
132 | | - } |
133 | | - } |
134 | | - |
135 | | - organization { |
136 | | - name = "instant:solutions OG" |
137 | | - url = "https://instant-it.at/" |
138 | | - } |
139 | | - |
140 | | - developers { |
141 | | - developer { |
142 | | - id = "holzleitner" |
143 | | - name = "Max Holzleitner" |
144 | | - email = "max.holzleitner@instant-it.at" |
145 | | - organization = "instant:solutions OG" |
146 | | - organizationUrl = "https://instant-it.at/" |
147 | | - timezone = "Europe/Vienna" |
148 | | - } |
149 | | - |
150 | | - developer { |
151 | | - id = "andlinger" |
152 | | - name = "David Andlinger" |
153 | | - email = "david.andlinger@instant-it.at" |
154 | | - organization = "instant:solutions OG" |
155 | | - organizationUrl = "https://instant-it.at/" |
156 | | - timezone = "Europe/Vienna" |
157 | | - } |
158 | | - } |
159 | | - |
160 | | - scm { |
161 | | - connection = "scm:git:github.com/apistax/client-java.git" |
162 | | - developerConnection = "scm:git:github.com/apistax/client-java.git" |
163 | | - url = "https://github.com/apistax/client-java" |
164 | | - } |
| 115 | +centralPortal { |
| 116 | + username = properties.getProperty("portalUsername") |
| 117 | + password = properties.getProperty("portalPassword") |
| 118 | + |
| 119 | + publishingType = PublishingType.AUTOMATIC |
| 120 | + |
| 121 | + name = "apistax-client" |
| 122 | + |
| 123 | + pom { |
| 124 | + name = "apistax-client" |
| 125 | + description = "Secure and reliable APIs for your common business needs." |
| 126 | + url = "https://apistax.io/" |
| 127 | + inceptionYear = "2022" |
| 128 | + |
| 129 | + licenses { |
| 130 | + license { |
| 131 | + name = "Apache License 2.0" |
| 132 | + url = "https://raw.githubusercontent.com/APIstax/client-java/main/LICENSE" |
165 | 133 | } |
166 | 134 | } |
167 | | - } |
168 | 135 |
|
169 | | - repositories { |
170 | | - maven { |
171 | | - name = "ossrh" |
172 | | - url = URI("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") |
173 | | - credentials { |
174 | | - username = properties.getProperty("ossrhUsername") |
175 | | - password = properties.getProperty("ossrhPassword") |
176 | | - } |
| 136 | + organization { |
| 137 | + name = "instant:solutions OG" |
| 138 | + url = "https://instant-it.at/" |
177 | 139 | } |
178 | 140 |
|
179 | | - maven { |
180 | | - name = "ossrhSnapshot" |
181 | | - url = URI("https://s01.oss.sonatype.org/content/repositories/snapshots/") |
182 | | - credentials { |
183 | | - username = properties.getProperty("ossrhUsername") |
184 | | - password = properties.getProperty("ossrhPassword") |
| 141 | + developers { |
| 142 | + developer { |
| 143 | + id = "holzleitner" |
| 144 | + name = "Max Holzleitner" |
| 145 | + email = "max.holzleitner@instant-it.at" |
| 146 | + organization = "instant:solutions OG" |
| 147 | + organizationUrl = "https://instant-it.at/" |
| 148 | + timezone = "Europe/Vienna" |
| 149 | + } |
| 150 | + |
| 151 | + developer { |
| 152 | + id = "andlinger" |
| 153 | + name = "David Andlinger" |
| 154 | + email = "david.andlinger@instant-it.at" |
| 155 | + organization = "instant:solutions OG" |
| 156 | + organizationUrl = "https://instant-it.at/" |
| 157 | + timezone = "Europe/Vienna" |
185 | 158 | } |
186 | 159 | } |
187 | | - } |
188 | | -} |
189 | 160 |
|
190 | | -signing { |
191 | | - sign(publishing.publications["apistax"]) |
| 161 | + scm { |
| 162 | + connection = "scm:git:github.com/apistax/client-java.git" |
| 163 | + developerConnection = "scm:git:github.com/apistax/client-java.git" |
| 164 | + url = "https://github.com/apistax/client-java" |
| 165 | + } |
| 166 | + |
| 167 | + issueManagement { |
| 168 | + system = "GitHub" |
| 169 | + url = "https://github.com/apistax/client-java/issues" |
| 170 | + } |
| 171 | + } |
192 | 172 | } |
193 | 173 |
|
194 | 174 | tasks["compileJava"].setDependsOn(listOf(tasks["openApiGenerate"])) |
|
0 commit comments