Skip to content

Why is the default version for the maven-compiler-plugin 3.1, a version from 2013, when the newest one is 3.10.1?

As the title says. I figured this out recently when I wanted to use the release flag in my POM configuration. Why does Maven use such an old version?

I should add I’m using the latest Maven version (3.8.6).



Why does Maven use such an old version?

In a word: Reproducibility.

Changing a plugin version number can result in changes in behavior that affect a Maven build. Now if the developer changes an explicit plugin version in their POM file, it is reasonable to assume that they made a conscious decision to do this. Either way, the decision to change was theirs.

On the other hand, when people rely on default plugin version numbers, they are not going to expect that they vary depending on the precise version of Maven that is installed. They won’t be happy if the build instructions for some old projects require them to install an out-of-date version of Maven. And they won’t be happy if installing a new Maven version to (say) patch a security problem also changes default plugin versions and … unexpectedly breaks their builds.

Hence, the Maven team is extremely cautious about changing default plugin versions, and default properties.

Either way, the solution is in your own hands. If you want to use a more recent version of any plugin, just put an explicit plugin version in your project’s parent POM file.

User contributions licensed under: CC BY-SA
3 People found this is helpful