|
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 |
|
52 | 59 | <repositories>
|
|
84 | 91 | </repository>
|
85 | 92 | </distributionManagement>
|
86 | 93 |
|
| 94 | + <dependencyManagement> |
| 95 | + <dependencies> |
| 96 | + <dependency> |
| 97 | + <groupId>com.fasterxml.jackson</groupId> |
| 98 | + <artifactId>jackson-bom</artifactId> |
| 99 | + <version>2.18.2</version> |
| 100 | + <type>pom</type> |
| 101 | + <scope>import</scope> |
| 102 | + </dependency> |
| 103 | + </dependencies> |
| 104 | + </dependencyManagement> |
| 105 | + |
| 106 | + <dependencies> |
| 107 | + <!-- HTTP client: apache client --> |
| 108 | + <dependency> |
| 109 | + <groupId>org.apache.httpcomponents.client5</groupId> |
| 110 | + <artifactId>httpclient5</artifactId> |
| 111 | + <version>5.4.1</version> |
| 112 | + </dependency> |
| 113 | + |
| 114 | + <!-- JSON processing: jackson --> |
| 115 | + <dependency> |
| 116 | + <groupId>com.fasterxml.jackson.core</groupId> |
| 117 | + <artifactId>jackson-core</artifactId> |
| 118 | + </dependency> |
| 119 | + <dependency> |
| 120 | + <groupId>com.fasterxml.jackson.core</groupId> |
| 121 | + <artifactId>jackson-annotations</artifactId> |
| 122 | + </dependency> |
| 123 | + <dependency> |
| 124 | + <groupId>com.fasterxml.jackson.core</groupId> |
| 125 | + <artifactId>jackson-databind</artifactId> |
| 126 | + </dependency> |
| 127 | + <dependency> |
| 128 | + <groupId>com.fasterxml.jackson.datatype</groupId> |
| 129 | + <artifactId>jackson-datatype-jsr310</artifactId> |
| 130 | + </dependency> |
| 131 | + <dependency> |
| 132 | + <groupId>org.openapitools</groupId> |
| 133 | + <artifactId>jackson-databind-nullable</artifactId> |
| 134 | + <version>0.2.6</version> |
| 135 | + </dependency> |
| 136 | + |
| 137 | + <dependency> |
| 138 | + <groupId>jakarta.annotation</groupId> |
| 139 | + <artifactId>jakarta.annotation-api</artifactId> |
| 140 | + <version>3.0.0</version> |
| 141 | + </dependency> |
| 142 | + </dependencies> |
| 143 | + |
87 | 144 | <build>
|
88 | 145 | <pluginManagement>
|
89 | 146 | <plugins>
|
|
172 | 229 | </execution>
|
173 | 230 | </executions>
|
174 | 231 | </plugin>
|
| 232 | + |
| 233 | + <plugin> |
| 234 | + <groupId>org.codehaus.mojo</groupId> |
| 235 | + <artifactId>build-helper-maven-plugin</artifactId> |
| 236 | + <version>3.6.0</version> |
| 237 | + <executions> |
| 238 | + <execution> |
| 239 | + <phase>generate-sources</phase> |
| 240 | + <goals> |
| 241 | + <goal>add-source</goal> |
| 242 | + </goals> |
| 243 | + <configuration> |
| 244 | + <sources> |
| 245 | + <source>${generatedDirRelative}</source> |
| 246 | + </sources> |
| 247 | + </configuration> |
| 248 | + </execution> |
| 249 | + </executions> |
| 250 | + </plugin> |
175 | 251 | </plugins>
|
176 | 252 | </build>
|
177 | 253 | <profiles>
|
|
235 | 311 | </plugins>
|
236 | 312 | </build>
|
237 | 313 | </profile>
|
| 314 | + <profile> |
| 315 | + <id>openapi-generator</id> |
| 316 | + <properties> |
| 317 | + <componentName>INSERT_NAME_HERE</componentName> |
| 318 | + |
| 319 | + <generatedDir>${project.basedir}/${generatedDirRelative}</generatedDir> |
| 320 | + <openApiRelativeGeneratorDir>src/gen</openApiRelativeGeneratorDir> |
| 321 | + <openApiGeneratorDir> |
| 322 | + ${project.basedir}/target/generated-sources/openapi/${openApiRelativeGeneratorDir} |
| 323 | + </openApiGeneratorDir> |
| 324 | + </properties> |
| 325 | + <build> |
| 326 | + <plugins> |
| 327 | + <plugin> |
| 328 | + <groupId>org.apache.maven.plugins</groupId> |
| 329 | + <artifactId>maven-clean-plugin</artifactId> |
| 330 | + <version>3.4.0</version> |
| 331 | + <executions> |
| 332 | + <execution> |
| 333 | + <id>pre-generation-clean</id> |
| 334 | + <phase>initialize</phase> |
| 335 | + <goals> |
| 336 | + <goal>clean</goal> |
| 337 | + </goals> |
| 338 | + <configuration> |
| 339 | + <excludeDefaultDirectories>true</excludeDefaultDirectories> |
| 340 | + <filesets> |
| 341 | + <fileset> |
| 342 | + <directory>${generatedDir}</directory> |
| 343 | + </fileset> |
| 344 | + </filesets> |
| 345 | + </configuration> |
| 346 | + </execution> |
| 347 | + <execution> |
| 348 | + <id>post-generation-clean</id> |
| 349 | + <phase>process-resources</phase> |
| 350 | + <goals> |
| 351 | + <goal>clean</goal> |
| 352 | + </goals> |
| 353 | + </execution> |
| 354 | + </executions> |
| 355 | + </plugin> |
| 356 | + <plugin> |
| 357 | + <groupId>org.openapitools</groupId> |
| 358 | + <artifactId>openapi-generator-maven-plugin</artifactId> |
| 359 | + <version>7.11.0</version> |
| 360 | + <executions> |
| 361 | + <execution> |
| 362 | + <goals> |
| 363 | + <goal>generate</goal> |
| 364 | + </goals> |
| 365 | + <configuration> |
| 366 | + <inputSpec>${project.basedir}/../openapi/openapi.yml</inputSpec> |
| 367 | + <generatorName>java</generatorName> |
| 368 | + <configOptions> |
| 369 | + <sourceFolder>${openApiRelativeGeneratorDir}</sourceFolder> |
| 370 | + <library>apache-httpclient</library> |
| 371 | + <apiPackage>software.xdev.${componentName}.api</apiPackage> |
| 372 | + <modelPackage>software.xdev.${componentName}.model</modelPackage> |
| 373 | + <invokerPackage>software.xdev.${componentName}.client</invokerPackage> |
| 374 | + <!-- Otherwise throw and catch everywhere --> |
| 375 | + <useRuntimeException>true</useRuntimeException> |
| 376 | + <!-- Some fields of API have been ignored because they are unused --> |
| 377 | + <disallowAdditionalPropertiesIfNotPresent>false |
| 378 | + </disallowAdditionalPropertiesIfNotPresent> |
| 379 | + <!-- Use newer Jakarta EE instead of Javax --> |
| 380 | + <useJakartaEe>true</useJakartaEe> |
| 381 | + <hideGenerationTimestamp>true</hideGenerationTimestamp> |
| 382 | + </configOptions> |
| 383 | + <!-- No tests and documentation because we don't use that --> |
| 384 | + <generateModelTests>false</generateModelTests> |
| 385 | + <generateApiTests>false</generateApiTests> |
| 386 | + <generateModelDocumentation>false</generateModelDocumentation> |
| 387 | + <generateApiDocumentation>false</generateApiDocumentation> |
| 388 | + </configuration> |
| 389 | + </execution> |
| 390 | + </executions> |
| 391 | + </plugin> |
| 392 | + <plugin> |
| 393 | + <groupId>org.apache.maven.plugins</groupId> |
| 394 | + <artifactId>maven-resources-plugin</artifactId> |
| 395 | + <version>3.3.1</version> |
| 396 | + <executions> |
| 397 | + <execution> |
| 398 | + <id>copy-generated-resources</id> |
| 399 | + <phase>process-sources</phase> |
| 400 | + <goals> |
| 401 | + <goal>copy-resources</goal> |
| 402 | + </goals> |
| 403 | + <configuration> |
| 404 | + <outputDirectory>${generatedDir}</outputDirectory> |
| 405 | + <resources> |
| 406 | + <resource> |
| 407 | + <directory>${openApiGeneratorDir}</directory> |
| 408 | + </resource> |
| 409 | + </resources> |
| 410 | + </configuration> |
| 411 | + </execution> |
| 412 | + </executions> |
| 413 | + </plugin> |
| 414 | + <plugin> |
| 415 | + <groupId>software.xdev</groupId> |
| 416 | + <artifactId>find-and-replace-maven-plugin</artifactId> |
| 417 | + <version>1.0.3</version> |
| 418 | + <executions> |
| 419 | + <execution> |
| 420 | + <!-- Remove so that we don't need additional dependency --> |
| 421 | + <id>remove-unused-import-com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider</id> |
| 422 | + <phase>process-sources</phase> |
| 423 | + <goals> |
| 424 | + <goal>file-contents</goal> |
| 425 | + </goals> |
| 426 | + <configuration> |
| 427 | + <baseDir>${generatedDirRelative}/software/xdev/${componentName}/client/</baseDir> |
| 428 | + <fileMask>ApiClient.java</fileMask> |
| 429 | + <!-- @formatter:off DO NOT INTRODUCE LINE BREAK --> |
| 430 | + <findRegex>^import com\.fasterxml\.jackson\.jaxrs\.json\.JacksonJsonProvider;(\r?\n)</findRegex> |
| 431 | + <!-- @formatter:on --> |
| 432 | + <replaceLineBased>false</replaceLineBased> |
| 433 | + </configuration> |
| 434 | + </execution> |
| 435 | + <execution> |
| 436 | + <!-- Changes with each generator version --> |
| 437 | + <id>remove-generated-annotation</id> |
| 438 | + <phase>process-sources</phase> |
| 439 | + <goals> |
| 440 | + <goal>file-contents</goal> |
| 441 | + </goals> |
| 442 | + <configuration> |
| 443 | + <baseDir>${generatedDirRelative}/software/xdev/${componentName}/</baseDir> |
| 444 | + <recursive>true</recursive> |
| 445 | + <fileMask>.java</fileMask> |
| 446 | + <findRegex>^@jakarta\.annotation\.Generated.*(\r?\n)</findRegex> |
| 447 | + <replaceAll>false</replaceAll> |
| 448 | + <replaceLineBased>false</replaceLineBased> |
| 449 | + </configuration> |
| 450 | + </execution> |
| 451 | + <execution> |
| 452 | + <!-- Requiring Java serialization indicates a serious misuse of the API --> |
| 453 | + <id>remove-serialVersionUID</id> |
| 454 | + <phase>process-sources</phase> |
| 455 | + <goals> |
| 456 | + <goal>file-contents</goal> |
| 457 | + </goals> |
| 458 | + <configuration> |
| 459 | + <baseDir>${generatedDirRelative}/software/xdev/${componentName}/</baseDir> |
| 460 | + <recursive>true</recursive> |
| 461 | + <fileMask>.java</fileMask> |
| 462 | + <findRegex>^.*serialVersionUID.*(\r?\n)(\s*\r?\n)?</findRegex> |
| 463 | + <replaceAll>false</replaceAll> |
| 464 | + <replaceLineBased>false</replaceLineBased> |
| 465 | + </configuration> |
| 466 | + </execution> |
| 467 | + </executions> |
| 468 | + </plugin> |
| 469 | + </plugins> |
| 470 | + </build> |
| 471 | + </profile> |
238 | 472 | <profile>
|
239 | 473 | <id>checkstyle</id>
|
240 | 474 | <build>
|
|
279 | 513 | <rulesets>
|
280 | 514 | <ruleset>../.config/pmd/ruleset.xml</ruleset>
|
281 | 515 | </rulesets>
|
| 516 | + <!-- All code is auto-generated --> |
| 517 | + <excludes> |
| 518 | + <exclude>**/**</exclude> |
| 519 | + </excludes> |
282 | 520 | </configuration>
|
283 | 521 | <dependencies>
|
284 | 522 | <dependency>
|
|
0 commit comments