use of org.commonjava.maven.ext.core.state.RelocationState in project pom-manipulation-ext by release-engineering.
the class RelocationManipulator method apply.
private boolean apply(final Project project, final Model model) throws ManipulationException {
boolean result = false;
final RelocationState state = session.getState(RelocationState.class);
final WildcardMap<ProjectVersionRef> relocations = state.getDependencyRelocations();
logger.debug("Applying relocation changes to: " + ga(project));
DependencyManagement dependencyManagement = model.getDependencyManagement();
if (dependencyManagement != null) {
result = updateDependencies(relocations, project.getResolvedManagedDependencies(session));
}
result |= updateDependencies(relocations, project.getAllResolvedDependencies(session));
for (final Profile profile : ProfileUtils.getProfiles(session, model)) {
dependencyManagement = profile.getDependencyManagement();
if (dependencyManagement != null) {
result |= updateDependencies(relocations, project.getResolvedProfileManagedDependencies(session).get(profile));
}
result |= updateDependencies(relocations, project.getAllResolvedProfileDependencies(session).get(profile));
}
return result;
}
use of org.commonjava.maven.ext.core.state.RelocationState in project pom-manipulation-ext by release-engineering.
the class RelocationManipulator method init.
/**
* Initialize the {@link PluginState} state holder in the {@link ManipulationSession}. This state holder detects
* relocation configuration from the Maven user properties (-D properties from the CLI) and makes it available for
* later.
*/
@Override
public void init(final ManipulationSession session) throws ManipulationException {
this.session = session;
session.setState(new RelocationState(session.getUserProperties()));
}
Aggregations