Centralizing the plugin version in a (somewhat similar) specification?

I am starting to use specifications to centralize common dependency versions in my project. However, it does not work for plugin versions: if I add the pluginManagement section to the specification, the versions of the plugins declared there do not affect the plug-in versions of projects importing the specification (Maven complains that the version is not specified).

Why? What then is the "Maven" way to centralize versions of common plugins? Should I just use the parent POM for this?

+7
maven
source share
1 answer

If you use a specification that is used using the import scope, that means only taking into account the dependencyManagement part . Excerpt from the documents:

This area is used only for pom type dependencies in a section. It indicates that the specified POM should be replaced by dependencies in that POM partition. Since they are replaced, dependencies with the volume of imports do not actually participate in limiting the transitivity of the dependence.

To define plugins, you must use a parent where you define plugin versions using pluginManagement.

+10
source share

All Articles