Search in sources :

Example 1 with IsSnapshotPlugin

use of com.itemis.maven.plugins.unleash.util.predicates.IsSnapshotPlugin in project unleash-maven-plugin by shillner.

the class CheckPluginVersions method getSnapshotsFromManagement.

private Set<ArtifactCoordinates> getSnapshotsFromManagement(MavenProject project, PomPropertyResolver propertyResolver) {
    this.log.debug("\t\tChecking managed plugins");
    Build build = project.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();
}
Also used : PluginManagement(org.apache.maven.model.PluginManagement) Build(org.apache.maven.model.Build) IsSnapshotPlugin(com.itemis.maven.plugins.unleash.util.predicates.IsSnapshotPlugin) IsSnapshotPlugin(com.itemis.maven.plugins.unleash.util.predicates.IsSnapshotPlugin) Plugin(org.apache.maven.model.Plugin)

Example 2 with IsSnapshotPlugin

use of com.itemis.maven.plugins.unleash.util.predicates.IsSnapshotPlugin in project unleash-maven-plugin by shillner.

the class CheckPluginVersions method getSnapshots.

private Set<ArtifactCoordinates> getSnapshots(MavenProject project, PomPropertyResolver propertyResolver) {
    this.log.debug("\t\tChecking direct plugin references");
    Build build = project.getBuild();
    if (build != null) {
        Collection<Plugin> snapshots = Collections2.filter(build.getPlugins(), new IsSnapshotPlugin(propertyResolver));
        return Sets.newHashSet(Collections2.transform(snapshots, PluginToCoordinates.INSTANCE));
    }
    return Collections.emptySet();
}
Also used : Build(org.apache.maven.model.Build) IsSnapshotPlugin(com.itemis.maven.plugins.unleash.util.predicates.IsSnapshotPlugin) IsSnapshotPlugin(com.itemis.maven.plugins.unleash.util.predicates.IsSnapshotPlugin) Plugin(org.apache.maven.model.Plugin)

Example 3 with IsSnapshotPlugin

use of com.itemis.maven.plugins.unleash.util.predicates.IsSnapshotPlugin 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();
}
Also used : PluginManagement(org.apache.maven.model.PluginManagement) BuildBase(org.apache.maven.model.BuildBase) IsSnapshotPlugin(com.itemis.maven.plugins.unleash.util.predicates.IsSnapshotPlugin) IsSnapshotPlugin(com.itemis.maven.plugins.unleash.util.predicates.IsSnapshotPlugin) Plugin(org.apache.maven.model.Plugin)

Example 4 with IsSnapshotPlugin

use of com.itemis.maven.plugins.unleash.util.predicates.IsSnapshotPlugin in project unleash-maven-plugin by shillner.

the class CheckPluginVersions method getSnapshots.

private Set<ArtifactCoordinates> getSnapshots(Profile profile, PomPropertyResolver propertyResolver) {
    this.log.debug("\t\tChecking direct plugin references of profile '" + profile.getId() + "'");
    BuildBase build = profile.getBuild();
    if (build != null) {
        Collection<Plugin> snapshots = Collections2.filter(build.getPlugins(), new IsSnapshotPlugin(propertyResolver));
        return Sets.newHashSet(Collections2.transform(snapshots, PluginToCoordinates.INSTANCE));
    }
    return Collections.emptySet();
}
Also used : BuildBase(org.apache.maven.model.BuildBase) IsSnapshotPlugin(com.itemis.maven.plugins.unleash.util.predicates.IsSnapshotPlugin) IsSnapshotPlugin(com.itemis.maven.plugins.unleash.util.predicates.IsSnapshotPlugin) Plugin(org.apache.maven.model.Plugin)

Aggregations

IsSnapshotPlugin (com.itemis.maven.plugins.unleash.util.predicates.IsSnapshotPlugin)4 Plugin (org.apache.maven.model.Plugin)4 Build (org.apache.maven.model.Build)2 BuildBase (org.apache.maven.model.BuildBase)2 PluginManagement (org.apache.maven.model.PluginManagement)2