Examples of MojoExecution


Examples of org.apache.maven.plugin.MojoExecution

        {
            List tasks = (List) lifecycleIterator.next();

            for ( Iterator taskIterator = tasks.iterator(); taskIterator.hasNext(); )
            {
                MojoExecution execution = (MojoExecution) taskIterator.next();

                if ( lifecycleForkers.contains( execution.getMojoDescriptor() ) )
                {
                    taskIterator.remove();
                    getLogger().warn( "Removing: " + execution.getMojoDescriptor().getGoal()
                                      + " from forked lifecycle, to prevent recursive invocation." );
                }
            }
        }
    }
View Full Code Here

Examples of org.apache.maven.plugin.MojoExecution

                        throw new LifecycleExecutionException( "Mojo: \'" + goal +
                            "\' requires direct invocation. It cannot be used as part of lifecycle: \'" +
                            project.getPackaging() + "\'." );
                    }

                    addToLifecycleMappings( lifecycleMappings, phase, new MojoExecution( mojoDescriptor ),
                                            session.getSettings() );
                }
            }

            if ( phase.equals( selectedPhase ) )
View Full Code Here

Examples of org.apache.maven.plugin.MojoExecution

            }

            // We have to check to see that the inheritance rules have been applied before binding this mojo.
            if ( execution.isInheritanceApplied() || mojoDescriptor.isInheritedByDefault() )
            {
                MojoExecution mojoExecution = new MojoExecution( mojoDescriptor, execution.getId() );

                String phase = execution.getPhase();

                if ( phase == null )
                {
View Full Code Here

Examples of org.apache.maven.plugin.MojoExecution

                        else
                        {
                            forkedMojoDescriptor = mojoDescriptorCreator.getMojoDescriptor( goal, session, project );
                        }

                        MojoExecution forkedExecution =
                            new MojoExecution( forkedMojoDescriptor, mojoExecution.getExecutionId() );

                        Xpp3Dom forkedConfiguration = (Xpp3Dom) execution.getConfiguration();

                        forkedExecution.setConfiguration( forkedConfiguration );

                        populateMojoExecutionConfiguration( project, forkedExecution, true );

                        forkedExecutions.add( forkedExecution );
                    }
                }

                Xpp3Dom phaseConfiguration = (Xpp3Dom) phase.getConfiguration();

                if ( phaseConfiguration != null )
                {
                    for ( MojoExecution forkedExecution : forkedExecutions )
                    {
                        Xpp3Dom forkedConfiguration = forkedExecution.getConfiguration();

                        forkedConfiguration = Xpp3Dom.mergeXpp3Dom( phaseConfiguration, forkedConfiguration );

                        forkedExecution.setConfiguration( forkedConfiguration );
                    }
                }
            }
        }
    }
View Full Code Here

Examples of org.apache.maven.plugin.MojoExecution

        if ( alreadyForkedExecutions.contains( forkedMojoDescriptor ) )
        {
            return Collections.emptyList();
        }

        MojoExecution forkedExecution = new MojoExecution( forkedMojoDescriptor, forkedGoal );

        populateMojoExecutionConfiguration( project, forkedExecution, true );

        finalizeMojoConfiguration( forkedExecution );
View Full Code Here

Examples of org.apache.maven.plugin.MojoExecution

    public Set<Plugin> getNonThreadSafePlugins()
    {
        Set<Plugin> plugins = new HashSet<Plugin>();
        for ( ExecutionPlanItem executionPlanItem : planItem )
        {
            final MojoExecution mojoExecution = executionPlanItem.getMojoExecution();
            if ( !mojoExecution.getMojoDescriptor().isThreadSafe() )
            {
                plugins.add( mojoExecution.getPlugin() );
            }
        }
        return plugins;
    }
View Full Code Here

