Kimble
Kimble

Reputation: 7544

What is the consequence of leaving out Maven plugin version?

[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-clover-plugin is missing. @ com...

I'm in the process of resurrecting an old Maven project. Some / most of the Maven plugin dependencies has been configured without version. Apart from the warning, what is the consequences of this? Will Maven attempt to find the most recent version and by that increase build time?

Upvotes: 5

Views: 221

Answers (1)

Tomasz Nurkiewicz
Tomasz Nurkiewicz

Reputation: 340713

Will Maven attempt to find the most recent version and by that increase build time?

Yes, when version is omitted, maven tries to find and uses the most recent version. This was actually a bad design choice, but not because of the build time (I think it caches plugins and only updates them once in a while).

The real problem here is that you never know which version of the plugin was used and will the plugin behave the same in the future. This makes builds unrepeatable.

For instance if some plugin changes the defaults for some options, the exact same source with exact same pom.xml will produce different results.

The developers of maven are trying to fix this design flaw by first warning you that you should specify plugin version explicitly. After all it is safer to use outdated plugin rather than a brand new one than suddenly breaks your build.

Upvotes: 6

Related Questions