Search in sources :

Example 21 with Plugin

use of org.apache.maven.model.Plugin in project fabric8-maven-plugin by fabric8io.

the class VertxPortsExtractor method getConfigPathFromProject.

@Override
public String getConfigPathFromProject(MavenProject project) {
    Plugin plugin = project.getPlugin(Constants.VERTX_MAVEN_PLUGIN_GA);
    if (plugin == null) {
        return null;
    }
    Xpp3Dom configuration = (Xpp3Dom) plugin.getConfiguration();
    if (configuration == null) {
        return null;
    }
    Xpp3Dom config = configuration.getChild("config");
    return config != null ? config.getValue() : null;
}
Also used : Xpp3Dom(org.codehaus.plexus.util.xml.Xpp3Dom) Plugin(org.apache.maven.model.Plugin)

Example 22 with Plugin

use of org.apache.maven.model.Plugin 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 23 with Plugin

use of org.apache.maven.model.Plugin 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 24 with Plugin

use of org.apache.maven.model.Plugin 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 25 with Plugin

use of org.apache.maven.model.Plugin 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)

Aggregations

Plugin (org.apache.maven.model.Plugin)140 Xpp3Dom (org.codehaus.plexus.util.xml.Xpp3Dom)39 MavenProject (org.apache.maven.project.MavenProject)26 Build (org.apache.maven.model.Build)22 PluginExecution (org.apache.maven.model.PluginExecution)22 ArrayList (java.util.ArrayList)20 Dependency (org.apache.maven.model.Dependency)17 File (java.io.File)15 Model (org.apache.maven.model.Model)15 HashMap (java.util.HashMap)12 PluginDescriptor (org.apache.maven.plugin.descriptor.PluginDescriptor)12 CoreException (org.eclipse.core.runtime.CoreException)11 IOException (java.io.IOException)9 List (java.util.List)8 PluginManagement (org.apache.maven.model.PluginManagement)8 Map (java.util.Map)7 MavenSession (org.apache.maven.execution.MavenSession)7 ReportPlugin (org.apache.maven.model.ReportPlugin)7 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)7 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)6