Examples of org.apache.maven.plugin.MojoExecution

    protected MojoExecution findForkedExecution(MojoExecution primary,
            String groupId, String artifactId, String goal) {
        Map<String, List<MojoExecution>> forkedExecutions =
                primary.getForkedExecutions();
        MojoExecution goalExecution = null;
        for (List<MojoExecution> possibleExecutionList : forkedExecutions
                .values()) {
            for (MojoExecution possibleExecution : possibleExecutionList) {
                if (groupId.equals(possibleExecution.getGroupId())
                        && artifactId.equals(possibleExecution.getArtifactId())
View Full Code Here

Examples of org.apache.maven.plugin.MojoExecution

    private void executeStandaloneGoal( String task, Stack forkEntryPoints, MavenSession session, MavenProject project )
        throws LifecycleExecutionException, BuildFailureException, PluginNotFoundException
    {
        // guaranteed to come from the CLI and not be part of a phase
        MojoDescriptor mojoDescriptor = getMojoDescriptor( task, session, project, task, true, false );
        executeGoals( Collections.singletonList( new MojoExecution( mojoDescriptor ) ), forkEntryPoints, session,
                      project );
    }
View Full Code Here

Examples of org.apache.maven.plugin.MojoExecution

    private void executeGoals( List goals, Stack forkEntryPoints, MavenSession session, MavenProject project )
        throws LifecycleExecutionException, BuildFailureException, PluginNotFoundException
    {
        for ( Iterator i = goals.iterator(); i.hasNext(); )
        {
            MojoExecution mojoExecution = (MojoExecution) i.next();

            MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor();
           
            PlexusConfiguration configuration = mojoDescriptor.getMojoConfiguration();
            boolean usesReactorProjects = mojoDescriptor.isAggregator() || usesSessionOrReactorProjects( configuration );
           
            if ( usesReactorProjects )
            {
                calculateAllConcreteStates( session );
            }
            else
            {
                calculateConcreteState( project, session, true );
            }
           
            calculateConcreteConfiguration( mojoExecution, project, session );
           
            List reportExecutions = null;
            if ( mojoDescriptor.isRequiresReports() )
            {
                reportExecutions = getReportExecutions( project, forkEntryPoints, mojoExecution, session );
            }
           
            boolean hasFork = false;
            if ( mojoDescriptor.getExecutePhase() != null || mojoDescriptor.getExecuteGoal() != null )
            {
                hasFork = true;
            }
            else if ( reportExecutions != null )
            {
                for ( Iterator it = reportExecutions.iterator(); it.hasNext(); )
                {
                    MojoExecution reportExecution = (MojoExecution) it.next();
                    MojoDescriptor reportDescriptor = reportExecution.getMojoDescriptor();
                    if ( reportDescriptor.getExecutePhase() != null || reportDescriptor.getExecuteGoal() != null )
                    {
                        hasFork = true;
                    }
                }
            }
           
            if ( hasFork )
            {
                // NOTE: This must always happen, regardless of treatment of reactorProjects below, because
                // if we're in a forked execution right now, the current project will itself be an execution project of
                // something in the reactorProjects list, and won't have a next-stage executionProject created
                // for it otherwise, which leaves the project == null for the upcoming forked execution.
                createExecutionProject( project, session, true );
               
                if ( usesReactorProjects )
                {
                    List reactorProjects = session.getSortedProjects();
                    for ( Iterator it = reactorProjects.iterator(); it.hasNext(); )
                    {
                        MavenProject reactorProject = (MavenProject) it.next();
                        createExecutionProject( reactorProject, session, false );
                    }
                }
            }

            if ( mojoDescriptor.getExecutePhase() != null || mojoDescriptor.getExecuteGoal() != null )
            {
                forkEntryPoints.push( mojoDescriptor );

                forkLifecycle( mojoDescriptor, forkEntryPoints, session, project );

                forkEntryPoints.pop();
            }
           
            if ( mojoDescriptor.isRequiresReports() )
            {
                List reports = getReports( reportExecutions, project, mojoExecution, session );

                mojoExecution.setReports( reports );

                for ( Iterator j = mojoExecution.getForkedExecutions().iterator(); j.hasNext(); )
                {
                    MojoExecution forkedExecution = (MojoExecution) j.next();
                    MojoDescriptor descriptor = forkedExecution.getMojoDescriptor();

                    if ( descriptor.getExecutePhase() != null )
                    {
                        forkEntryPoints.push( descriptor );
View Full Code Here

Examples of org.apache.maven.plugin.MojoExecution

                if ( reportSet != null )
                {
                    id = reportSet.getId();
                }

                MojoExecution reportExecution = new MojoExecution( mojoDescriptor, id );
                reports.add( reportExecution );
            }
        }
        return reports;
    }
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.