Skip to content

Commit f5869ce

Browse files
committed
[GEOS-10382] Switch automatic formatting and check to Spotless
1 parent 00e74bf commit f5869ce

File tree

9 files changed

+33
-22
lines changed

9 files changed

+33
-22
lines changed

.github/workflows/linux_jdk11.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ jobs:
4040
restore-keys: |
4141
gs-${{ runner.os }}-maven-
4242
- name: Build with Maven
43-
run: mvn -B -U -T3 -fae -Dfmt.skip=true -Prelease -f src/pom.xml clean install
43+
run: mvn -B -U -T3 -fae -Dspotless.apply.skip=true -Prelease -f src/pom.xml clean install
4444
- name: Build community modules
45-
run: mvn -nsu -B -U -T4 -fae -Dfmt.skip=true -DskipTests -Prelease -PcommunityRelease -f src/community/pom.xml clean install
45+
run: mvn -nsu -B -U -T4 -fae -Dspotless.apply.skip=true -DskipTests -Prelease -PcommunityRelease -f src/community/pom.xml clean install
4646
- name: Package
4747
run: mvn -f src/pom.xml assembly:single -nsu -N
4848
- name: Package community modules

.github/workflows/linux_jdk17.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ jobs:
4040
restore-keys: |
4141
gs-${{ runner.os }}-maven-
4242
- name: Build with Maven
43-
run: mvn -B -U -T3 -fae -Dfmt.skip=true -Prelease -f src/pom.xml clean install
43+
run: mvn -B -U -T3 -fae -Dspotless.apply.skip=true -Prelease -f src/pom.xml clean install
4444
- name: Build community modules
45-
run: mvn -nsu -B -U -T4 -fae -Dfmt.skip=true -DskipTests -Prelease -PcommunityRelease -f src/community/pom.xml clean install
45+
run: mvn -nsu -B -U -T4 -fae -Dspotless.apply.skip=true -DskipTests -Prelease -PcommunityRelease -f src/community/pom.xml clean install
4646
- name: Package
4747
run: mvn -f src/pom.xml assembly:single -nsu -N
4848
- name: Package community modules

.github/workflows/linux_jdk8.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ jobs:
4040
restore-keys: |
4141
gs-${{ runner.os }}-maven-
4242
- name: Build with Maven
43-
run: mvn -B -U -T3 -fae -Dfmt.skip=true -Prelease -f src/pom.xml clean install
43+
run: mvn -B -U -T3 -fae -Dspotless.apply.skip=true -Prelease -f src/pom.xml clean install
4444
- name: Build community modules
45-
run: mvn -nsu -B -U -T4 -fae -Dfmt.skip=true -DskipTests -Prelease -PcommunityRelease -f src/community/pom.xml clean install
45+
run: mvn -nsu -B -U -T4 -fae -Dspotless.apply.skip=true -DskipTests -Prelease -PcommunityRelease -f src/community/pom.xml clean install
4646
- name: Package
4747
run: mvn -f src/pom.xml assembly:single -nsu -N
4848
- name: Package community modules

.github/workflows/macos.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
restore-keys: |
2727
gs-${{ runner.os }}-maven-
2828
- name: Build with Maven
29-
run: mvn -B clean install -U -T2 -Prelease -Pmacos-github-build --file src/pom.xml
29+
run: mvn -B clean install -U -T2 -Prelease -Pmacos-github-build -Dspotless.apply.skip=true --file src/pom.xml
3030
- name: Remove SNAPSHOT jars from repository
3131
run: |
3232
find .m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}

.github/workflows/qa.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ jobs:
3030
restore-keys: |
3131
gs-${{ runner.os }}-maven-
3232
- name: Build with Maven
33-
run: mvn -B -U -T3 -fae -Dfmt.action=check -Dpom.fmt.action=verify -Dqa -DskipTests=true -Prelease -f src/pom.xml clean install
33+
run: mvn -B -U -T3 -fae -Dspotless.action=check -Dpom.fmt.action=verify -Dqa -DskipTests=true -Prelease -f src/pom.xml clean install
3434
- name: Build community modules
35-
run: mvn -nsu -B -U -T4 -fae -Dfmt.action=check -Dpom.fmt.action=verify -DskipTests -Prelease -PcommunityRelease -f src/community/pom.xml clean install
35+
run: mvn -nsu -B -U -T4 -fae -Dspotless.action=check -Dpom.fmt.action=verify -DskipTests -Prelease -PcommunityRelease -f src/community/pom.xml clean install
3636
- name: Remove SNAPSHOT jars from repository
3737
run: |
3838
find ~/.m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}

