Skip to content

Commit 21dbce4

Browse files
authored
Use Spotless sortpom plug-in (#1728)
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 d21e31d commit 21dbce4

File tree

10 files changed

+30
-64
lines changed

10 files changed

+30
-64
lines changed

distributions/openhab-addons/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
1+
<?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

distributions/openhab-demo/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
1+
<?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
<modelVersion>4.0.0</modelVersion>
55

66
<parent>

distributions/openhab-verify/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
1+
<?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

distributions/openhab/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
1+
<?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
<modelVersion>4.0.0</modelVersion>
55

66
<parent>

distributions/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
1+
<?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
<modelVersion>4.0.0</modelVersion>
55

66
<parent>

features/addons/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
1+
<?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

features/distro-kar/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
1+
<?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

features/distro/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
1+
<?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

features/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
1+
<?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-46
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
1+
<?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
<modelVersion>4.0.0</modelVersion>
55

66
<parent>
@@ -67,7 +67,7 @@
6767
<maven.compiler.release>${oh.java.version}</maven.compiler.release>
6868

6969
<sat.version>0.17.0</sat.version>
70-
<spotless.version>2.43.0</spotless.version>
70+
<spotless.version>2.44.3</spotless.version>
7171
<!-- Eclipse Java formatter version 4.26+ does not check test files -->
7272
<spotless.eclipse.version>4.25</spotless.eclipse.version>
7373
<spotless.eclipse.wtp.version>4.21.0</spotless.eclipse.wtp.version>
@@ -169,50 +169,20 @@
169169
</execution>
170170
</executions>
171171
</plugin>
172-
<plugin>
173-
<groupId>com.github.ekryd.sortpom</groupId>
174-
<artifactId>sortpom-maven-plugin</artifactId>
175-
<version>4.0.0</version>
176-
<configuration>
177-
<predefinedSortOrder>recommended_2008_06</predefinedSortOrder>
178-
<createBackupFile>false</createBackupFile>
179-
<keepBlankLines>true</keepBlankLines>
180-
</configuration>
181-
<executions>
182-
<execution>
183-
<id>sortpom-verify</id>
184-
<goals>
185-
<goal>verify</goal>
186-
</goals>
187-
<phase>verify</phase>
188-
<configuration>
189-
<verifyFail>Stop</verifyFail>
190-
</configuration>
191-
</execution>
192-
</executions>
193-
</plugin>
194172
<plugin>
195173
<groupId>com.diffplug.spotless</groupId>
196174
<artifactId>spotless-maven-plugin</artifactId>
197175
<version>${spotless.version}</version>
198176
<configuration>
199-
<formats>
200-
<format>
201-
<!-- pom.xml -->
202-
<includes>
203-
<include>pom.xml</include>
204-
</includes>
205-
<eclipseWtp>
206-
<type>XML</type>
207-
<files>
208-
<file>openhab_wst_pom_file.prefs</file>
209-
</files>
210-
<version>${spotless.eclipse.wtp.version}</version>
211-
</eclipseWtp>
212-
<trimTrailingWhitespace/>
213-
<endWithNewline/>
214-
</format>
215-
</formats>
177+
<pom>
178+
<sortPom>
179+
<expandEmptyElements>false</expandEmptyElements>
180+
<indentAttribute>schemaLocation</indentAttribute>
181+
<predefinedSortOrder>recommended_2008_06</predefinedSortOrder>
182+
<sortDependencyExclusions/>
183+
<sortDependencyManagement/>
184+
</sortPom>
185+
</pom>
216186
</configuration>
217187
<dependencies>
218188
<dependency>
@@ -268,10 +238,6 @@
268238
</execution>
269239
</executions>
270240
</plugin>
271-
<plugin>
272-
<groupId>com.github.ekryd.sortpom</groupId>
273-
<artifactId>sortpom-maven-plugin</artifactId>
274-
</plugin>
275241
<plugin>
276242
<groupId>com.diffplug.spotless</groupId>
277243
<artifactId>spotless-maven-plugin</artifactId>

0 commit comments

Comments
 (0)