|
303 | 303 | <version.com.puppycrawl.tools.checkstyle>10.18.2</version.com.puppycrawl.tools.checkstyle>
|
304 | 304 | <version.versions.plugin>2.17.1</version.versions.plugin>
|
305 | 305 | <version.maven-wrapper-plugin>3.3.2</version.maven-wrapper-plugin>
|
306 |
| - <version.impsort-maven-plugin>1.12.0</version.impsort-maven-plugin> |
307 |
| - <version.formatter-maven-plugin>2.24.1</version.formatter-maven-plugin> |
308 | 306 | <version.org.eclipse.m2e.lifecycle-mapping>1.0.0</version.org.eclipse.m2e.lifecycle-mapping>
|
309 | 307 | <version.sisu-maven-plugin>0.9.0.M3</version.sisu-maven-plugin>
|
310 | 308 | <gitflow-incremental-builder.version>4.5.4</gitflow-incremental-builder.version>
|
| 309 | + <version.spotless-maven-plugin>2.43.0</version.spotless-maven-plugin> |
311 | 310 |
|
312 | 311 | <!-- Repository Deployment URLs -->
|
313 | 312 |
|
|
434 | 433 |
|
435 | 434 | <!-- Formatting -->
|
436 | 435 | <format.skip>false</format.skip>
|
437 |
| - <goal.impsort-maven-plugin>sort</goal.impsort-maven-plugin> |
438 |
| - <goal.formatter-maven-plugin>format</goal.formatter-maven-plugin> |
| 436 | + <goal.spotless-maven-plugin>apply</goal.spotless-maven-plugin> |
439 | 437 |
|
440 | 438 | <!-- For Reproducible Builds -->
|
441 | 439 | <project.build.outputTimestamp>2024-08-13T07:06:30Z</project.build.outputTimestamp>
|
|
1000 | 998 | Code formatting configuration:
|
1001 | 999 | -->
|
1002 | 1000 | <plugin>
|
1003 |
| - <groupId>net.revelc.code</groupId> |
1004 |
| - <artifactId>impsort-maven-plugin</artifactId> |
1005 |
| - <version>${version.impsort-maven-plugin}</version> |
| 1001 | + <groupId>com.diffplug.spotless</groupId> |
| 1002 | + <artifactId>spotless-maven-plugin</artifactId> |
| 1003 | + <version>${version.spotless-maven-plugin}</version> |
1006 | 1004 | <configuration>
|
1007 |
| - <!-- store outside of target to speed up formatting when mvn clean is used --> |
1008 |
| - <cachedir>.cache/impsort-maven-plugin-${version.impsort-maven-plugin}</cachedir> |
1009 |
| - <groups>java.,javax.,jakarta.,org.hibernate., org.hibernate.testing., org.hibernate.test., org.junit., org.jboss., com., *</groups> |
1010 |
| - <staticGroups>*</staticGroups> |
1011 |
| - <!-- To make static imports go on top: --> |
1012 |
| - <staticAfter>false</staticAfter> |
1013 |
| - <skip>${format.skip}</skip> |
1014 |
| - <removeUnused>true</removeUnused> |
| 1005 | + <upToDateChecking> |
| 1006 | + <enabled>true</enabled> |
| 1007 | + <indexFile>.cache/spotless-index-${version.spotless-maven-plugin}</indexFile> |
| 1008 | + </upToDateChecking> |
| 1009 | + <formats> |
| 1010 | + <format> |
| 1011 | + <!-- XML specific rules --> |
| 1012 | + <includes> |
| 1013 | + <include>src/**/*.xml</include> |
| 1014 | + </includes> |
| 1015 | + <trimTrailingWhitespace/> |
| 1016 | + <endWithNewline/> |
| 1017 | + <licenseHeader> |
| 1018 | + <file>license.xml.header</file> |
| 1019 | + <!-- Delimiter is a regex which identifies the "top" of the file i.e. all above it is considered a header --> |
| 1020 | + <delimiter><![CDATA[(\n)*^(<[^!?]+|<!DOCTYPE.+)$]]></delimiter> |
| 1021 | + <skipLinesMatching><![CDATA[<\?xml.+\?>]]></skipLinesMatching> |
| 1022 | + </licenseHeader> |
| 1023 | + <indent> |
| 1024 | + <tabs>true</tabs> |
| 1025 | + <spacesPerTab>4</spacesPerTab> |
| 1026 | + </indent> |
| 1027 | + </format> |
| 1028 | + </formats> |
| 1029 | + <!-- define a language-specific format --> |
| 1030 | + <java> |
| 1031 | + <toggleOffOn/> |
| 1032 | + <includes> |
| 1033 | + <include>src/**/*.java</include> |
| 1034 | + </includes> |
| 1035 | + <excludes> |
| 1036 | + <!-- Ignore avro-generated classes as we have them commited to the repository: --> |
| 1037 | + <exclude>**/main/avro/generated/**/*.java</exclude> |
| 1038 | + </excludes> |
| 1039 | + <indent> |
| 1040 | + <tabs>true</tabs> |
| 1041 | + <spacesPerTab>4</spacesPerTab> |
| 1042 | + </indent> |
| 1043 | + |
| 1044 | + <importOrder> |
| 1045 | + <file>hibernate_search_style.importorder</file> |
| 1046 | + </importOrder> |
| 1047 | + <trimTrailingWhitespace/> |
| 1048 | + <endWithNewline/> |
| 1049 | + <eclipse> |
| 1050 | + <!-- optional version of Eclipse Formatter --> |
| 1051 | + <!-- <version>4.26</version> --> |
| 1052 | + <file>hibernate_search_style.xml</file> |
| 1053 | + </eclipse> |
| 1054 | + <removeUnusedImports> |
| 1055 | + <!-- default one fails to process the classes --> |
| 1056 | + <engine>cleanthat-javaparser-unnecessaryimport</engine> |
| 1057 | + </removeUnusedImports> |
| 1058 | + <licenseHeader> |
| 1059 | + <file>license.java.header</file> |
| 1060 | + <!-- Delimiter is a regex which identifies the "top" of the file i.e. all above it is considered a header --> |
| 1061 | + <delimiter>(\n)*^(\/\/tag.+|\/\/spotless.+|package .+;|//.+$|(?!package .+;)import .+;)</delimiter> |
| 1062 | + </licenseHeader> |
| 1063 | + <replaceRegex> |
| 1064 | + <name>Remove wildcard imports</name> |
| 1065 | + <searchRegex>^import\s+[^\*\s]+\*;$</searchRegex> |
| 1066 | + <replacement>$1</replacement> |
| 1067 | + </replaceRegex> |
| 1068 | + </java> |
1015 | 1069 | </configuration>
|
1016 |
| - <executions> |
1017 |
| - <execution> |
1018 |
| - <id>import-sorting</id> |
1019 |
| - <goals> |
1020 |
| - <goal>${goal.impsort-maven-plugin}</goal> |
1021 |
| - </goals> |
1022 |
| - <phase>process-sources</phase> |
1023 |
| - </execution> |
1024 |
| - </executions> |
1025 |
| - </plugin> |
1026 |
| - <plugin> |
1027 |
| - <groupId>net.revelc.code.formatter</groupId> |
1028 |
| - <artifactId>formatter-maven-plugin</artifactId> |
1029 |
| - <version>${version.formatter-maven-plugin}</version> |
1030 | 1070 | <dependencies>
|
1031 | 1071 | <dependency>
|
1032 | 1072 | <groupId>org.hibernate.search</groupId>
|
1033 | 1073 | <artifactId>hibernate-search-build-config</artifactId>
|
1034 | 1074 | <version>${project.version}</version>
|
1035 | 1075 | </dependency>
|
1036 | 1076 | </dependencies>
|
1037 |
| - <configuration> |
1038 |
| - <!-- store outside of target to speed up formatting when mvn clean is used --> |
1039 |
| - <cachedir>.cache/formatter-maven-plugin-${version.formatter-maven-plugin}</cachedir> |
1040 |
| - <configFile>hibernate_search_style.xml</configFile> |
1041 |
| - <skip>${format.skip}</skip> |
1042 |
| - <removeTrailingWhitespace>true</removeTrailingWhitespace> |
1043 |
| - </configuration> |
1044 | 1077 | <executions>
|
1045 | 1078 | <execution>
|
1046 |
| - <id>code-formatting</id> |
| 1079 | + <id>check-apply-formatting</id> |
| 1080 | + <configuration> |
| 1081 | + <skip>${format.skip}</skip> |
| 1082 | + </configuration> |
| 1083 | + <phase>process-sources</phase> |
1047 | 1084 | <goals>
|
1048 |
| - <goal>${goal.formatter-maven-plugin}</goal> |
| 1085 | + <goal>${goal.spotless-maven-plugin}</goal> |
1049 | 1086 | </goals>
|
1050 |
| - <phase>process-sources</phase> |
1051 | 1087 | </execution>
|
1052 | 1088 | </executions>
|
1053 | 1089 | </plugin>
|
|
1530 | 1566 | <profile>
|
1531 | 1567 | <id>ci-build</id>
|
1532 | 1568 | <properties>
|
1533 |
| - <goal.impsort-maven-plugin>check</goal.impsort-maven-plugin> |
1534 |
| - <goal.formatter-maven-plugin>validate</goal.formatter-maven-plugin> |
| 1569 | + <goal.spotless-maven-plugin>check</goal.spotless-maven-plugin> |
1535 | 1570 | </properties>
|
1536 | 1571 | </profile>
|
1537 | 1572 |
|
|
0 commit comments