Skip to content

Commit 6822d2f

Browse files
author
Vincent Potucek
committed
PoC: integrate Eclipse Formatter Profile into Maven Spotless Plugin
1 parent 073d40d commit 6822d2f

File tree

66 files changed

+557
-1212
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+557
-1212
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:*

.mvn/extensions.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<extension>
33
<groupId>com.gradle</groupId>
44
<artifactId>develocity-maven-extension</artifactId>
5-
<version>2.0</version>
5+
<version>2.0.1</version>
66
</extension>
77
<extension>
88
<groupId>com.gradle</groupId>

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.8.1.jre11</mssql-jdbc.version>
125+
<mssql-jdbc.version>12.10.0.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.0</testcontainers.version> <!-- Make sure to also update docker-java.version to match its needs -->
199+
<testcontainers.version>1.21.1</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>

docs/src/main/asciidoc/databases-dev-services.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ Login credentials are the same for most databases, except when the database requ
217217
|`quarkus` for the default datasource or name of the datasource
218218

219219
|Microsoft SQL Server
220-
|`SA`
220+
|`sa`
221221
|`Quarkus123`
222222
|
223223

docs/src/main/asciidoc/gradle-tooling.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ Run the native tests using:
584584
./gradlew testNative
585585
----
586586

587-
This task depends on `quarkusBuild`, so it will generate the native image before running the tests.
587+
This task depends on `quarkusBuild`, so it will generate the native image before running the native tests.
588588

589589
[NOTE]
590590
====
@@ -628,7 +628,7 @@ Those tests can be placed in a `src/integrationTest/java` directory and executed
628628
./gradlew quarkusIntTest
629629
----
630630

631-
This task depends on both `test` and `quarkusBuild` tasks. The final artifact will be produced before running tests.
631+
This task depends on `quarkusBuild`, so it will generate the artifact before running the integration tests.
632632

633633
== Using fast-jar
634634

extensions/agroal/runtime/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@
9494
<execution>
9595
<phase>process-resources</phase>
9696
<goals>
97-
<goal>extension-descriptor</goal>
97+
<goal>extension-descriptor</goal>
9898
</goals>
9999
<configuration>
100-
<conditionalDevDependencies>
101-
<artifact>${project.groupId}:${project.artifactId}-dev:${project.version}</artifact>
100+
<conditionalDevDependencies>
101+
<artifact>${project.groupId}:${project.artifactId}-dev:${project.version}</artifact>
102102
</conditionalDevDependencies>
103103
</configuration>
104104
</execution>

extensions/amazon-lambda/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@
2323
<module>deployment</module>
2424
<module>maven-archetype</module>
2525
</modules>
26-
26+
2727
</project>

extensions/arc/runtime-dev/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
<artifactId>quarkus-arc-dev</artifactId>
1313
<name>Quarkus - ArC - Runtime Dev mode</name>
1414
<description>Build time CDI dependency injection - Dev mode only</description>
15-
15+
1616
<dependencies>
1717
<dependency>
1818
<groupId>${project.groupId}</groupId>
1919
<artifactId>quarkus-arc</artifactId>
2020
</dependency>
2121
</dependencies>
22-
22+
2323
</project>

extensions/datasource/common/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<dependency>
2525
<groupId>org.jboss.logmanager</groupId>
2626
<artifactId>jboss-logmanager</artifactId>
27-
<scope>test</scope>
27+
<scope>test</scope>
2828
</dependency>
2929
</dependencies>
3030
</project>

0 commit comments

Comments
 (0)