|
271 | 271 | <version.formatter-maven-plugin>2.24.1</version.formatter-maven-plugin>
|
272 | 272 | <version.versions.plugin>2.17.1</version.versions.plugin>
|
273 | 273 | <version.maven-wrapper-plugin>3.3.2</version.maven-wrapper-plugin>
|
| 274 | + <version.spotless-maven-plugin>2.43.0</version.spotless-maven-plugin> |
274 | 275 |
|
275 | 276 | <!-- Forbidden API related properties -->
|
276 | 277 | <forbiddenapis-junit.path>forbidden-junit.txt</forbiddenapis-junit.path>
|
|
1469 | 1470 | </execution>
|
1470 | 1471 | </executions>
|
1471 | 1472 | </plugin>
|
| 1473 | + <plugin> |
| 1474 | + <groupId>com.diffplug.spotless</groupId> |
| 1475 | + <artifactId>spotless-maven-plugin</artifactId> |
| 1476 | + <version>${version.spotless-maven-plugin}</version> |
| 1477 | + <configuration> |
| 1478 | + <upToDateChecking> |
| 1479 | + <enabled>true</enabled> |
| 1480 | + <indexFile>.cache/spotless-index-${version.spotless-maven-plugin}</indexFile> |
| 1481 | + </upToDateChecking> |
| 1482 | + <formats> |
| 1483 | + <format> |
| 1484 | + <!-- XML specific rules --> |
| 1485 | + <includes> |
| 1486 | + <include>src/**/*.xml</include> |
| 1487 | + </includes> |
| 1488 | + <trimTrailingWhitespace/> |
| 1489 | + <endWithNewline/> |
| 1490 | + <licenseHeader> |
| 1491 | + <file>license.xml.header</file> |
| 1492 | + <!-- Delimiter is a regex which identifies the "top" of the file i.e. all above it is considered a header --> |
| 1493 | + <delimiter><![CDATA[(\n)*^(<[^!?]+|<!DOCTYPE.+)$]]></delimiter> |
| 1494 | + <skipLinesMatching><![CDATA[<\?xml.+\?>]]></skipLinesMatching> |
| 1495 | + </licenseHeader> |
| 1496 | + <indent> |
| 1497 | + <tabs>true</tabs> |
| 1498 | + <spacesPerTab>4</spacesPerTab> |
| 1499 | + </indent> |
| 1500 | + </format> |
| 1501 | + </formats> |
| 1502 | + <!-- define a language-specific format --> |
| 1503 | + <java> |
| 1504 | + <toggleOffOn/> |
| 1505 | + <includes> |
| 1506 | + <include>src/**/*.java</include> |
| 1507 | + </includes> |
| 1508 | + <excludes> |
| 1509 | + <exclude>**/TypeHelper.java</exclude> |
| 1510 | + <exclude>**/TypeHelperTest.java</exclude> |
| 1511 | + <exclude>**/ConcurrentReferenceHashMap.java</exclude> |
| 1512 | + </excludes> |
| 1513 | + <indent> |
| 1514 | + <tabs>true</tabs> |
| 1515 | + <spacesPerTab>4</spacesPerTab> |
| 1516 | + </indent> |
| 1517 | + |
| 1518 | + <importOrder> |
| 1519 | + <!-- you can use an empty string for all the imports you didn't specify explicitly, '|' to join group without blank line, and '\#` prefix for static imports. --> |
| 1520 | + <order>\#,java,javax,jakarta,org.openjdk.jmh,org.hibernate,org.hibernate.testing,org.hibernate.test,org.junit,org.jboss,com,javafx.beans,</order> |
| 1521 | + </importOrder> |
| 1522 | + <trimTrailingWhitespace/> |
| 1523 | + <endWithNewline/> |
| 1524 | + <eclipse> |
| 1525 | + <!-- optional version of Eclipse Formatter --> |
| 1526 | + <!-- <version>4.26</version> --> |
| 1527 | + <file>hibernate_validator_style.xml</file> |
| 1528 | + </eclipse> |
| 1529 | + <removeUnusedImports> |
| 1530 | + <!-- default one fails to process the classes --> |
| 1531 | + <engine>cleanthat-javaparser-unnecessaryimport</engine> |
| 1532 | + </removeUnusedImports> |
| 1533 | + <licenseHeader> |
| 1534 | + <file>license.java.header</file> |
| 1535 | + <!-- Delimiter is a regex which identifies the "top" of the file i.e. all above it is considered a header --> |
| 1536 | + <delimiter>(\n)*^(\/\/tag.+|\/\/spotless.+|package .+;|//.+)$</delimiter> |
| 1537 | + </licenseHeader> |
| 1538 | + <replaceRegex> |
| 1539 | + <name>Remove wildcard imports</name> |
| 1540 | + <searchRegex>^import\s+[^\*\s]+\*;$</searchRegex> |
| 1541 | + <replacement>$1</replacement> |
| 1542 | + </replaceRegex> |
| 1543 | + </java> |
| 1544 | + </configuration> |
| 1545 | + <dependencies> |
| 1546 | + <dependency> |
| 1547 | + <groupId>org.hibernate.validator</groupId> |
| 1548 | + <artifactId>hibernate-validator-build-config</artifactId> |
| 1549 | + <version>${project.version}</version> |
| 1550 | + </dependency> |
| 1551 | + </dependencies> |
| 1552 | + </plugin> |
1472 | 1553 | <plugin>
|
1473 | 1554 | <groupId>org.moditect</groupId>
|
1474 | 1555 | <artifactId>moditect-maven-plugin</artifactId>
|
|
0 commit comments