use Maven enforcer instead of prerequisites element in parent POM

Description

From the Maven 3.5 release notes:

If you have are using <prerequisites>..</prerequisites> for a non maven-plugin project, you will get a WARNING which looks like this:

[INFO] Scanning for projects...
[WARNING] The project org.apache.maven:maven:pom:3.5.0 uses prerequisites which is only intended for maven-plugin projects but not for non maven-plugin projects. For such purposes you should use the maven-enforcer-plugin. See https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html
This will tell you to use maven-enforcer-plugin to check the version of Maven you are expecting to build your project with, instead of using prerequisites MNG-5297, MNG-6092.

So, according to this, we have been "doing it wrong" and should remove the prerequisites element from the parent POM in favour of use of the maven-enforcer-plugin.

Environment

None

Activity

Show:

Ian Young April 1, 2019 at 3:38 PM

Enforce 3.5.3 in commit 3b5513db2a4815f6588d3a2f1a188cd9bec65673

Ian Young March 18, 2019 at 3:44 PM

Announced that we'll be enforcing 3.5.3 as of Friday this week (2019-03-22) and 3.6.0 within a few months.

Ian Young March 15, 2019 at 4:57 PM

The version of Maven embedded in current versions of Eclipse is 3.5.3, so may need to pull enforcement back to that release (1 year old).

Ian Young March 15, 2019 at 2:30 PM

Resolved on 2019-03-15 dev call: to send out mail to {{dev@}} list announcing that we will enforce Maven 3.6.0, starting end of next week.

Ian Young March 14, 2019 at 1:57 PM

commit 03476dd5deb20b9036bf8d0a8cc5cb070e6037b0 replaces the <prerequisites> element with use of the maven-enforcer-plugin, enforcing the same version (3.3.1).

According to the Maven version history this release came out five years ago, on 2015-03-18. This seems rather too old to do anything in the way of enforcing consistent builds.

I have added an item to the next dev call to discuss moving the baseline forward.

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Fix versions

Affects versions

Created March 19, 2018 at 4:02 PM
Updated April 21, 2020 at 3:01 PM
Resolved April 1, 2019 at 3:39 PM