use of org.commonjava.maven.ext.core.state.PluginRemovalState in project pom-manipulation-ext by release-engineering.
the class PluginRemovalManipulator method init.
/**
* Initialize the {@link PluginState} state holder in the {@link ManipulationSession}. This state holder detects
* version-change configuration from the Maven user properties (-D properties from the CLI) and makes it available for
* later.
*/
@Override
public void init(final ManipulationSession session) {
this.session = session;
session.setState(new PluginRemovalState(session.getUserProperties()));
}
use of org.commonjava.maven.ext.core.state.PluginRemovalState in project pom-manipulation-ext by release-engineering.
the class PluginRemovalManipulator method apply.
private boolean apply(final Project project, final Model model) {
final PluginRemovalState state = session.getState(PluginRemovalState.class);
logger.debug("Applying plugin changes to: " + ga(project));
boolean result = false;
List<ProjectRef> pluginsToRemove = state.getPluginRemoval();
if (model.getBuild() != null) {
result = scanPlugins(pluginsToRemove, model.getBuild().getPlugins());
}
for (final Profile profile : ProfileUtils.getProfiles(session, model)) {
if (profile.getBuild() != null && scanPlugins(pluginsToRemove, profile.getBuild().getPlugins())) {
result = true;
}
}
return result;
}
Aggregations