Dennis Lundberg wrote:

         Map<String,Plugin>  map = project.getBuild().getPluginsAsMap();

This is nice, because in Maven 3 I get the complete effective set of
plugins, from both build/plugins and build/pluginManagement.

I hope this means "get the set of build/plugins as seen in help:effective-pom, including plugins contributed by lifecycle mappings, with their effective configuration, i.e. after merging in inheritance, profiles and build/pluginManagement". This map should not include plugins from build/pluginManagement unless that plugin is also declared in the build/plugins section or in a lifecycle mapping.

This doesn't work in Maven 2

I assume you refer to the fact that plugins from lifecycle mappings do not show up among build/plugins.

What I have found is that I can get all plugins from build/plugins *or*
all plugins from build/pluginManagement, but not both at the same time.
I could combine the result of the two, but what happens if a plugin
exits in both? How would I merge the configuration of the two?

Plugin sitePlugin = (get from build/plugins)
if (sitePlugin == null) {
   sitePlugin = (get from build/pluginManagement/plugins)
}
// continue config extraction from sitePlugin

If the plugin is declared in both build/plugins and build/pluginManagement, both Maven 2.x and 3.x will already have handled the configuration merging such that build/plugins contains effective configuration.


Benjamin

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to