|
6 | 6 |
|
7 | 7 | <groupId>io.github.bsayli</groupId> |
8 | 8 | <artifactId>customer-service-client</artifactId> |
9 | | - <version>0.7.8</version> |
| 9 | + <version>0.7.9-SNAPSHOT</version> |
10 | 10 | <name>customer-service-client</name> |
11 | 11 | <description>Generated client (RestClient) using generics-aware OpenAPI templates</description> |
12 | 12 | <packaging>jar</packaging> |
|
40 | 40 | <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> |
41 | 41 | <java.version>21</java.version> |
42 | 42 |
|
43 | | - <spring-boot.version>3.5.11</spring-boot.version> |
44 | | - <openapi.generator.version>7.20.0</openapi.generator.version> |
| 43 | + <spring-boot.version>3.5.12</spring-boot.version> |
| 44 | + <openapi.generator.version>7.21.0</openapi.generator.version> |
45 | 45 |
|
46 | 46 | <jakarta.validation.version>3.1.1</jakarta.validation.version> |
47 | 47 | <jakarta.annotation-api.version>3.0.0</jakarta.annotation-api.version> |
|
56 | 56 | <spotless-maven-plugin.version>3.3.0</spotless-maven-plugin.version> |
57 | 57 | <maven-surefire-plugin.version>3.5.5</maven-surefire-plugin.version> |
58 | 58 | <maven-failsafe-plugin.version>3.5.5</maven-failsafe-plugin.version> |
59 | | - |
60 | | - <openapi.templates.upstream>${project.build.directory}/upstream-templates</openapi.templates.upstream> |
| 59 | + <maven-antrun-plugin.version>3.2.0</maven-antrun-plugin.version> |
61 | 60 | <openapi.templates.effective>${project.build.directory}/effective-templates</openapi.templates.effective> |
62 | 61 | <api-contract.version>0.7.7</api-contract.version> |
63 | 62 | <slf4j-api.version>2.0.17</slf4j-api.version> |
|
164 | 163 | <groupId>org.apache.maven.plugins</groupId> |
165 | 164 | <artifactId>maven-dependency-plugin</artifactId> |
166 | 165 | <version>${maven.dependency.plugin.version}</version> |
| 166 | + |
167 | 167 | <executions> |
| 168 | + |
168 | 169 | <execution> |
169 | | - <id>unpack-openapi-upstream-templates</id> |
| 170 | + <id>extract-openapi-model-template</id> |
170 | 171 | <phase>generate-sources</phase> |
171 | 172 | <goals> |
172 | 173 | <goal>unpack</goal> |
173 | 174 | </goals> |
| 175 | + |
174 | 176 | <configuration> |
175 | 177 | <artifactItems> |
176 | 178 | <artifactItem> |
|
179 | 181 | <version>${openapi.generator.version}</version> |
180 | 182 | <type>jar</type> |
181 | 183 | <overWrite>true</overWrite> |
182 | | - <includes>templates/Java/**</includes> |
183 | | - <outputDirectory>${openapi.templates.upstream}</outputDirectory> |
| 184 | + <includes>**/Java/model.mustache</includes> |
| 185 | + <outputDirectory>${openapi.templates.effective}</outputDirectory> |
184 | 186 | </artifactItem> |
185 | 187 | </artifactItems> |
186 | 188 | </configuration> |
187 | 189 | </execution> |
| 190 | + |
188 | 191 | <execution> |
189 | 192 | <goals> |
190 | 193 | <goal>properties</goal> |
191 | 194 | </goals> |
192 | 195 | </execution> |
| 196 | + |
193 | 197 | </executions> |
194 | 198 | </plugin> |
195 | 199 |
|
196 | 200 | <plugin> |
197 | 201 | <groupId>org.apache.maven.plugins</groupId> |
198 | | - <artifactId>maven-resources-plugin</artifactId> |
199 | | - <version>${maven.resources.plugin.version}</version> |
| 202 | + <artifactId>maven-antrun-plugin</artifactId> |
| 203 | + <version>${maven-antrun-plugin.version}</version> |
| 204 | + |
200 | 205 | <executions> |
201 | 206 | <execution> |
202 | | - <id>copy-upstream-to-effective</id> |
| 207 | + <id>patch-openapi-model-template</id> |
203 | 208 | <phase>generate-sources</phase> |
204 | 209 | <goals> |
205 | | - <goal>copy-resources</goal> |
| 210 | + <goal>run</goal> |
206 | 211 | </goals> |
| 212 | + |
207 | 213 | <configuration> |
208 | | - <outputDirectory>${openapi.templates.effective}</outputDirectory> |
209 | | - <resources> |
210 | | - <resource> |
211 | | - <directory>${openapi.templates.upstream}/templates</directory> |
212 | | - <includes> |
213 | | - <include>Java/**</include> |
214 | | - </includes> |
215 | | - </resource> |
216 | | - </resources> |
| 214 | + <target> |
| 215 | + |
| 216 | + <replaceregexp byline="false" flags="s"> |
| 217 | + |
| 218 | + <regexp pattern="(.*)\{\{#models}}\s*\{\{#model}}[\s\S]*?\{\{\/model}}\s*\{\{\/models}}\s*$"/> |
| 219 | + |
| 220 | + <substitution expression="\1{{#models}}{{#model}}{{#vendorExtensions.x-api-wrapper}}{{>api_wrapper}}{{/vendorExtensions.x-api-wrapper}}{{^vendorExtensions.x-api-wrapper}}{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#vendorExtensions.x-is-one-of-interface}}{{>oneof_interface}}{{/vendorExtensions.x-is-one-of-interface}}{{^vendorExtensions.x-is-one-of-interface}}{{>pojo}}{{/vendorExtensions.x-is-one-of-interface}}{{/isEnum}}{{/vendorExtensions.x-api-wrapper}}{{/model}}{{/models}}"/> |
| 221 | + |
| 222 | + <fileset dir="${openapi.templates.effective}"> |
| 223 | + <include name="**/Java/model.mustache"/> |
| 224 | + </fileset> |
| 225 | + |
| 226 | + </replaceregexp> |
| 227 | + |
| 228 | + </target> |
217 | 229 | </configuration> |
| 230 | + |
218 | 231 | </execution> |
| 232 | + </executions> |
| 233 | + </plugin> |
| 234 | + |
| 235 | + <plugin> |
| 236 | + <groupId>org.apache.maven.plugins</groupId> |
| 237 | + <artifactId>maven-resources-plugin</artifactId> |
| 238 | + <version>${maven.resources.plugin.version}</version> |
| 239 | + <executions> |
219 | 240 |
|
220 | 241 | <execution> |
221 | 242 | <id>overlay-local-templates</id> |
|
0 commit comments