use of org.apache.maven.model.BuildBase in project unleash-maven-plugin by shillner.
the class CheckPluginVersions method getSnapshotsFromManagement.
private Set<ArtifactCoordinates> getSnapshotsFromManagement(Profile profile, PomPropertyResolver propertyResolver) {
this.log.debug("\t\tChecking managed plugins of profile '" + profile.getId() + "'");
BuildBase build = profile.getBuild();
if (build != null) {
PluginManagement pluginManagement = build.getPluginManagement();
if (pluginManagement != null) {
Collection<Plugin> snapshots = Collections2.filter(pluginManagement.getPlugins(), new IsSnapshotPlugin(propertyResolver));
return Sets.newHashSet(Collections2.transform(snapshots, PluginToCoordinates.INSTANCE));
}
}
return Collections.emptySet();
}
use of org.apache.maven.model.BuildBase in project pom-manipulation-ext by release-engineering.
the class DistributionEnforcingManipulatorTest method assertSkip.
private void assertSkip(final Model model, final String profileId, final boolean deploy, final boolean state) {
BuildBase build = null;
if (profileId != null) {
final List<Profile> profiles = model.getProfiles();
if (profiles != null) {
for (final Profile profile : profiles) {
if (profileId.equals(profile.getId())) {
build = profile.getBuild();
}
}
}
} else {
build = model.getBuild();
}
assertThat(build, notNullValue());
final Plugin plugin = build.getPluginsAsMap().get(ga(MAVEN_PLUGIN_GROUPID, deploy ? MAVEN_DEPLOY_ARTIFACTID : MAVEN_INSTALL_ARTIFACTID));
assertThat(plugin, notNullValue());
assertThat(plugin.getConfiguration().toString().contains("<skip>" + state + "</skip>"), equalTo(true));
}
use of org.apache.maven.model.BuildBase in project pom-manipulation-ext by release-engineering.
the class DistributionEnforcingManipulator method getPluginMap.
private Map<String, Plugin> getPluginMap(final ModelBase base) {
final BuildBase build;
if (base instanceof Model) {
build = ((Model) base).getBuild();
} else {
build = ((Profile) base).getBuild();
}
if (build == null) {
return Collections.emptyMap();
}
final Map<String, Plugin> result = build.getPluginsAsMap();
if (result == null) {
return Collections.emptyMap();
}
return result;
}
use of org.apache.maven.model.BuildBase in project unleash-maven-plugin by shillner.
the class CheckPluginDependencyVersions method getSnapshotsFromManagement.
private Multimap<ArtifactCoordinates, ArtifactCoordinates> getSnapshotsFromManagement(Profile profile, PomPropertyResolver propertyResolver) {
this.log.debug("\t\tChecking managed plugins of profile '" + profile.getId() + "'");
Multimap<ArtifactCoordinates, ArtifactCoordinates> result = HashMultimap.create();
BuildBase build = profile.getBuild();
if (build != null) {
PluginManagement pluginManagement = build.getPluginManagement();
if (pluginManagement != null) {
for (Plugin plugin : pluginManagement.getPlugins()) {
Collection<Dependency> snapshots = Collections2.filter(plugin.getDependencies(), new IsSnapshotDependency(propertyResolver));
if (!snapshots.isEmpty()) {
result.putAll(PluginToCoordinates.INSTANCE.apply(plugin), Collections2.transform(snapshots, DependencyToCoordinates.INSTANCE));
}
}
}
}
return result;
}
use of org.apache.maven.model.BuildBase in project unleash-maven-plugin by shillner.
the class CheckPluginDependencyVersions method getSnapshots.
private Multimap<ArtifactCoordinates, ArtifactCoordinates> getSnapshots(Profile profile, PomPropertyResolver propertyResolver) {
this.log.debug("\t\tChecking direct plugin references of profile '" + profile.getId() + "'");
Multimap<ArtifactCoordinates, ArtifactCoordinates> result = HashMultimap.create();
BuildBase build = profile.getBuild();
if (build != null) {
for (Plugin plugin : build.getPlugins()) {
Collection<Dependency> snapshots = Collections2.filter(plugin.getDependencies(), new IsSnapshotDependency(propertyResolver));
if (!snapshots.isEmpty()) {
result.putAll(PluginToCoordinates.INSTANCE.apply(plugin), Collections2.transform(snapshots, DependencyToCoordinates.INSTANCE));
}
}
}
return result;
}
Aggregations