| 
47 | 47 | 
 
  | 
48 | 48 | 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>  | 
49 | 49 | 		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>  | 
 | 50 | + | 
 | 51 | +		<generatedDirRelative>src/generated/java</generatedDirRelative>  | 
 | 52 | + | 
 | 53 | +		<!-- Ignore generated code -->  | 
 | 54 | +		<sonar.exclusions>  | 
 | 55 | +			src/generated/**  | 
 | 56 | +		</sonar.exclusions>  | 
50 | 57 | 	</properties>  | 
51 | 58 | 
 
  | 
 | 59 | +	<dependencyManagement>  | 
 | 60 | +		<dependencies>  | 
 | 61 | +			<dependency>  | 
 | 62 | +				<groupId>com.fasterxml.jackson</groupId>  | 
 | 63 | +				<artifactId>jackson-bom</artifactId>  | 
 | 64 | +				<version>2.20.0</version>  | 
 | 65 | +				<type>pom</type>  | 
 | 66 | +				<scope>import</scope>  | 
 | 67 | +			</dependency>  | 
 | 68 | +		</dependencies>  | 
 | 69 | +	</dependencyManagement>  | 
 | 70 | + | 
 | 71 | +	<dependencies>  | 
 | 72 | +		<!-- HTTP client: apache client -->  | 
 | 73 | +		<dependency>  | 
 | 74 | +			<groupId>org.apache.httpcomponents.client5</groupId>  | 
 | 75 | +			<artifactId>httpclient5</artifactId>  | 
 | 76 | +			<version>5.5</version>  | 
 | 77 | +		</dependency>  | 
 | 78 | + | 
 | 79 | +		<!-- JSON processing: jackson -->  | 
 | 80 | +		<dependency>  | 
 | 81 | +			<groupId>com.fasterxml.jackson.core</groupId>  | 
 | 82 | +			<artifactId>jackson-core</artifactId>  | 
 | 83 | +		</dependency>  | 
 | 84 | +		<dependency>  | 
 | 85 | +			<groupId>com.fasterxml.jackson.core</groupId>  | 
 | 86 | +			<artifactId>jackson-annotations</artifactId>  | 
 | 87 | +		</dependency>  | 
 | 88 | +		<dependency>  | 
 | 89 | +			<groupId>com.fasterxml.jackson.core</groupId>  | 
 | 90 | +			<artifactId>jackson-databind</artifactId>  | 
 | 91 | +		</dependency>  | 
 | 92 | +		<dependency>  | 
 | 93 | +			<groupId>com.fasterxml.jackson.datatype</groupId>  | 
 | 94 | +			<artifactId>jackson-datatype-jsr310</artifactId>  | 
 | 95 | +		</dependency>  | 
 | 96 | +		<dependency>  | 
 | 97 | +			<groupId>org.openapitools</groupId>  | 
 | 98 | +			<artifactId>jackson-databind-nullable</artifactId>  | 
 | 99 | +			<version>0.2.7</version>  | 
 | 100 | +		</dependency>  | 
 | 101 | + | 
 | 102 | +		<dependency>  | 
 | 103 | +			<groupId>jakarta.annotation</groupId>  | 
 | 104 | +			<artifactId>jakarta.annotation-api</artifactId>  | 
 | 105 | +			<version>3.0.0</version>  | 
 | 106 | +		</dependency>  | 
 | 107 | +	</dependencies>  | 
 | 108 | + | 
52 | 109 | 	<build>  | 
53 | 110 | 		<pluginManagement>  | 
54 | 111 | 			<plugins>  | 
 | 
137 | 194 | 					</execution>  | 
138 | 195 | 				</executions>  | 
139 | 196 | 			</plugin>  | 
 | 197 | + | 
 | 198 | +			<plugin>  | 
 | 199 | +				<groupId>org.codehaus.mojo</groupId>  | 
 | 200 | +				<artifactId>build-helper-maven-plugin</artifactId>  | 
 | 201 | +				<version>3.6.1</version>  | 
 | 202 | +				<executions>  | 
 | 203 | +					<execution>  | 
 | 204 | +						<phase>generate-sources</phase>  | 
 | 205 | +						<goals>  | 
 | 206 | +							<goal>add-source</goal>  | 
 | 207 | +						</goals>  | 
 | 208 | +						<configuration>  | 
 | 209 | +							<sources>  | 
 | 210 | +								<source>${generatedDirRelative}</source>  | 
 | 211 | +							</sources>  | 
 | 212 | +						</configuration>  | 
 | 213 | +					</execution>  | 
 | 214 | +				</executions>  | 
 | 215 | +			</plugin>  | 
140 | 216 | 		</plugins>  | 
141 | 217 | 	</build>  | 
142 | 218 | 	<profiles>  | 
 | 
203 | 279 | 				</plugins>  | 
204 | 280 | 			</build>  | 
205 | 281 | 		</profile>  | 
 | 282 | +		<profile>  | 
 | 283 | +			<id>openapi-generator</id>  | 
 | 284 | +			<properties>  | 
 | 285 | +				<componentName>INSERT_NAME_HERE</componentName>  | 
 | 286 | + | 
 | 287 | +				<generatedDir>${project.basedir}/${generatedDirRelative}</generatedDir>  | 
 | 288 | +				<openApiRelativeGeneratorDir>src/gen</openApiRelativeGeneratorDir>  | 
 | 289 | +				<openApiGeneratorDir>  | 
 | 290 | +					${project.basedir}/target/generated-sources/openapi/${openApiRelativeGeneratorDir}  | 
 | 291 | +				</openApiGeneratorDir>  | 
 | 292 | +			</properties>  | 
 | 293 | +			<build>  | 
 | 294 | +				<plugins>  | 
 | 295 | +					<plugin>  | 
 | 296 | +						<groupId>org.apache.maven.plugins</groupId>  | 
 | 297 | +						<artifactId>maven-clean-plugin</artifactId>  | 
 | 298 | +						<version>3.5.0</version>  | 
 | 299 | +						<executions>  | 
 | 300 | +							<execution>  | 
 | 301 | +								<id>pre-generation-clean</id>  | 
 | 302 | +								<phase>initialize</phase>  | 
 | 303 | +								<goals>  | 
 | 304 | +									<goal>clean</goal>  | 
 | 305 | +								</goals>  | 
 | 306 | +								<configuration>  | 
 | 307 | +									<excludeDefaultDirectories>true</excludeDefaultDirectories>  | 
 | 308 | +									<filesets>  | 
 | 309 | +										<fileset>  | 
 | 310 | +											<directory>${generatedDir}</directory>  | 
 | 311 | +										</fileset>  | 
 | 312 | +									</filesets>  | 
 | 313 | +								</configuration>  | 
 | 314 | +							</execution>  | 
 | 315 | +							<execution>  | 
 | 316 | +								<id>post-generation-clean</id>  | 
 | 317 | +								<phase>process-resources</phase>  | 
 | 318 | +								<goals>  | 
 | 319 | +									<goal>clean</goal>  | 
 | 320 | +								</goals>  | 
 | 321 | +							</execution>  | 
 | 322 | +						</executions>  | 
 | 323 | +					</plugin>  | 
 | 324 | +					<plugin>  | 
 | 325 | +						<groupId>org.openapitools</groupId>  | 
 | 326 | +						<artifactId>openapi-generator-maven-plugin</artifactId>  | 
 | 327 | +						<version>7.15.0</version>  | 
 | 328 | +						<executions>  | 
 | 329 | +							<execution>  | 
 | 330 | +								<goals>  | 
 | 331 | +									<goal>generate</goal>  | 
 | 332 | +								</goals>  | 
 | 333 | +								<configuration>  | 
 | 334 | +									<inputSpec>${project.basedir}/../openapi/openapi.yml</inputSpec>  | 
 | 335 | +									<generatorName>java</generatorName>  | 
 | 336 | +									<configOptions>  | 
 | 337 | +										<sourceFolder>${openApiRelativeGeneratorDir}</sourceFolder>  | 
 | 338 | +										<library>apache-httpclient</library>  | 
 | 339 | +										<apiPackage>software.xdev.${componentName}.api</apiPackage>  | 
 | 340 | +										<modelPackage>software.xdev.${componentName}.model</modelPackage>  | 
 | 341 | +										<invokerPackage>software.xdev.${componentName}.client</invokerPackage>  | 
 | 342 | +										<!-- Otherwise throw and catch everywhere -->  | 
 | 343 | +										<useRuntimeException>true</useRuntimeException>  | 
 | 344 | +										<!-- Some fields of API have been ignored because they are unused -->  | 
 | 345 | +										<disallowAdditionalPropertiesIfNotPresent>false  | 
 | 346 | +										</disallowAdditionalPropertiesIfNotPresent>  | 
 | 347 | +										<!-- Use newer Jakarta EE instead of Javax -->  | 
 | 348 | +										<useJakartaEe>true</useJakartaEe>  | 
 | 349 | +										<hideGenerationTimestamp>true</hideGenerationTimestamp>  | 
 | 350 | +									</configOptions>  | 
 | 351 | +									<!-- No tests and documentation because we don't use that -->  | 
 | 352 | +									<generateModelTests>false</generateModelTests>  | 
 | 353 | +									<generateApiTests>false</generateApiTests>  | 
 | 354 | +									<generateModelDocumentation>false</generateModelDocumentation>  | 
 | 355 | +									<generateApiDocumentation>false</generateApiDocumentation>  | 
 | 356 | +								</configuration>  | 
 | 357 | +							</execution>  | 
 | 358 | +						</executions>  | 
 | 359 | +					</plugin>  | 
 | 360 | +					<plugin>  | 
 | 361 | +						<groupId>org.apache.maven.plugins</groupId>  | 
 | 362 | +						<artifactId>maven-resources-plugin</artifactId>  | 
 | 363 | +						<version>3.3.1</version>  | 
 | 364 | +						<executions>  | 
 | 365 | +							<execution>  | 
 | 366 | +								<id>copy-generated-resources</id>  | 
 | 367 | +								<phase>process-sources</phase>  | 
 | 368 | +								<goals>  | 
 | 369 | +									<goal>copy-resources</goal>  | 
 | 370 | +								</goals>  | 
 | 371 | +								<configuration>  | 
 | 372 | +									<outputDirectory>${generatedDir}</outputDirectory>  | 
 | 373 | +									<resources>  | 
 | 374 | +										<resource>  | 
 | 375 | +											<directory>${openApiGeneratorDir}</directory>  | 
 | 376 | +										</resource>  | 
 | 377 | +									</resources>  | 
 | 378 | +								</configuration>  | 
 | 379 | +							</execution>  | 
 | 380 | +						</executions>  | 
 | 381 | +					</plugin>  | 
 | 382 | +					<plugin>  | 
 | 383 | +						<groupId>software.xdev</groupId>  | 
 | 384 | +						<artifactId>find-and-replace-maven-plugin</artifactId>  | 
 | 385 | +						<version>1.0.4</version>  | 
 | 386 | +						<executions>  | 
 | 387 | +							<execution>  | 
 | 388 | +								<!-- Remove so that we don't need additional dependency -->  | 
 | 389 | +								<id>remove-unused-import-com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider</id>  | 
 | 390 | +								<phase>process-sources</phase>  | 
 | 391 | +								<goals>  | 
 | 392 | +									<goal>file-contents</goal>  | 
 | 393 | +								</goals>  | 
 | 394 | +								<configuration>  | 
 | 395 | +									<baseDir>${generatedDirRelative}/software/xdev/${componentName}/client/</baseDir>  | 
 | 396 | +									<fileMask>ApiClient.java</fileMask>  | 
 | 397 | +									<!-- @formatter:off DO NOT INTRODUCE LINE BREAK -->  | 
 | 398 | +									<findRegex>^import com\.fasterxml\.jackson\.jaxrs\.json\.JacksonJsonProvider;(\r?\n)</findRegex>  | 
 | 399 | +									<!-- @formatter:on -->  | 
 | 400 | +									<replaceLineBased>false</replaceLineBased>  | 
 | 401 | +								</configuration>  | 
 | 402 | +							</execution>  | 
 | 403 | +							<execution>  | 
 | 404 | +								<!-- Changes with each generator version -->  | 
 | 405 | +								<id>remove-generated-annotation</id>  | 
 | 406 | +								<phase>process-sources</phase>  | 
 | 407 | +								<goals>  | 
 | 408 | +									<goal>file-contents</goal>  | 
 | 409 | +								</goals>  | 
 | 410 | +								<configuration>  | 
 | 411 | +									<baseDir>${generatedDirRelative}/software/xdev/${componentName}/</baseDir>  | 
 | 412 | +									<recursive>true</recursive>  | 
 | 413 | +									<fileMask>.java</fileMask>  | 
 | 414 | +									<findRegex>^@jakarta\.annotation\.Generated.*(\r?\n)</findRegex>  | 
 | 415 | +									<replaceAll>false</replaceAll>  | 
 | 416 | +									<replaceLineBased>false</replaceLineBased>  | 
 | 417 | +								</configuration>  | 
 | 418 | +							</execution>  | 
 | 419 | +							<execution>  | 
 | 420 | +								<!-- Requiring Java serialization indicates a serious misuse of the API -->  | 
 | 421 | +								<id>remove-serialVersionUID</id>  | 
 | 422 | +								<phase>process-sources</phase>  | 
 | 423 | +								<goals>  | 
 | 424 | +									<goal>file-contents</goal>  | 
 | 425 | +								</goals>  | 
 | 426 | +								<configuration>  | 
 | 427 | +									<baseDir>${generatedDirRelative}/software/xdev/${componentName}/</baseDir>  | 
 | 428 | +									<recursive>true</recursive>  | 
 | 429 | +									<fileMask>.java</fileMask>  | 
 | 430 | +									<findRegex>^.*serialVersionUID.*(\r?\n)(\s*\r?\n)?</findRegex>  | 
 | 431 | +									<replaceAll>false</replaceAll>  | 
 | 432 | +									<replaceLineBased>false</replaceLineBased>  | 
 | 433 | +								</configuration>  | 
 | 434 | +							</execution>  | 
 | 435 | +						</executions>  | 
 | 436 | +					</plugin>  | 
 | 437 | +				</plugins>  | 
 | 438 | +			</build>  | 
 | 439 | +		</profile>  | 
206 | 440 | 		<profile>  | 
207 | 441 | 			<id>checkstyle</id>  | 
208 | 442 | 			<build>  | 
 | 
248 | 482 | 							<rulesets>  | 
249 | 483 | 								<ruleset>../.config/pmd/java/ruleset.xml</ruleset>  | 
250 | 484 | 							</rulesets>  | 
 | 485 | +							<!-- All code is auto-generated -->  | 
 | 486 | +							<excludes>  | 
 | 487 | +								<exclude>**/**</exclude>  | 
 | 488 | +							</excludes>  | 
251 | 489 | 						</configuration>  | 
252 | 490 | 						<dependencies>  | 
253 | 491 | 							<dependency>  | 
 | 
0 commit comments