Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pom.xml: Fix Jenkins not detecting bad pom.xml formatting
The sortpom:verify goal is set to sort pom.xml if it finds any issues. That goal would not fail in case of bad pom.xml formatting, and Jenkins would not know that pom.xml needs sorting. But even when "verifyFail" is set to "Stop", sortpom:verify doesn't fail on minor formatting issues that sortpom:sort would fix. It would be better to make Jenkins detect all formatting issues in pom.xml. Instead of running sortpom:verify, run sortpom:sort unconditionally, i.e. on Jenkins and on other systems. There is no good reason to skip any goals on Jenkins if they are run elsewhere. The only additional behavior for Jenkins is checking for changes in the working directory. Jenkins would fail the build if the code is different from the checked out commit. Check for modifications at the "verify" phase, so that all other issues (e.g. findbugs and unit tests failures) would be detected first. To keep the build logic consistent, use the same approach for Java code formatting. Format Java code unconditionally. Jenkins would fail the test if any changes are detected.
- Loading branch information