Examples of PluginExecution


Examples of org.apache.maven.model.PluginExecution

        plugin.setGroupId( "org.apache.maven.plugins" );
        plugin.setArtifactId( artifactId );

        for ( String goal : goals )
        {
            PluginExecution pluginExecution = new PluginExecution();
            pluginExecution.setId( "default-" + goal );
            pluginExecution.addGoal( goal );
            plugin.addExecution( pluginExecution );
        }

        return plugin;
    }
View Full Code Here

Examples of org.apache.maven.model.PluginExecution

        PluginDescriptor pluginDescriptor = descriptor.getPluginDescriptor();
        Map pluginMap = project.getBuild().getPluginsAsMap();
        Plugin plugin = (Plugin) pluginMap.get(pluginDescriptor.getGroupId() + ":" + pluginDescriptor.getArtifactId());
        // How to get the current execution id?
        for (Iterator i = plugin.getExecutions().iterator(); i.hasNext();) {
            PluginExecution execution = (PluginExecution) i.next();
            String phase = execution.getPhase();
            if (phase != null && phase.indexOf("-test-") != -1) {
                project.addTestCompileSourceRoot(targetDirectory);
            } else {
                project.addCompileSourceRoot(targetDirectory);
            }
View Full Code Here

Examples of org.apache.maven.model.PluginExecution

            plugin = findPlugin( g, a, project.getPluginManagement().getPlugins() );
        }

        if ( plugin != null )
        {
            PluginExecution pluginExecution =
                findPluginExecution( mojoExecution.getExecutionId(), plugin.getExecutions() );

            Xpp3Dom pomConfiguration = null;

            if ( pluginExecution != null )
            {
                pomConfiguration = (Xpp3Dom) pluginExecution.getConfiguration();
            }
            else if ( allowPluginLevelConfig )
            {
                pomConfiguration = (Xpp3Dom) plugin.getConfiguration();
            }
View Full Code Here

Examples of org.apache.maven.model.PluginExecution

        Plugin pPlugin = new Plugin();
        pPlugin.setGroupId( "test" );
        pPlugin.setArtifactId( "test-artifact" );
        pPlugin.setVersion( "1.0-SNAPSHOT" );

        PluginExecution pExec = new PluginExecution();
        pExec.setId("profile-injected");

        Xpp3Dom pConfigChild = new Xpp3Dom( "test" );
        pConfigChild.setValue( "replacedValue" );

        Xpp3Dom pConfig = new Xpp3Dom( "configuration" );
        pConfig.addChild( pConfigChild );

        pExec.setConfiguration( pConfig );

        pPlugin.addExecution( pExec );

        BuildBase pBuild = new BuildBase();
        pBuild.addPlugin( pPlugin );

        Profile profile = new Profile();
        profile.setId( "testId" );

        profile.setBuild( pBuild );

        new DefaultProfileInjector().inject( profile, model );

        Build rBuild = model.getBuild();
        Plugin rPlugin = (Plugin) rBuild.getPlugins().get( 0 );

        PluginExecution rExec = (PluginExecution) rPlugin.getExecutionsAsMap().get( "profile-injected" );

        assertNotNull( rExec );

        Xpp3Dom rExecConfig = (Xpp3Dom) rExec.getConfiguration();

        Xpp3Dom rChild = rExecConfig.getChild( "test" );

        assertEquals( "replacedValue", rChild.getValue() );
View Full Code Here

Examples of org.apache.maven.model.PluginExecution

            Map childExecutions = child.getExecutionsAsMap();

            for ( Iterator it = parentExecutions.iterator(); it.hasNext(); )
            {
                PluginExecution parentExecution = (PluginExecution) it.next();

                String inherited = parentExecution.getInherited();

                boolean parentExecInherited = parentIsInherited && ( ( inherited == null ) || Boolean.valueOf( inherited ).booleanValue() );

                if ( !handleAsInheritance || parentExecInherited )
                {
                    PluginExecution assembled = parentExecution;

                    PluginExecution childExecution = (PluginExecution) childExecutions.get( parentExecution.getId() );

                    if ( childExecution != null )
                    {
                        mergePluginExecutionDefinitions( childExecution, parentExecution );

                        assembled = childExecution;
                    }
                    else if ( handleAsInheritance && ( parentInherited == null ) )
                    {
                        parentExecution.unsetInheritanceApplied();
                    }

                    assembledExecutions.put( assembled.getId(), assembled );
                    mergedExecutions.add(assembled);
                }
            }

            for ( Iterator it = child.getExecutions().iterator(); it.hasNext(); )
            {
                PluginExecution childExecution = (PluginExecution)it.next();

                if ( !assembledExecutions.containsKey( childExecution.getId() ) )
                {
                    mergedExecutions.add(childExecution);
                }
            }
View Full Code Here

Examples of org.apache.maven.model.PluginExecution

        {
            newExecs = new ArrayList( executions.size() );

            for ( Iterator it = executions.iterator(); it.hasNext(); )
            {
                PluginExecution exec = (PluginExecution) it.next();

                PluginExecution newExec = new PluginExecution();

                // TODO: Deep-copy configs.
                newExec.setConfiguration( exec.getConfiguration() );

                newExec.setId( exec.getId() );
                newExec.setInherited( exec.getInherited() );
                newExec.setPhase( exec.getPhase() );

                List goals = exec.getGoals();

                if ( ( goals != null ) && !goals.isEmpty() )
                {
                    newExec.setGoals( new ArrayList( goals ) );
                }

                newExecs.add( newExec );
            }
        }
View Full Code Here

Examples of org.apache.maven.model.PluginExecution

                if ( executions != null )
                {
                    for ( Iterator it = executions.iterator(); it.hasNext(); )
                    {
                        PluginExecution execution = (PluginExecution) it.next();

                        bindExecutionToLifecycle( pluginDescriptor, phaseMap, execution, settings );
                    }
                }
            }
View Full Code Here

Examples of org.apache.maven.model.PluginExecution

            else
            {
                plugins.put( plugin, plugin );
            }

            PluginExecution execution = new PluginExecution();
            execution.setId( getExecutionId( plugin, gs.goal ) );
            execution.setPhase( phase );
            execution.setPriority( i - mojos.length );
            execution.getGoals().add( gs.goal );

            plugin.getExecutions().add( execution );
        }
    }
View Full Code Here

Examples of org.apache.maven.model.PluginExecution

                {
                    dom = (Xpp3Dom) plugin.getConfiguration();

                    if ( executionId != null )
                    {
                        PluginExecution execution = plugin.getExecutionsAsMap().get( executionId );
                        if ( execution != null )
                        {
                            // NOTE: The PluginConfigurationExpander already merged the plugin-level config in
                            dom = (Xpp3Dom) execution.getConfiguration();
                        }
                    }
                    break;
                }
            }
View Full Code Here

Examples of org.apache.maven.model.PluginExecution

                {
                    dom = (Xpp3Dom) plugin.getConfiguration();

                    if ( executionId != null )
                    {
                        PluginExecution execution = plugin.getExecutionsAsMap().get( executionId );
                        if ( execution != null )
                        {
                            // NOTE: The PluginConfigurationExpander already merged the plugin-level config in
                            dom = (Xpp3Dom) execution.getConfiguration();
                        }
                    }
                    break;
                }
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.