pom.xml: replace prerequisites with maven-enforcer-plugin

Triggers during validate phase, and displays the maven, jdk and os versions.
This commit is contained in:
Paul Campbell 2017-06-07 20:51:52 +01:00
parent dcbb943aaf
commit ca6f7cd12f
2 changed files with 43 additions and 6 deletions

View file

@ -27,6 +27,8 @@ desired value.
* lombok.version * lombok.version
* digraph-dependency.version * digraph-dependency.version
* digraph-dependency.basePackage * digraph-dependency.basePackage
* required-maven.version
* maven-enforcer-plugin.version
* maven-javadoc-plugin.version * maven-javadoc-plugin.version
* maven-source-plugin.version * maven-source-plugin.version
* maven-gpg-plugin.version * maven-gpg-plugin.version
@ -44,6 +46,7 @@ desired value.
* jacoco-class-instruction-covered-ratio * jacoco-class-instruction-covered-ratio
* jacoco-class-missed-count-maximum * jacoco-class-missed-count-maximum
* java.version * java.version
* versions.version
## Checkstyle ## Checkstyle
@ -65,6 +68,16 @@ following values to select a less-strict ruleset:
* 4-tweaks * 4-tweaks
* 5-complexity * 5-complexity
## Maven Enforcer Plugin
Ensures that a suitable version of Maven is being used.
Runs it's `display-info` and `enforce` goals during the `validate` phase.
### Configuration
* requireMavenVersion: ${required-maven.version}
## Maven Compiler Plugin ## Maven Compiler Plugin
The [Maven Compiler Plugin](https://maven.apache.org/plugins/maven-compiler-plugin/) The [Maven Compiler Plugin](https://maven.apache.org/plugins/maven-compiler-plugin/)
@ -76,8 +89,9 @@ Ref: [compile:compile](https://maven.apache.org/plugins/maven-compiler-plugin/co
* showDeprecation: true * showDeprecation: true
* showWarnings: true * showWarnings: true
* source: 1.8 * source: ${java.version}
* target: 1.8 * target: ${java.version}
* encoding: ${project.build.sourceEncoding}
## Maven Surefire Plugin ## Maven Surefire Plugin

31
pom.xml
View file

@ -26,10 +26,6 @@
<inceptionYear>2015</inceptionYear> <inceptionYear>2015</inceptionYear>
<prerequisites>
<maven>3.0.4</maven>
</prerequisites>
<licenses> <licenses>
<license> <license>
<name>The MIT License (MIT)</name> <name>The MIT License (MIT)</name>
@ -73,6 +69,8 @@
<pitest.skip>false</pitest.skip> <pitest.skip>false</pitest.skip>
<pitest.failWhenNoMutations>true</pitest.failWhenNoMutations> <pitest.failWhenNoMutations>true</pitest.failWhenNoMutations>
<versions.version>2.4</versions.version> <versions.version>2.4</versions.version>
<required-maven.version>3.0.4</required-maven.version>
<maven-enforcer-plugin.version>1.4.1</maven-enforcer-plugin.version>
</properties> </properties>
<developers> <developers>
@ -219,6 +217,31 @@
</execution> </execution>
</executions> </executions>
</plugin><!-- digraph-dependency-maven-plugin --> </plugin><!-- digraph-dependency-maven-plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>${maven-enforcer-plugin.version}</version>
<executions>
<execution>
<id>enforce-maven</id>
<phase>validate</phase>
<goals>
<goal>display-info</goal>
<goal>enforce</goal>
</goals>
</execution>
</executions>
<configuration>
<rules>
<requireMavenVersion>
<version>${required-maven.version}</version>
</requireMavenVersion>
<requireJavaVersion>
<version>${java.version}</version>
</requireJavaVersion>
</rules>
</configuration>
</plugin><!-- maven-enforcer-plugin -->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId> <artifactId>maven-clean-plugin</artifactId>