Skip to content

Commit

Permalink
Require 3.1.0+ version of Maven for Maven plugin
Browse files Browse the repository at this point in the history
Such runtime requirement exists because plugin uses APIs only
available starting from 3.1.0 version of Maven. They are used for
artifact resolution and come from the `org.eclipse.aether` package
which does not exist in < 3.1.0 Maven versions.

Requirement is declared in a `<prerequisites>` section of the POM.
This section is deprecated for regular projects and should only be
used by plugins to declare a minimum Maven version. Old versions will
make the plugin execution fail with an error:

```
[ERROR] Failed to execute goal c.d.s:spotless-maven-plugin:X.Y.Z:apply (default-cli) on project test: The plugin c.d.s:spotless-maven-plugin:X.Y.Z requires Maven version 3.1.0 -> [Help 1]
```

Also added a note in the README about the minimum
required Maven version.
  • Loading branch information
lutovich committed Jul 2, 2018
1 parent de8ea62 commit 1b39213
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion plugin-maven/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ output = [
output = prefixDelimiterReplace(input, 'https://{{org}}.github.io/{{name}}/javadoc/spotless-plugin-maven/', '/', stableMaven)
-->

Spotless is a general-purpose formatting plugin. It is completely à la carte, but also includes powerful "batteries-included" if you opt-in.
Spotless is a general-purpose formatting plugin. It is completely à la carte, but also includes powerful "batteries-included" if you opt-in. Plugin requires a version of Maven higher or equal to 3.1.0.

To people who use your build, it looks like this:

Expand Down
4 changes: 4 additions & 0 deletions plugin-maven/src/test/resources/pom-build.xml.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

<name>Spotless Maven Plugin</name>

<prerequisites>
<maven>3.1.0</maven>
</prerequisites>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>1.8</maven.compiler.target>
Expand Down

0 comments on commit 1b39213

Please sign in to comment.