private void addPlugin(final MavenPlugin plugin, boolean managedPlugin,
org.jboss.forge.addon.maven.profiles.Profile profileParam)
{
MavenFacet mavenCoreFacet = getFaceted().getFacet(MavenFacet.class);
Model pom = mavenCoreFacet.getModel();
BuildBase build = getBuild(pom, profileParam);
if (managedPlugin)
{
PluginManagement pluginManagement = build.getPluginManagement();
if (pluginManagement == null)
{
pluginManagement = new PluginManagement();
build.setPluginManagement(pluginManagement);
}
pluginManagement.addPlugin(new MavenPluginAdapter(plugin));
}
else
{
build.addPlugin(new MavenPluginAdapter(plugin));
}
mavenCoreFacet.setModel(pom);
}