Package org.apache.maven.lifecycle

Examples of org.apache.maven.lifecycle.MavenExecutionPlan


        final GoalTask goalTask1 = new GoalTask( "compiler:compile" );
        final GoalTask goalTask2 = new GoalTask( "surefire:test" );
        final TaskSegment taskSegment1 = new TaskSegment( false, goalTask1, goalTask2 );
        final MavenSession session1 = ProjectDependencyGraphStub.getMavenSession( ProjectDependencyGraphStub.A );

        MavenExecutionPlan executionPlan =
            lifecycleExecutionPlanCalculator.calculateExecutionPlan( session1, ProjectDependencyGraphStub.A,
                                                                     taskSegment1.getTasks() );
        assertEquals( 2, executionPlan.size() );

        final GoalTask goalTask3 = new GoalTask( "surefire:test" );
        final TaskSegment taskSegment2 = new TaskSegment( false, goalTask1, goalTask2, goalTask3 );
        MavenExecutionPlan executionPlan2 =
            lifecycleExecutionPlanCalculator.calculateExecutionPlan( session1, ProjectDependencyGraphStub.A,
                                                                     taskSegment2.getTasks() );
        assertEquals( 3, executionPlan2.size() );
    }
View Full Code Here


        final TaskSegment taskSegment1 = new TaskSegment( false );
        final MavenSession session1 = original.clone();
        session1.setCurrentProject( ProjectDependencyGraphStub.A );

        final BuilderCommon builderCommon = getBuilderCommon();
        final MavenExecutionPlan plan =
            builderCommon.resolveBuildPlan( session1, ProjectDependencyGraphStub.A, taskSegment1,
                                            new HashSet<Artifact>() );
        assertEquals( LifecycleExecutionPlanCalculatorStub.getProjectAExceutionPlan().size(), plan.size() );

    }
View Full Code Here

*/
public class PhaseRecorderTest extends TestCase
{
    public void testObserveExecution() throws Exception {
        PhaseRecorder phaseRecorder = new PhaseRecorder( ProjectDependencyGraphStub.A);
        MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExceutionPlan();
        final List<MojoExecution> executions = plan.getMojoExecutions();

        final MojoExecution mojoExecution1 = executions.get( 0 );
        final MojoExecution mojoExecution2 = executions.get( 1 );
        phaseRecorder.observeExecution( mojoExecution1 );

View Full Code Here

    public MavenExecutionPlan calculateExecutionPlan( MavenSession session, String... tasks )
        throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException,
        MojoNotFoundException
    {
        return new MavenExecutionPlan( Collections.<MojoExecution> emptyList(), null, null );
    }
View Full Code Here

                }
                for ( ProjectSegment projectBuild : segmentChunks )
                {
                    try
                    {
                        MavenExecutionPlan executionPlan =
                            builderCommon.resolveBuildPlan( projectBuild.getSession(), projectBuild.getProject(),
                                                            projectBuild.getTaskSegment(), projectArtifactsA );
                        for (Artifact dependency : projectBuild.getProject().getDependencyArtifacts()) {
                            String s = ArtifactUtils.key(dependency);
                            if ( projectArtifacts.contains(s)){
View Full Code Here

    }

    private void waitForAppropriateUpstreamExecutionsToFinish(BuildLogItem builtLogItem, ExecutionPlanItem nextPlanItem, ProjectSegment projectBuild) throws InterruptedException {
        for ( MavenProject upstreamProject : projectBuild.getImmediateUpstreamProjects() )
        {
            final MavenExecutionPlan upstreamPlan = executionPlans.get( upstreamProject );
            final String nextPhase = nextPlanItem.getLifecyclePhase();
            final ExecutionPlanItem inSchedule = upstreamPlan.findLastInPhase( nextPhase );

            if ( inSchedule != null )
            {
                long startWait = System.currentTimeMillis();
                inSchedule.waitUntilDone();
                builtLogItem.addWait( upstreamProject, inSchedule, startWait );
            }
            else if ( !upstreamPlan.containsPhase( nextPhase ) )
            {
                // Still a bit of a kludge; if we cannot connect in a sensible way to
                // the upstream build plan we just revert to waiting for it all to
                // complete. Real problem is per-mojo phase->lifecycle mapping
                builtLogItem.addDependency( upstreamProject, "No phase tracking possible " );
                upstreamPlan.waitUntilAllDone();
            }
            else
            {
                builtLogItem.addDependency( upstreamProject, "No schedule" );
            }
View Full Code Here

    public MavenExecutionPlan calculateExecutionPlan( MavenSession session, String... tasks )
        throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException,
        MojoNotFoundException
    {
        return new MavenExecutionPlan(null, null, null, null );
    }
View Full Code Here

        setupMojoExections( session, project, requiredDependencyResolutionScopes, requiredDependencyCollectionScopes,
                            executions );

        final List<ExecutionPlanItem> planItem = defaultSchedules.createExecutionPlanItem( project, executions );

        return new MavenExecutionPlan( requiredDependencyResolutionScopes, requiredDependencyCollectionScopes, planItem,
                                       defaultLifeCycles );


    }
View Full Code Here

        throws PluginNotFoundException, PluginResolutionException, LifecyclePhaseNotFoundException,
        PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException,
        NoPluginFoundForPrefixException, LifecycleNotFoundException, PluginVersionResolutionException,
        LifecycleExecutionException
    {
        MavenExecutionPlan executionPlan =
            lifeCycleExecutionPlanCalculator.calculateExecutionPlan( session, project, taskSegment.getTasks() );
        lifecycleDebugLogger.debugProjectPlan( project, executionPlan );

        // TODO: once we have calculated the build plan then we should accurately be able to download
        // the project dependencies. Having it happen in the plugin manager is a tangled mess. We can optimize
View Full Code Here

        LifecyclePhaseNotFoundException, LifecycleNotFoundException
    {
        int result = 0;
        for ( ProjectSegment projectBuild : projectBuildList )
        {
            MavenExecutionPlan plan = calculateExecutionPlan( projectBuild.getSession(), projectBuild.getProject(),
                                                              projectBuild.getTaskSegment().getTasks() );
            result += plan.size();
        }
        return result;
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.lifecycle.MavenExecutionPlan

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.