diff --git a/gradle/java-publish.gradle b/gradle/java-publish.gradle
index 6502b6e7fc..29beac4452 100644
--- a/gradle/java-publish.gradle
+++ b/gradle/java-publish.gradle
@@ -64,6 +64,8 @@ def cred = {
}
}
+final MAVEN_PLUGIN_ARTIFACT_NAME = 'spotless-maven-plugin'
+
model {
publishing {
publications {
@@ -97,8 +99,12 @@ model {
distribution 'repo'
}
}
+ if (project.ext.artifactId == MAVEN_PLUGIN_ARTIFACT_NAME) {
+ // Maven plugin required Maven 3.1.0+ to run
+ prerequisites { maven '3.1.0' }
+ }
developers {
- if (project.ext.artifactId == 'spotless-plugin-maven') {
+ if (project.ext.artifactId == MAVEN_PLUGIN_ARTIFACT_NAME) {
developer {
id 'lutovich'
name 'Konstantin Lutovich'
diff --git a/plugin-maven/CHANGES.md b/plugin-maven/CHANGES.md
index 55dd98bd0e..f2887909d1 100644
--- a/plugin-maven/CHANGES.md
+++ b/plugin-maven/CHANGES.md
@@ -5,6 +5,7 @@
* Skip `package-info.java` and `module-info.java` files from license header formatting. ([#273](https://github.com/diffplug/spotless/pull/273))
* Updated JSR305 annotation from 3.0.0 to 3.0.2 ([#274](https://github.com/diffplug/spotless/pull/274))
* Migrated from FindBugs annotations 3.0.0 to SpotBugs annotations 3.1.6 ([#274](https://github.com/diffplug/spotless/pull/274))
+* Fix Maven version prerequisite in the generated POM ([#289](https://github.com/diffplug/spotless/pull/289))
### Version 1.14.0 - July 24th 2018 ([javadoc](https://diffplug.github.io/spotless/javadoc/spotless-maven-plugin/1.14.0/), [jcenter](https://bintray.com/diffplug/opensource/spotless-maven-plugin/1.14.0))
diff --git a/plugin-maven/src/test/resources/pom-build.xml.mustache b/plugin-maven/src/test/resources/pom-build.xml.mustache
index 07d473fa94..3495ee8e68 100644
--- a/plugin-maven/src/test/resources/pom-build.xml.mustache
+++ b/plugin-maven/src/test/resources/pom-build.xml.mustache
@@ -9,6 +9,7 @@
Spotless Maven Plugin
+
3.1.0
diff --git a/plugin-maven/src/test/resources/pom-test.xml.mustache b/plugin-maven/src/test/resources/pom-test.xml.mustache
index 26350411d5..b03c0b8205 100644
--- a/plugin-maven/src/test/resources/pom-test.xml.mustache
+++ b/plugin-maven/src/test/resources/pom-test.xml.mustache
@@ -8,6 +8,11 @@
Spotless Maven Plugin Tests
+
+
+ 3.1.0
+
+
UTF-8
1.8