-
-
Notifications
You must be signed in to change notification settings - Fork 181
VerifyFailOn
Björn Ekryd edited this page Jan 25, 2021
·
2 revisions
The option verifyFailOn gives you a chance to enforce a stricter checking of the POM file during the verify goal.
Normally the verify goal only checks if the xml elements are sorted in the correct order, but the following settings can enforce that both lines and line endings are correct:
...
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
...
</properties>
...
<plugin>
<groupId>com.github.ekryd.sortpom</groupId>
<artifactId>sortpom-maven-plugin</artifactId>
<version>2.13.1</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
<keepBlankLines>true</keepBlankLines>
<predefinedSortOrder>custom_1</predefinedSortOrder>
<ignoreLineSeparators>false</ignoreLineSeparators>
<verifyFail>stop</verifyFail>
<verifyFailOn>strict</verifyFailOn>
</configuration>
<executions>
<execution>
<goals>
<goal>verify</goal>
</goals>
<phase>validate</phase>
</execution>
</executions>
</plugin>
...
This would check fail the build of the POM file is is unsorted, or have the wrong indentation or that line separator differs.