Skip to content

Commit 990825b

Browse files
author
Vincent Potucek
committed
PoC: integrate Eclipse Formatter Profile into Maven Spotless Plugin - config
1 parent 7ff47de commit 990825b

File tree

18 files changed

+131
-438
lines changed

18 files changed

+131
-438
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ updates:
8585
- dependency-name: org.apache.maven.plugins:*
8686
- dependency-name: org.codehaus.mojo:*
8787
- dependency-name: io.fabric8:docker-maven-plugin
88-
- dependency-name: net.revelc.code.formatter:formatter-maven-plugin
89-
- dependency-name: net.revelc.code:impsort-maven-plugin
88+
- dependency-name: com.diffplug.spotless:spotless-maven-plugin
9089
# Narayana
9190
- dependency-name: org.jboss.narayana.jta:*
9291
- dependency-name: org.jboss.narayana.jts:*

CONTRIBUTING.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,6 @@ in `quarkus-parent` (root `pom.xml`).
406406

407407
When contributing to Quarkus, it is recommended to respect the following rules.
408408

409-
> **Note:** The `impsort-maven-plugin` uses the `.cache` directory on each module to speed up the build.
410-
> Because we have configured the plugin to store in a versioned directory, you may notice over time that the `.cache` directory grows in size. You can safely delete the `.cache` directory in each module to reclaim the space.
411-
> Running `./mvnw clean -Dclean-cache` automatically deletes that directory for you.
412-
413409
**Contributing to an extension**
414410

415411
When you contribute to an extension, after having applied your changes, run:

