Travis CI: check POM convention (#795)

* Travis CI: check POM convention

We could use Travis CI to execute some checks in front of the normal
build.

This change adds a check if the POM files follow our POM conventions.

If something fails, it show which files violates the convention and the
command that should be executed to fix the situation.

For example if the base POM file breaks the convention:

    At least one POM file breaks the convention, please use sortpom to fix the POM file(s).
    	modified:   pom.xml
    You should run the following command in the root directory of your working copy:
        mvn com.github.ekryd.sortpom:sortpom-maven-plugin:sort -Dsort.keepBlankLines=true -Dsort.createBackupFile=false -Dsort.predefinedSortOrder=recommended_2008_06

* add sortpom plugin to verify phase
* do not use dependency reduced pom (use scope)

Signed-off-by: Markus Rathgeb <maggu2810@gmail.com>
This commit is contained in:
Markus Rathgeb
2019-05-18 00:07:14 +02:00
committed by Wouter Born
parent 2ace118b92
commit 7780d0d133
2 changed files with 30 additions and 0 deletions
@@ -17,6 +17,7 @@
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.52</version>
<scope>provided</scope>
</dependency>
</dependencies>
@@ -33,6 +34,7 @@
</goals>
<phase>package</phase>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<artifactSet>
<includes>
<include>org.bouncycastle:*</include>
+28
View File
@@ -624,6 +624,30 @@ Import-Package: \\
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.ekryd.sortpom</groupId>
<artifactId>sortpom-maven-plugin</artifactId>
<version>2.10.0</version>
<configuration>
<predefinedSortOrder>recommended_2008_06</predefinedSortOrder>
<createBackupFile>false</createBackupFile>
<keepBlankLines>true</keepBlankLines>
</configuration>
<executions>
<execution>
<id>sortpom-verify</id>
<goals>
<goal>verify</goal>
</goals>
<phase>verify</phase>
<configuration>
<verifyFail>Stop</verifyFail>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.itemis.maven.plugins</groupId>
<artifactId>unleash-maven-plugin</artifactId>
@@ -676,6 +700,10 @@ Import-Package: \\
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.ekryd.sortpom</groupId>
<artifactId>sortpom-maven-plugin</artifactId>
</plugin>
</plugins>
</build>