Package org.apache.maven.model

Examples of org.apache.maven.model.PluginExecution


        Plugin pChild = new Plugin();
        pChild.setGroupId( gid );
        pChild.setArtifactId( aid );
        pChild.setVersion( ver );

        PluginExecution eChild = new PluginExecution();
        eChild.setId( "normal" );
        eChild.addGoal( "run" );

        pChild.addExecution( eChild );

        Build bChild = new Build();
        bChild.addPlugin( pChild );

        child.setBuild( bChild );

        Model parent = makeBaseModel( "parent" );

        Plugin pParent = new Plugin();
        pParent.setGroupId( gid );
        pParent.setArtifactId( aid );
        pParent.setVersion( ver );

        PluginExecution eParent = new PluginExecution();
        eParent.setId( testId );
        eParent.addGoal( "test" );
        eParent.setInherited( Boolean.toString( false ) );

        pParent.addExecution( eParent );

        Build bParent = new Build();
        bParent.addPlugin( pParent );
View Full Code Here


            Map profileExecutions = profilePlugin.getExecutionsAsMap();

            for ( Iterator it = modelExecutions.iterator(); it.hasNext(); )
            {
                PluginExecution modelExecution = (PluginExecution) it.next();

                PluginExecution profileExecution = (PluginExecution) profileExecutions.get( modelExecution.getId() );

                if ( profileExecution != null )
                {
                    injectConfigurationContainer( profileExecution, modelExecution );

                    if ( profileExecution.getPhase() != null )
                    {
                        modelExecution.setPhase( profileExecution.getPhase() );
                    }

                    List profileGoals = profileExecution.getGoals();
                    List modelGoals = modelExecution.getGoals();

                    List goals = new ArrayList();

                    if ( ( modelGoals != null ) && !modelGoals.isEmpty() )
View Full Code Here

            }

            Counter innerCount = new Counter( counter.getDepth() + 1 );
            while ( it.hasNext() )
            {
                PluginExecution value = (PluginExecution) it.next();
                Element el;
                if ( ( elIt != null ) && elIt.hasNext() )
                {
                    el = (Element) elIt.next();
                    if ( !elIt.hasNext() )
View Full Code Here

                {
                    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

                {
                    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

                }

                for ( PluginExecution element : src )
                {
                    Object key = getPluginExecutionKey( element );
                    PluginExecution existing = merged.get( key );
                    if ( existing != null )
                    {
                        mergePluginExecution( existing, element, sourceDominant, context );
                    }
                    else
View Full Code Here

            }

            for ( PluginExecution element : tgt )
            {
                Object key = getPluginExecutionKey( element );
                PluginExecution existing = merged.get( key );
                if ( existing != null )
                {
                    mergePluginExecution( element, existing, sourceDominant, context );
                }
                merged.put( key, element );
View Full Code Here

        // Goal specific configuration
        // ----------------------------------------------------------------------

        List<PluginExecution> executions = plugin.getExecutions();

        PluginExecution execution = executions.get( 0 );

        String g0 = execution.getGoals().get( 0 );

        assertEquals( "plexus:runtime", g0 );

        configuration = (Xpp3Dom) execution.getConfiguration();

        assertEquals( "ContinuumPro", configuration.getChild( "plexusApplicationName" ).getValue() );

        // Plugin1 [antlr]
    }
View Full Code Here

                List executions = plugin.getExecutions();

                // a different source/target version can be configured for test sources compilation
                for ( Iterator iter = executions.iterator(); iter.hasNext(); )
                {
                    PluginExecution execution = (PluginExecution) iter.next();

                    // TODO: This may cause ClassCastExceptions eventually, if the dom impls differ.
                    o = (Xpp3Dom) execution.getConfiguration();

                    if ( o != null && o.getChild( optionName ) != null )
                    {
                        value = o.getChild( optionName ).getValue();
                    }
View Full Code Here

     * @return PluginExecution
     */
    private PluginExecution parsePluginExecution( String tagName, XmlPullParser parser, boolean strict )
        throws IOException, XmlPullParserException
    {
        PluginExecution pluginExecution = new PluginExecution();
        java.util.Set parsed = new java.util.HashSet();
        while ( parser.nextTag() == XmlPullParser.START_TAG )
        {
            if ( checkFieldWithDuplicate( parser, "id", null, parsed ) )
            {
                pluginExecution.setId( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "phase", null, parsed ) )
            {
                pluginExecution.setPhase( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "goals", null, parsed ) )
            {
                java.util.List goals = new java.util.ArrayList/*<String>*/();
                pluginExecution.setGoals( goals );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    if ( parser.getName().equals( "goal" ) )
                    {
                        goals.add( getTrimmedValue( parser.nextText() ) );
                    }
                    else if ( strict )
                    {
                        throw new XmlPullParserException( "Unrecognised association: '" + parser.getName() + "'", parser, null );
                    }
                    else
                    {
                        // swallow up to end tag since this is not valid
                        while ( parser.next() != XmlPullParser.END_TAG ) {}
                    }
                }
            }
            else if ( checkFieldWithDuplicate( parser, "inherited", null, parsed ) )
            {
                pluginExecution.setInherited( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "configuration", null, parsed ) )
            {
                pluginExecution.setConfiguration( Xpp3DomBuilder.build( parser ) );
            }
            else
            {
                if ( strict )
                {
View Full Code Here

TOP

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

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.