Package org.apache.maven.model

Examples of org.apache.maven.model.Plugin


    {
        if (this.plugins != null && !this.plugins.isEmpty())
        {
            for (final Iterator iterator = this.plugins.iterator(); iterator.hasNext();)
            {
                final Plugin plugin = (Plugin)iterator.next();
                if (Constants.ARTIFACT_ID.equals(plugin.getArtifactId()))
                {
                    final List dependencies = plugin.getDependencies();
                    if (dependencies != null)
                    {
                        for (final Iterator dependencyIterator = plugin.getDependencies().iterator();
                            dependencyIterator.hasNext();)
                        {
                            final Dependency dependency = (Dependency)dependencyIterator.next();
                            dependency.setScope(Artifact.SCOPE_RUNTIME);
                            this.addDependency(dependency);
View Full Code Here


        if (build != null)
        {
            final PluginManagement pluginManagement = build.getPluginManagement();
            if (pluginManagement != null && !pluginManagement.getPlugins().isEmpty())
            {
                Plugin multiSourcePlugin = null;
                for (final Iterator iterator = pluginManagement.getPlugins().iterator(); iterator.hasNext();)
                {
                    final Plugin plugin = (Plugin)iterator.next();
                    if (MULTI_SOURCE_PLUGIN_ARTIFACT_ID.equals(plugin.getArtifactId()))
                    {
                        multiSourcePlugin = plugin;
                        break;
                    }
                }
View Full Code Here

            final List plugins = this.getPlugins();
            if (plugins != null && !plugins.isEmpty())
            {
                for (final Iterator iterator = plugins.iterator(); iterator.hasNext();)
                {
                    final Plugin plugin = (Plugin)iterator.next();
                    if (pluginArtifactId.equals(plugin.getArtifactId()))
                    {
                        final List dependencies = plugin.getDependencies();
                        if (dependencies != null)
                        {
                            for (final Iterator dependencyIterator = plugin.getDependencies().iterator();
                                dependencyIterator.hasNext();)
                            {
                                this.addDependency(
                                    (Dependency)dependencyIterator.next(),
                                    scope);
View Full Code Here

    /**
     * We need the bundle plugin with a version higher than 2.5.0!
     */
    private Plugin getBundlePlugin() {
        Plugin bundlePlugin  = null;
        final List<Plugin> plugins = this.project.getBuildPlugins();
        for(final Plugin p : plugins) {
            if ( p.getArtifactId().equals(BUNDLE_PLUGIN_ARTIFACT_ID)
                 && p.getGroupId().equals(BUNDLE_PLUGIN_GROUP_ID) ) {
                final ArtifactVersion pluginVersion = new DefaultArtifactVersion(p.getVersion());
View Full Code Here

    }

    private String getBundlePluginConfiguration(final String key) {
        String value = null;
        Plugin bundlePlugin = this.getBundlePlugin();
        if ( bundlePlugin != null ) {
            final Xpp3Dom config = (Xpp3Dom) bundlePlugin.getConfiguration();
            if ( config != null) {
                final Xpp3Dom instructionsConfig = config.getChild(BUNDLE_PLUGIN_INSTRUCTIONS);
                if ( instructionsConfig != null) {
                    final Xpp3Dom keyConfig = instructionsConfig.getChild(key);
                    if ( keyConfig != null ) {
View Full Code Here

                Map<Object, List<Plugin>> predecessors = new LinkedHashMap<Object, List<Plugin>>();
                List<Plugin> pending = new ArrayList<Plugin>();
                for ( Plugin element : src )
                {
                    Object key = getPluginKey( element );
                    Plugin existing = master.get( key );
                    if ( existing != null )
                    {
                        mergePlugin( existing, element, sourceDominant, context );

                        if ( !pending.isEmpty() )
View Full Code Here

        return createPlugin( project.getGroupId(), project.getArtifactId(), project.getVersion() );
    }

    private Plugin createPlugin( String groupId, String artifactId, String version )
    {
        Plugin plugin = new Plugin();
        plugin.setGroupId( groupId );
        plugin.setArtifactId( artifactId );
        plugin.setVersion( version );
        return plugin;
    }
View Full Code Here

    {
        MavenProject project = createProject( "group", "artifact", "1.0" );

        Build build = project.getModel().getBuild();

        Plugin plugin = createPlugin( "other.group", "other-artifact", "1.0" );

        Dependency dep = createDependency( "group", "artifact", "1.0" );

        plugin.addDependency( dep );

        build.addPlugin( plugin );

        new ProjectSorter( Collections.singletonList( project ) );
    }
View Full Code Here

        Build build = project.getModel().getBuild();

        PluginManagement pMgmt = new PluginManagement();

        Plugin plugin = createPlugin( "other.group", "other-artifact", "1.0" );

        Dependency dep = createDependency( "group", "artifact", "1.0" );

        plugin.addDependency( dep );

        pMgmt.addPlugin( plugin );

        build.setPluginManagement( pMgmt );
View Full Code Here

        MavenProject pluginProject = createProject( "groupId", "plugin", "1.0" );
        pluginProject.setParent( parentProject );
        pluginProject.getModel().setParent( createParent( parentProject ) );
        projects.add( pluginProject );

        Plugin plugin = createPlugin( pluginProject );

        plugin.addDependency( createDependency( pluginLevelDepProject ) );

        Build build = declaringProject.getModel().getBuild();

        build.addPlugin( plugin );
View Full Code Here

TOP

Related Classes of org.apache.maven.model.Plugin

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.