Skip to content

Commit 050626a

Browse files
committed
Use Spotless sortpom plug-in
This simplifies the sortpom configuration and also allows for checking and reformatting them using the spotless:check and spotless:apply Maven goals. Signed-off-by: Wouter Born <[email protected]>
1 parent 238cd26 commit 050626a

File tree

9 files changed

+20
-60
lines changed

9 files changed

+20
-60
lines changed

codestyle/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
44

55
<modelVersion>4.0.0</modelVersion>
66

codestyle/src/main/resources/openhab_wst_pom_file.prefs

-7
This file was deleted.

custom-checks/checkstyle/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
44

55
<modelVersion>4.0.0</modelVersion>
66

custom-checks/findbugs/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
44

55
<modelVersion>4.0.0</modelVersion>
66

custom-checks/pmd/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
44

55
<modelVersion>4.0.0</modelVersion>
66

custom-checks/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
44

55
<modelVersion>4.0.0</modelVersion>
66

pom.xml

+12-45
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
44

55
<modelVersion>4.0.0</modelVersion>
66
<groupId>org.openhab.tools.sat</groupId>
@@ -82,7 +82,7 @@
8282
<maven.surefire.plugin.version>3.5.2</maven.surefire.plugin.version>
8383
<jetty.server.version>9.4.50.v20221201</jetty.server.version>
8484
<saxon.version>9.1.0.8</saxon.version>
85-
<spotless.version>2.43.0</spotless.version>
85+
<spotless.version>2.44.3</spotless.version>
8686
<!-- Eclipse Java formatter version 4.26+ does not check test files -->
8787
<spotless.eclipse.version>4.25</spotless.eclipse.version>
8888
<spotless.eclipse.wtp.version>4.21.0</spotless.eclipse.wtp.version>
@@ -238,7 +238,7 @@
238238
</goals>
239239
</pluginExecutionFilter>
240240
<action>
241-
<ignore></ignore>
241+
<ignore/>
242242
</action>
243243
</pluginExecution>
244244
</pluginExecutions>
@@ -280,29 +280,6 @@
280280
</executions>
281281
</plugin>
282282

283-
<plugin>
284-
<groupId>com.github.ekryd.sortpom</groupId>
285-
<artifactId>sortpom-maven-plugin</artifactId>
286-
<version>4.0.0</version>
287-
<configuration>
288-
<predefinedSortOrder>recommended_2008_06</predefinedSortOrder>
289-
<createBackupFile>false</createBackupFile>
290-
<keepBlankLines>true</keepBlankLines>
291-
</configuration>
292-
<executions>
293-
<execution>
294-
<id>sortpom-verify</id>
295-
<goals>
296-
<goal>verify</goal>
297-
</goals>
298-
<phase>verify</phase>
299-
<configuration>
300-
<verifyFail>Stop</verifyFail>
301-
</configuration>
302-
</execution>
303-
</executions>
304-
</plugin>
305-
306283
<plugin>
307284
<groupId>com.diffplug.spotless</groupId>
308285
<artifactId>spotless-maven-plugin</artifactId>
@@ -319,6 +296,15 @@
319296
</importOrder>
320297
<endWithNewline/>
321298
</java>
299+
<pom>
300+
<sortPom>
301+
<expandEmptyElements>false</expandEmptyElements>
302+
<indentAttribute>schemaLocation</indentAttribute>
303+
<predefinedSortOrder>recommended_2008_06</predefinedSortOrder>
304+
<sortDependencyExclusions/>
305+
<sortDependencyManagement/>
306+
</sortPom>
307+
</pom>
322308
<formats>
323309
<format>
324310
<!-- *.xml -->
@@ -339,21 +325,6 @@
339325
<trimTrailingWhitespace/>
340326
<endWithNewline/>
341327
</format>
342-
<format>
343-
<!-- pom.xml -->
344-
<includes>
345-
<include>pom.xml</include>
346-
</includes>
347-
<eclipseWtp>
348-
<type>XML</type>
349-
<files>
350-
<file>openhab_wst_pom_file.prefs</file>
351-
</files>
352-
<version>${spotless.eclipse.wtp.version}</version>
353-
</eclipseWtp>
354-
<trimTrailingWhitespace/>
355-
<endWithNewline/>
356-
</format>
357328
</formats>
358329
</configuration>
359330
<dependencies>
@@ -498,10 +469,6 @@
498469
</execution>
499470
</executions>
500471
</plugin>
501-
<plugin>
502-
<groupId>com.github.ekryd.sortpom</groupId>
503-
<artifactId>sortpom-maven-plugin</artifactId>
504-
</plugin>
505472
<plugin>
506473
<groupId>com.diffplug.spotless</groupId>
507474
<artifactId>spotless-maven-plugin</artifactId>

sat-extension/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
44

55
<modelVersion>4.0.0</modelVersion>
66

@@ -60,7 +60,7 @@
6060
</goals>
6161
</pluginExecutionFilter>
6262
<action>
63-
<ignore></ignore>
63+
<ignore/>
6464
</action>
6565
</pluginExecution>
6666
</pluginExecutions>

sat-plugin/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
44

55
<modelVersion>4.0.0</modelVersion>
66

0 commit comments

Comments
 (0)