|
6 | 6 |
|
7 | 7 | <groupId>io.github.bsayli</groupId> |
8 | 8 | <artifactId>customer-service-client</artifactId> |
9 | | - <version>0.5.0</version> |
| 9 | + <version>0.6.0</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> |
|
20 | 20 | <openapi.generator.version>7.15.0</openapi.generator.version> |
21 | 21 | <maven.compiler.plugin.version>3.13.0</maven.compiler.plugin.version> |
22 | 22 | <build.helper.plugin.version>3.6.0</build.helper.plugin.version> |
| 23 | + <maven.resources.plugin.version>3.3.1</maven.resources.plugin.version> |
| 24 | + <maven.dependency.plugin.version>3.8.1</maven.dependency.plugin.version> |
23 | 25 |
|
24 | 26 | <jakarta.validation.version>3.1.1</jakarta.validation.version> |
25 | 27 | <jakarta.annotation-api.version>3.0.0</jakarta.annotation-api.version> |
26 | 28 | <mockwebserver.version>5.1.0</mockwebserver.version> |
27 | 29 | <httpclient5.version>5.5</httpclient5.version> |
28 | 30 | <junit-jupiter.version>5.13.4</junit-jupiter.version> |
| 31 | + |
| 32 | + <openapi.templates.upstream>${project.build.directory}/upstream-templates</openapi.templates.upstream> |
| 33 | + <openapi.templates.effective>${project.build.directory}/effective-templates</openapi.templates.effective> |
29 | 34 | </properties> |
30 | 35 |
|
31 | 36 | <dependencies> |
32 | | - |
33 | 37 | <dependency> |
34 | 38 | <groupId>org.springframework.boot</groupId> |
35 | 39 | <artifactId>spring-boot-starter-web</artifactId> |
|
80 | 84 | </dependencies> |
81 | 85 |
|
82 | 86 | <build> |
83 | | - |
84 | 87 | <resources> |
85 | 88 | <resource> |
86 | 89 | <directory>src/main/resources</directory> |
87 | 90 | <excludes> |
88 | | - <exclude>**/*.yaml</exclude> |
89 | 91 | <exclude>openapi-templates/**</exclude> |
90 | 92 | </excludes> |
91 | 93 | </resource> |
92 | 94 | </resources> |
93 | 95 |
|
94 | 96 | <plugins> |
| 97 | + <plugin> |
| 98 | + <groupId>org.apache.maven.plugins</groupId> |
| 99 | + <artifactId>maven-dependency-plugin</artifactId> |
| 100 | + <version>${maven.dependency.plugin.version}</version> |
| 101 | + <executions> |
| 102 | + <execution> |
| 103 | + <id>unpack-openapi-upstream-templates</id> |
| 104 | + <phase>generate-sources</phase> |
| 105 | + <goals> |
| 106 | + <goal>unpack</goal> |
| 107 | + </goals> |
| 108 | + <configuration> |
| 109 | + <artifactItems> |
| 110 | + <artifactItem> |
| 111 | + <groupId>org.openapitools</groupId> |
| 112 | + <artifactId>openapi-generator</artifactId> |
| 113 | + <version>${openapi.generator.version}</version> |
| 114 | + <type>jar</type> |
| 115 | + <overWrite>true</overWrite> |
| 116 | + <includes>templates/Java/**</includes> |
| 117 | + <outputDirectory>${openapi.templates.upstream}</outputDirectory> |
| 118 | + </artifactItem> |
| 119 | + </artifactItems> |
| 120 | + </configuration> |
| 121 | + </execution> |
| 122 | + </executions> |
| 123 | + </plugin> |
| 124 | + |
| 125 | + <plugin> |
| 126 | + <groupId>org.apache.maven.plugins</groupId> |
| 127 | + <artifactId>maven-resources-plugin</artifactId> |
| 128 | + <version>${maven.resources.plugin.version}</version> |
| 129 | + <executions> |
| 130 | + <execution> |
| 131 | + <id>copy-upstream-to-effective</id> |
| 132 | + <phase>generate-sources</phase> |
| 133 | + <goals> |
| 134 | + <goal>copy-resources</goal> |
| 135 | + </goals> |
| 136 | + <configuration> |
| 137 | + <outputDirectory>${openapi.templates.effective}</outputDirectory> |
| 138 | + <resources> |
| 139 | + <resource> |
| 140 | + <directory>${openapi.templates.upstream}/templates</directory> |
| 141 | + <includes> |
| 142 | + <include>Java/**</include> |
| 143 | + </includes> |
| 144 | + </resource> |
| 145 | + </resources> |
| 146 | + </configuration> |
| 147 | + </execution> |
| 148 | + |
| 149 | + <execution> |
| 150 | + <id>overlay-local-templates</id> |
| 151 | + <phase>generate-sources</phase> |
| 152 | + <goals> |
| 153 | + <goal>copy-resources</goal> |
| 154 | + </goals> |
| 155 | + <configuration> |
| 156 | + <outputDirectory>${openapi.templates.effective}/Java</outputDirectory> |
| 157 | + <overwrite>true</overwrite> |
| 158 | + <resources> |
| 159 | + <resource> |
| 160 | + <directory>src/main/resources/openapi-templates</directory> |
| 161 | + <filtering>false</filtering> |
| 162 | + <includes> |
| 163 | + <include>**/*.mustache</include> |
| 164 | + </includes> |
| 165 | + </resource> |
| 166 | + </resources> |
| 167 | + </configuration> |
| 168 | + </execution> |
| 169 | + </executions> |
| 170 | + </plugin> |
95 | 171 |
|
96 | 172 | <plugin> |
97 | 173 | <groupId>org.openapitools</groupId> |
|
100 | 176 | <executions> |
101 | 177 | <execution> |
102 | 178 | <id>generate-client</id> |
| 179 | + <phase>generate-sources</phase> |
103 | 180 | <goals> |
104 | 181 | <goal>generate</goal> |
105 | 182 | </goals> |
|
113 | 190 | <modelPackage>io.github.bsayli.openapi.client.generated.dto</modelPackage> |
114 | 191 | <invokerPackage>io.github.bsayli.openapi.client.generated.invoker</invokerPackage> |
115 | 192 |
|
116 | | - <templateDirectory>${project.basedir}/src/main/resources/openapi-templates |
117 | | - </templateDirectory> |
| 193 | + <templateDirectory>${openapi.templates.effective}/Java</templateDirectory> |
118 | 194 |
|
119 | 195 | <generateSupportingFiles>true</generateSupportingFiles> |
120 | 196 | <generateApiDocumentation>false</generateApiDocumentation> |
|
131 | 207 | <dateLibrary>java8</dateLibrary> |
132 | 208 | <useBeanValidation>true</useBeanValidation> |
133 | 209 | <openApiNullable>false</openApiNullable> |
134 | | - <sourceFolder>src/gen/java/main</sourceFolder> |
| 210 | + <sourceFolder>src/gen/java</sourceFolder> |
135 | 211 | </configOptions> |
136 | 212 | </configuration> |
137 | 213 | </execution> |
|
151 | 227 | </goals> |
152 | 228 | <configuration> |
153 | 229 | <sources> |
154 | | - <source>${project.build.directory}/generated-sources/openapi/src/gen/java/main</source> |
| 230 | + <source>${project.build.directory}/generated-sources/openapi/src/gen/java</source> |
155 | 231 | </sources> |
156 | 232 | </configuration> |
157 | 233 | </execution> |
|
0 commit comments