.github/workflows/windows.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
restore-keys: |
3030
gs-${{ runner.os }}-maven-
3131
- name: Build with Maven
32-
run: mvn --% -B clean install -Dall -U -T2 -Prelease -Pwindows-github-build -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 --file src/pom.xml -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS
32+
run: mvn --% -B clean install -Dall -U -T2 -Prelease -Pwindows-github-build -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 --file src/pom.xml -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Dspotless.apply.skip=true
3333
- name: Remove SNAPSHOT jars from repository
3434
run: |
3535
cmd --% /c for /f %i in ('dir /a:d /s /b %userprofile%\*SNAPSHOT*') do rd /s /q %i

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,7 @@ build/cite/logs
3838
src/release/installer/win/*.rtf
3939
src/release/installer/win/source/
4040
src/release/installer/win/target/
41+
42+
# spotless up to date checks
43+
.spotless-index
44+

src/community/metadata/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<name>GeoServer Metadata Customizer</name>
1717
<description>GeoServer Metadata Customizer
1818

19-
use before committing: mvn fmt:format</description>
19+
use before committing: mvn spotless:apply</description>
2020

2121
<dependencies>
2222
<dependency>

src/pom.xml

+18-11
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@
145145
<jacoco.version>0.8.6</jacoco.version>
146146
<hazelcast.version>3.11.1</hazelcast.version>
147147
<argLine>-Xmx${test.maxHeapSize} -enableassertions ${jvm.opts} -Djava.awt.headless=${java.awt.headless} -Dsun.java2d.d3d=${sun.java2d.d3d} -DremoteOwsTests=${remoteOwsTests} -DquietTests=${quietTests} -Dorg.geotools.image.test.enabled=${image.tests} -Dorg.geotools.image.test.interactive=${interactive.image} -Duser.timezone=${user.timezone} -Dwindows.leniency=${windows.leniency} -XX:+TieredCompilation -XX:TieredStopAtLevel=1</argLine>
148-
<fmt.action>format</fmt.action>
149-
<fmt.skip>false</fmt.skip>
148+
<spotless.action>apply</spotless.action>
149+
<spotless.apply.skip>false</spotless.apply.skip>
150150
<pom.fmt.action>sort</pom.fmt.action>
151-
<pom.fmt.skip>${fmt.skip}</pom.fmt.skip>
151+
<pom.fmt.skip>${spotless.apply.skip}</pom.fmt.skip>
152152
<errorProneFlags></errorProneFlags>
153153
<errorProne.version>2.10.0</errorProne.version>
154154
<javac.version>9+181-r4173-1</javac.version>
@@ -1859,21 +1859,28 @@
18591859
</plugin>
18601860

18611861
<plugin>
1862-
<groupId>com.coveo</groupId>
1863-
<artifactId>fmt-maven-plugin</artifactId>
1864-
<version>2.4.0</version>
1862+
<groupId>com.diffplug.spotless</groupId>
1863+
<artifactId>spotless-maven-plugin</artifactId>
1864+
<version>2.20.0</version>
18651865
<executions>
18661866
<execution>
1867+
<phase>validate</phase>
18671868
<goals>
1868-
<goal>${fmt.action}</goal>
1869+
<goal>${spotless.action}</goal>
18691870
</goals>
18701871
</execution>
18711872
</executions>
18721873
<configuration>
1873-
<verbose>false</verbose>
1874-
<filesNamePattern>.*\.java</filesNamePattern>
1875-
<skip>${fmt.skip}</skip>
1876-
<style>aosp</style>
1874+
<java>
1875+
<googleJavaFormat>
1876+
<version>1.7</version>
1877+
<style>AOSP</style>
1878+
</googleJavaFormat>
1879+
</java>
1880+
<upToDateChecking>
1881+
<enabled>true</enabled>
1882+
<indexFile>${project.basedir}/.spotless-index</indexFile>
1883+
</upToDateChecking>
18771884
</configuration>
18781885
</plugin>
18791886

0 commit comments

Comments
 (0)