bom/application/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
<postgresql-jdbc.version>42.7.5</postgresql-jdbc.version>
123123
<mariadb-jdbc.version>3.5.3</mariadb-jdbc.version>
124124
<mysql-jdbc.version>8.3.0</mysql-jdbc.version>
125-
<mssql-jdbc.version>12.10.0.jre11</mssql-jdbc.version>
125+
<mssql-jdbc.version>12.8.1.jre11</mssql-jdbc.version>
126126
<adal4j.version>1.6.7</adal4j.version>
127127
<oracle-jdbc.version>23.6.0.24.10</oracle-jdbc.version>
128128
<derby-jdbc.version>10.16.1.1</derby-jdbc.version>
@@ -196,7 +196,7 @@
196196
<avro.version>1.12.0</avro.version>
197197
<apicurio-registry.version>2.6.8.Final</apicurio-registry.version>
198198
<apicurio-common-rest-client.version>0.1.18.Final</apicurio-common-rest-client.version> <!-- must be the version Apicurio Registry uses -->
199-
<testcontainers.version>1.21.1</testcontainers.version> <!-- Make sure to also update docker-java.version to match its needs -->
199+
<testcontainers.version>1.21.0</testcontainers.version> <!-- Make sure to also update docker-java.version to match its needs -->
200200
<docker-java.version>3.4.2</docker-java.version> <!-- must be the version Testcontainers use: https://central.sonatype.com/artifact/org.testcontainers/testcontainers -->
201201
<!-- Check the compatibility matrix (https://github.com/opensearch-project/opensearch-testcontainers) before upgrading: -->
202202
<opensearch-testcontainers.version>2.0.2</opensearch-testcontainers.version>

build-parent/pom.xml

Lines changed: 50 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,48 @@
681681
<groupId>com.diffplug.spotless</groupId>
682682
<artifactId>spotless-maven-plugin</artifactId>
683683
<version>2.44.4</version>
684+
<configuration>
685+
<formats>
686+
<format>
687+
<trimTrailingWhitespace/>
688+
<!-- <endWithNewline/> -->
689+
<indent>
690+
<spaces>true</spaces>
691+
<spacesPerTab>2</spacesPerTab>
692+
</indent>
693+
<includes>
694+
<include>.gitignore</include>
695+
</includes>
696+
<excludes>
697+
<exclude>**gradlew**</exclude>
698+
<exclude>**mvnw**</exclude>
699+
<exclude>extensions/panache/**/pom.xml</exclude>
700+
<exclude>test-framework/junit5/pom.xml</exclude>
701+
<exclude>test-framework/security/pom.xml</exclude>
702+
</excludes>
703+
</format>
704+
</formats>
705+
<java>
706+
<eclipse>
707+
<file>${maven.multiModuleProjectDirectory}/independent-projects/ide-config/src/main/resources/eclipse-format.xml</file>
708+
</eclipse>
709+
<importOrder>
710+
<file>${maven.multiModuleProjectDirectory}/independent-projects/ide-config/src/main/resources/eclipse.importorder</file>
711+
</importOrder>
712+
<!-- <removeUnusedImports /> -->
713+
<excludes>
714+
<!-- https://github.com/diffplug/spotless/issues/2491 -->
715+
<exclude>**/src/main/java/io/quarkus/rest/client/reactive/deployment/ClientContextResolverHandler.java</exclude>
716+
<exclude>**/src/main/java/io/quarkus/rest/client/reactive/deployment/ClientExceptionMapperHandler.java</exclude>
717+
<exclude>**/src/main/java/io/quarkus/rest/client/reactive/deployment/ClientRedirectHandler.java</exclude>
718+
</excludes>
719+
</java>
720+
<kotlin>
721+
<ktfmt>
722+
<style>KOTLINLANG</style>
723+
</ktfmt>
724+
</kotlin>
725+
</configuration>
684726
</plugin>
685727
</plugins>
686728
</pluginManagement>
@@ -698,28 +740,14 @@
698740
<build>
699741
<plugins>
700742
<plugin>
701-
<groupId>net.revelc.code.formatter</groupId>
702-
<artifactId>formatter-maven-plugin</artifactId>
703-
<executions>
704-
<execution>
705-
<phase>process-sources</phase>
706-
<goals>
707-
<goal>format</goal>
708-
</goals>
709-
</execution>
710-
</executions>
711-
</plugin>
712-
<plugin>
713-
<groupId>net.revelc.code</groupId>
714-
<artifactId>impsort-maven-plugin</artifactId>
715-
<configuration>
716-
<removeUnused>true</removeUnused>
717-
</configuration>
743+
<groupId>com.diffplug.spotless</groupId>
744+
<artifactId>spotless-maven-plugin</artifactId>
718745
<executions>
719746
<execution>
720-
<id>sort-imports</id>
747+
<id>spotless-apply</id>
748+
<phase>verify</phase>
721749
<goals>
722-
<goal>sort</goal>
750+
<goal>apply</goal>
723751
</goals>
724752
</execution>
725753
</executions>
@@ -735,80 +763,20 @@
735763
<name>no-format</name>
736764
</property>
737765
</activation>
738-
<build>
739-
<plugins>
740-
<plugin>
741-
<groupId>net.revelc.code.formatter</groupId>
742-
<artifactId>formatter-maven-plugin</artifactId>
743-
<executions>
744-
<execution>
745-
<phase>process-sources</phase>
746-
<goals>
747-
<goal>validate</goal>
748-
</goals>
749-
</execution>
750-
</executions>
751-
</plugin>
752-
<plugin>
753-
<groupId>net.revelc.code</groupId>
754-
<artifactId>impsort-maven-plugin</artifactId>
755-
<configuration>
756-
<removeUnused>true</removeUnused>
757-
</configuration>
758-
<executions>
759-
<execution>
760-
<id>check-imports</id>
761-
<goals>
762-
<goal>check</goal>
763-
</goals>
764-
</execution>
765-
</executions>
766-
</plugin>
767-
</plugins>
768-
</build>
769-
</profile>
770-
771-
<profile>
772-
<id>format-kotlin</id>
773-
<activation>
774-
<activeByDefault>true</activeByDefault>
775-
<property>
776-
<name>!no-format</name>
777-
</property>
778-
<file>
779-
<exists>src/main/kotlin</exists>
780-
</file>
781-
</activation>
782766
<build>
783767
<plugins>
784768
<plugin>
785769
<groupId>com.diffplug.spotless</groupId>
786770
<artifactId>spotless-maven-plugin</artifactId>
787771
<executions>
788772
<execution>
789-
<id>format-kotlin</id>
790-
<phase>process-sources</phase>
773+
<id>spotless-check</id>
774+
<phase>verify</phase>
791775
<goals>
792-
<goal>apply</goal>
776+
<goal>check</goal>
793777
</goals>
794778
</execution>
795779
</executions>
796-
797-
<configuration>
798-
<kotlin>
799-
<ktfmt>
800-
<style>KOTLINLANG</style>
801-
<!-- optional, other options are DEFAULT, DROPBOX, GOOGLE and KOTLINLANG -->
802-
</ktfmt>
803-
804-
<!--
805-
<ktfmt>
806-
<style>DEFAULT</style> &lt;!&ndash; optional, other options are DEFAULT, DROPBOX, GOOGLE and KOTLINLANG &ndash;&gt;
807-
</ktfmt>
808-
-->
809-
810-
</kotlin>
811-
</configuration>
812780
</plugin>
813781
</plugins>
814782
</build>

extensions/jdbc/jdbc-mssql/deployment/src/main/java/io/quarkus/jdbc/mssql/deployment/MsSQLReflections.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ void build(BuildProducer<ReflectiveClassBuildItem> reflectiveClass) {
1919
//We register it for the sake of people not using Agroal.
2020
final String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
2121
reflectiveClass.produce(ReflectiveClassBuildItem.builder(driverName).build());
22-
23-
// https://github.com/quarkusio/quarkus/pull/48082#issuecomment-2912550391
24-
String className = "com.microsoft.sqlserver.jdbc.ConfigurableRetryLogic";
25-
reflectiveClass.produce(ReflectiveClassBuildItem.builder(className).build());
2622
}
2723

2824
}

