Improve XML schema validation (#18608)

* Move validation to subprojects, skip on top level to avoid double
  execution using a marker file (regression, #18579)

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
pull/18616/head
Holger Friedrich 2025-04-26 10:50:08 +02:00 committed by GitHub
parent 04c4085c1b
commit 8ecbbbf29d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 43 additions and 24 deletions

View File

@ -695,10 +695,53 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xml-maven-plugin</artifactId>
<version>1.1.0</version>
<configuration>
<validationSets>
<validationSet>
<dir>.</dir>
<includes>**/src/main/resources/OH-INF/thing/*.xml</includes>
<systemId>https://openhab.org/schemas/thing-description-1.0.0.xsd</systemId>
</validationSet>
</validationSets>
<catalogs>
<catalog>${basedirRoot}/src/thing-type-xml-validation-catalog.xml</catalog>
</catalogs>
</configuration>
<executions>
<execution>
<goals>
<goal>validate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>skipXmlValidation</id>
<activation>
<file>
<exists>skipXmlValidation.marker</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xml-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<!-- suppress embedding of dependencies -->
<profile>
<id>no-embed-dependencies</id>

View File

24
pom.xml
View File

@ -641,30 +641,6 @@ Import-Package: \\
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xml-maven-plugin</artifactId>
<version>1.1.0</version>
<configuration>
<validationSets>
<validationSet>
<dir>${session.executionRootDirectory}</dir>
<includes>**/src/main/resources/OH-INF/thing/*.xml</includes>
<systemId>https://openhab.org/schemas/thing-description-1.0.0.xsd</systemId>
</validationSet>
</validationSets>
<catalogs>
<catalog>${basedirRoot}/src/thing-type-xml-validation-catalog.xml</catalog>
</catalogs>
</configuration>
<executions>
<execution>
<goals>
<goal>validate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<extensions>
<extension>