Search in sources :

Example 1 with IsSnapshotDependency

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

the class CheckPluginDependencyVersions method getSnapshots.

private Multimap<ArtifactCoordinates, ArtifactCoordinates> getSnapshots(MavenProject project, PomPropertyResolver propertyResolver) {
    this.log.debug("\t\tChecking direct plugin references");
    Multimap<ArtifactCoordinates, ArtifactCoordinates> result = HashMultimap.create();
    Build build = project.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;
}
Also used : Build(org.apache.maven.model.Build) IsSnapshotDependency(com.itemis.maven.plugins.unleash.util.predicates.IsSnapshotDependency) ArtifactCoordinates(com.itemis.maven.aether.ArtifactCoordinates) Dependency(org.apache.maven.model.Dependency) IsSnapshotDependency(com.itemis.maven.plugins.unleash.util.predicates.IsSnapshotDependency) Plugin(org.apache.maven.model.Plugin)

Example 2 with IsSnapshotDependency

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

the class CheckDependencyVersions method getSnapshots.

private Set<ArtifactCoordinates> getSnapshots(Profile profile, PomPropertyResolver propertyResolver) {
    this.log.debug("\t\tChecking direct dependencies of profile '" + profile.getId() + "'");
    Collection<Dependency> snapshots = Collections2.filter(profile.getDependencies(), new IsSnapshotDependency(propertyResolver));
    return Sets.newHashSet(Collections2.transform(snapshots, DependencyToCoordinates.INSTANCE));
}
Also used : IsSnapshotDependency(com.itemis.maven.plugins.unleash.util.predicates.IsSnapshotDependency) Dependency(org.apache.maven.model.Dependency) IsSnapshotDependency(com.itemis.maven.plugins.unleash.util.predicates.IsSnapshotDependency)

Example 3 with IsSnapshotDependency

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

the class CheckDependencyVersions method getSnapshotsFromManagement.

private Set<ArtifactCoordinates> getSnapshotsFromManagement(MavenProject project, PomPropertyResolver propertyResolver) {
    this.log.debug("\t\tChecking managed dependencies");
    DependencyManagement dependencyManagement = project.getDependencyManagement();
    if (dependencyManagement != null) {
        Collection<Dependency> snapshots = Collections2.filter(dependencyManagement.getDependencies(), new IsSnapshotDependency(propertyResolver));
        HashSet<ArtifactCoordinates> snapshotDependencies = Sets.newHashSet(Collections2.transform(snapshots, DependencyToCoordinates.INSTANCE));
        filterMultiModuleDependencies(snapshotDependencies);
        return snapshotDependencies;
    }
    return Collections.emptySet();
}
Also used : IsSnapshotDependency(com.itemis.maven.plugins.unleash.util.predicates.IsSnapshotDependency) ArtifactCoordinates(com.itemis.maven.aether.ArtifactCoordinates) Dependency(org.apache.maven.model.Dependency) IsSnapshotDependency(com.itemis.maven.plugins.unleash.util.predicates.IsSnapshotDependency) DependencyManagement(org.apache.maven.model.DependencyManagement)

Example 4 with IsSnapshotDependency

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

the class CheckDependencyVersions method getSnapshots.

private Set<ArtifactCoordinates> getSnapshots(MavenProject project, PomPropertyResolver propertyResolver) {
    this.log.debug("\t\tChecking direct dependencies");
    Collection<Dependency> snapshots = Collections2.filter(project.getDependencies(), new IsSnapshotDependency(propertyResolver));
    HashSet<ArtifactCoordinates> snapshotDependencies = Sets.newHashSet(Collections2.transform(snapshots, DependencyToCoordinates.INSTANCE));
    filterMultiModuleDependencies(snapshotDependencies);
    return snapshotDependencies;
}
Also used : IsSnapshotDependency(com.itemis.maven.plugins.unleash.util.predicates.IsSnapshotDependency) ArtifactCoordinates(com.itemis.maven.aether.ArtifactCoordinates) Dependency(org.apache.maven.model.Dependency) IsSnapshotDependency(com.itemis.maven.plugins.unleash.util.predicates.IsSnapshotDependency)

Example 5 with IsSnapshotDependency

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

the class CheckDependencyVersions method getSnapshotsFromManagement.

private Set<ArtifactCoordinates> getSnapshotsFromManagement(Profile profile, PomPropertyResolver propertyResolver) {
    this.log.debug("\t\tChecking managed dependencies of profile '" + profile.getId() + "'");
    DependencyManagement dependencyManagement = profile.getDependencyManagement();
    if (dependencyManagement != null) {
        Collection<Dependency> snapshots = Collections2.filter(dependencyManagement.getDependencies(), new IsSnapshotDependency(propertyResolver));
        return Sets.newHashSet(Collections2.transform(snapshots, DependencyToCoordinates.INSTANCE));
    }
    return Collections.emptySet();
}
Also used : IsSnapshotDependency(com.itemis.maven.plugins.unleash.util.predicates.IsSnapshotDependency) Dependency(org.apache.maven.model.Dependency) IsSnapshotDependency(com.itemis.maven.plugins.unleash.util.predicates.IsSnapshotDependency) DependencyManagement(org.apache.maven.model.DependencyManagement)

Aggregations

IsSnapshotDependency (com.itemis.maven.plugins.unleash.util.predicates.IsSnapshotDependency)8 Dependency (org.apache.maven.model.Dependency)8 ArtifactCoordinates (com.itemis.maven.aether.ArtifactCoordinates)6 Plugin (org.apache.maven.model.Plugin)4 Build (org.apache.maven.model.Build)2 BuildBase (org.apache.maven.model.BuildBase)2 DependencyManagement (org.apache.maven.model.DependencyManagement)2 PluginManagement (org.apache.maven.model.PluginManagement)2