extensions/websockets-next/deployment/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,7 @@
196196
<properties>
197197
<maven.compiler.target>21</maven.compiler.target>
198198
<maven.compiler.source>21</maven.compiler.source>
199-
<!-- javaparser 3.25.10 used by impsort-maven-plugin does not define the "language level" for 21 -->
200-
<!--maven.compiler.release>21</maven.compiler.release-->
199+
<maven.compiler.release>21</maven.compiler.release>
201200
</properties>
202201
<build>
203202
<plugins>

independent-projects/arc/pom.xml

Lines changed: 7 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -327,31 +327,17 @@
327327
<build>
328328
<plugins>
329329
<plugin>
330-
<groupId>net.revelc.code.formatter</groupId>
331-
<artifactId>formatter-maven-plugin</artifactId>
330+
<groupId>com.diffplug.spotless</groupId>
331+
<artifactId>spotless-maven-plugin</artifactId>
332332
<executions>
333333
<execution>
334-
<phase>process-sources</phase>
335-
<goals>
336-
<goal>format</goal>
337-
</goals>
338-
</execution>
339-
</executions>
340-
</plugin>
341-
<plugin>
342-
<groupId>net.revelc.code</groupId>
343-
<artifactId>impsort-maven-plugin</artifactId>
344-
<executions>
345-
<execution>
346-
<id>sort-imports</id>
334+
<id>spotless-apply</id>
335+
<phase>verify</phase>
347336
<goals>
348-
<goal>sort</goal>
337+
<goal>apply</goal>
349338
</goals>
350339
</execution>
351340
</executions>
352-
<configuration>
353-
<removeUnused>true</removeUnused>
354-
</configuration>
355341
</plugin>
356342
</plugins>
357343
</build>
@@ -367,8 +353,8 @@
367353
<build>
368354
<plugins>
369355
<plugin>
370-
<groupId>net.revelc.code.formatter</groupId>
371-
<artifactId>formatter-maven-plugin</artifactId>
356+
<groupId>com.diffplug.spotless</groupId>
357+
<artifactId>spotless-maven-plugin</artifactId>
372358
<executions>
373359
<execution>
374360
<phase>process-sources</phase>
@@ -378,21 +364,6 @@
378364
</execution>
379365
</executions>
380366
</plugin>
381-
<plugin>
382-
<groupId>net.revelc.code</groupId>
383-
<artifactId>impsort-maven-plugin</artifactId>
384-
<configuration>
385-
<removeUnused>true</removeUnused>
386-
</configuration>
387-
<executions>
388-
<execution>
389-
<id>check-imports</id>
390-
<goals>
391-
<goal>check</goal>
392-
</goals>
393-
</execution>
394-
</executions>
395-
</plugin>
396367
</plugins>
397368
</build>
398369
</profile>

independent-projects/bootstrap/pom.xml

Lines changed: 7 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -239,31 +239,17 @@
239239
<build>
240240
<plugins>
241241
<plugin>
242-
<groupId>net.revelc.code.formatter</groupId>
243-
<artifactId>formatter-maven-plugin</artifactId>
242+
<groupId>com.diffplug.spotless</groupId>
243+
<artifactId>spotless-maven-plugin</artifactId>
244244
<executions>
245245
<execution>
246-
<phase>process-sources</phase>
247-
<goals>
248-
<goal>format</goal>
249-
</goals>
250-
</execution>
251-
</executions>
252-
</plugin>
253-
<plugin>
254-
<groupId>net.revelc.code</groupId>
255-
<artifactId>impsort-maven-plugin</artifactId>
256-
<executions>
257-
<execution>
258-
<id>sort-imports</id>
246+
<id>spotless-apply</id>
247+
<phase>verify</phase>
259248
<goals>
260-
<goal>sort</goal>
249+
<goal>apply</goal>
261250
</goals>
262251
</execution>
263252
</executions>
264-
<configuration>
265-
<removeUnused>true</removeUnused>
266-
</configuration>
267253
</plugin>
268254
</plugins>
269255
</build>
@@ -279,8 +265,8 @@
279265
<build>
280266
<plugins>
281267
<plugin>
282-
<groupId>net.revelc.code.formatter</groupId>
283-
<artifactId>formatter-maven-plugin</artifactId>
268+
<groupId>com.diffplug.spotless</groupId>
269+
<artifactId>spotless-maven-plugin</artifactId>
284270
<executions>
285271
<execution>
286272
<phase>process-sources</phase>
@@ -290,21 +276,6 @@
290276
</execution>
291277
</executions>
292278
</plugin>
293-
<plugin>
294-
<groupId>net.revelc.code</groupId>
295-
<artifactId>impsort-maven-plugin</artifactId>
296-
<configuration>
297-
<removeUnused>true</removeUnused>
298-
</configuration>
299-
<executions>
300-
<execution>
301-
<id>check-imports</id>
302-
<goals>
303-
<goal>check</goal>
304-
</goals>
305-
</execution>
306-
</executions>
307-
</plugin>
308279
</plugins>
309280
</build>
310281
</profile>

0 commit comments

Comments
 (0)