Package org.apache.maven.execution

Examples of org.apache.maven.execution.ReactorManager


                            }
                        }
                    }
                    if (this.aggregateGoals)
                    {
                        final ReactorManager reactorManager = new ReactorManager(projects);
                        if (projects.size() > 1)
                        {
                            this.getLog().info("Reactor build order:");
                        }
                        for (final Iterator iterator = reactorManager.getSortedProjects().iterator();
                            iterator.hasNext();)
                        {
                            final MavenProject project = (MavenProject)iterator.next();
                            this.getLog().info("  " + project.getName());
                        }
                        final MavenSession projectSession =
                            new MavenSession(
                                this.session.getContainer(),
                                this.session.getSettings(),
                                this.session.getLocalRepository(),
                                this.session.getEventDispatcher(),
                                reactorManager,
                                goals,
                                this.baseDirectory.toString(),
                                this.session.getExecutionProperties(),
                                this.session.getStartTime());

                        projectSession.setUsingPOMsFromFilesystem(true);
                        this.lifecycleExecutor.execute(
                            projectSession,
                            reactorManager,
                            projectSession.getEventDispatcher());
                    }
                    else
                    {
                        for (final Iterator iterator = this.session.getGoals().iterator(); iterator.hasNext();)
                        {
                            final String goal = (String)iterator.next();
                            final ReactorManager reactorManager = new ReactorManager(projects);
                            if (projects.size() > 1)
                            {
                                this.getLog().info("Reactor build order:");
                            }
                            for (final Iterator projectIterator = reactorManager.getSortedProjects().iterator();
                                projectIterator.hasNext();)
                            {
                                final MavenProject project = (MavenProject)projectIterator.next();
                                this.getLog().info("  " + project.getName());
                            }
View Full Code Here


            }
            if (projects.size() > 1)
            {
                this.getLog().info("Reactor build order:");
            }
            final ReactorManager reactorManager = new ReactorManager(new ArrayList(projects));
            for (final Iterator iterator = reactorManager.getSortedProjects().iterator(); iterator.hasNext();)
            {
                final MavenProject project = (MavenProject)iterator.next();
                this.getLog().info("  " + project.getName());
            }
View Full Code Here

        String event = MavenEvents.REACTOR_EXECUTION;

        dispatcher.dispatchStart( event, request.getBaseDirectory() );

        ReactorManager rm;
        try
        {
            rm = doExecute( request, dispatcher );
        }
        catch ( LifecycleExecutionException e )
        {
            dispatcher.dispatchError( event, request.getBaseDirectory(), e );

            logError( e, request.isShowErrors() );

            stats( request.getStartTime() );

            line();

            throw new MavenExecutionException( e.getMessage(), e );
        }
        catch ( BuildFailureException e )
        {
            dispatcher.dispatchError( event, request.getBaseDirectory(), e );

            logFailure( e, request.isShowErrors() );

            stats( request.getStartTime() );

            line();

            throw new MavenExecutionException( e.getMessage(), e );
        }
        catch ( Throwable t )
        {
            dispatcher.dispatchError( event, request.getBaseDirectory(), t );

            logFatal( t );

            stats( request.getStartTime() );

            line();

            throw new MavenExecutionException( "Error executing project within the reactor", t );
        }

        // Either the build was successful, or it was a fail_at_end/fail_never reactor build

        // TODO: should all the logging be left to the CLI?
        logReactorSummary( rm );

        if ( rm.hasBuildFailures() )
        {
            logErrors( rm, request.isShowErrors() );

            if ( !ReactorManager.FAIL_NEVER.equals( rm.getFailureBehavior() ) )
            {
                dispatcher.dispatchError( event, request.getBaseDirectory(), null );

                getLogger().info( "BUILD ERRORS" );
View Full Code Here

        {
            projects.add( getSuperProject( request ) );
            foundProjects = false;
        }

        ReactorManager rm;
        try
        {
            rm = new ReactorManager( projects );

            String requestFailureBehavior = request.getFailureBehavior();

            if ( requestFailureBehavior != null )
            {
                rm.setFailureBehavior( requestFailureBehavior );
            }
        }
        catch ( CycleDetectedException e )
        {
            throw new BuildFailureException(
                "The projects in the reactor contain a cyclic reference: " + e.getMessage(), e );
        }
        catch ( DuplicateProjectException e )
        {
            throw new BuildFailureException( e.getMessage(), e );
        }

        // --------------------------------------------------------------------------------
        // MNG-3641: print a warning if one of the profiles to be activated explicitly
        // was not activated

        validateActivatedProfiles( globalProfileManager, projects );

        if ( rm.hasMultipleProjects() )
        {
            getLogger().info( "Reactor build order: " );

            for ( Iterator i = rm.getSortedProjects().iterator(); i.hasNext(); )
            {
                MavenProject project = (MavenProject) i.next();
                getLogger().info( "  " + project.getName() );
            }
        }
View Full Code Here

    {
        PlexusContainer container = null;
        Settings settings = null;
        ArtifactRepository localRepo = null;
        EventDispatcher eventDispatcher = null;
        ReactorManager reactorManager = null;
        List goals = null;
        String executionRootDir = null;
        Date startTime = new Date();

        return new MavenSession( container, settings, localRepo, eventDispatcher, reactorManager, goals,
View Full Code Here

        MavenSession session = new MavenSession( container,
                                    null, //Settings settings,
                                    null, //ArtifactRepository localRepository,
                                    null, //EventDispatcher eventDispatcher,
                                    new ReactorManager(new ArrayList()),
                                    Arrays.asList( new String[] {"install"} ),
                                    project.getBasedir().toString(),
                                    new Properties(),
                                    Calendar.getInstance().getTime() );
View Full Code Here

        String event = MavenEvents.REACTOR_EXECUTION;

        dispatcher.dispatchStart( event, request.getBaseDirectory() );

        ReactorManager rm;
        try
        {
            rm = doExecute( request, dispatcher );
        }
        catch ( LifecycleExecutionException e )
        {
            dispatcher.dispatchError( event, request.getBaseDirectory(), e );

            logError( e, request.isShowErrors() );

            stats( request.getStartTime() );

            line();

            throw new MavenExecutionException( e.getMessage(), e );
        }
        catch ( BuildFailureException e )
        {
            dispatcher.dispatchError( event, request.getBaseDirectory(), e );

            logFailure( e, request.isShowErrors() );

            stats( request.getStartTime() );

            line();

            throw new MavenExecutionException( e.getMessage(), e );
        }
        catch ( Throwable t )
        {
            dispatcher.dispatchError( event, request.getBaseDirectory(), t );

            logFatal( t );

            stats( request.getStartTime() );

            line();

            throw new MavenExecutionException( "Error executing project within the reactor", t );
        }

        // Either the build was successful, or it was a fail_at_end/fail_never reactor build

        // TODO: should all the logging be left to the CLI?
        logReactorSummary( rm );

        if ( rm.hasBuildFailures() )
        {
            logErrors( rm, request.isShowErrors() );

            if ( !ReactorManager.FAIL_NEVER.equals( rm.getFailureBehavior() ) )
            {
                dispatcher.dispatchError( event, request.getBaseDirectory(), null );

                getLogger().info( "BUILD ERRORS" );
View Full Code Here

        {
            projects.add( getSuperProject( request ) );
            foundProjects = false;
        }

        ReactorManager rm;
        try
        {
            String resumeFrom = request.getResumeFrom();
           
            List projectList = request.getSelectedProjects();
           
            String makeBehavior = request.getMakeBehavior();
           
            rm = new ReactorManager( projects, projectList, resumeFrom, makeBehavior );

            rm.setFailureBehavior( request.getFailureBehavior() );
           
        }
        catch ( CycleDetectedException e )
        {
            throw new BuildFailureException(
                "The projects in the reactor contain a cyclic reference: " + e.getMessage(), e );
        }
        catch ( DuplicateProjectException e )
        {
            throw new BuildFailureException( e.getMessage(), e );
        }
        catch ( MissingProjectException e )
        {
            throw new BuildFailureException( e.getMessage(), e );
        }

        // --------------------------------------------------------------------------------
        // MNG-3641: print a warning if one of the profiles to be activated explicitly
        // was not activated

        validateActivatedProfiles( globalProfileManager, projects );

        if ( rm.hasMultipleProjects() )
        {
            getLogger().info( "Reactor build order: " );

            for ( Iterator i = rm.getSortedProjects().iterator(); i.hasNext(); )
            {
                MavenProject project = (MavenProject) i.next();
                getLogger().info( "  " + project.getName() );
            }
        }
View Full Code Here

    private static MavenSession createSession( PlexusContainer container, ArtifactRepository repo )
        throws CycleDetectedException, DuplicateProjectException
    {
        return new MavenSession( container, new Settings(), repo, new DefaultEventDispatcher(),
                                 new ReactorManager( Collections.EMPTY_LIST ), Collections.EMPTY_LIST, ".",
                                 new Properties(), new Date() );
    }
View Full Code Here

        String event = MavenEvents.REACTOR_EXECUTION;

        dispatcher.dispatchStart( event, request.getBaseDirectory() );

        ReactorManager rm;
        try
        {
            rm = doExecute( request, dispatcher );
        }
        catch ( LifecycleExecutionException e )
        {
            dispatcher.dispatchError( event, request.getBaseDirectory(), e );

            logError( e, request.isShowErrors() );

            stats( request.getStartTime() );

            line();

            throw new MavenExecutionException( e.getMessage(), e );
        }
        catch ( BuildFailureException e )
        {
            dispatcher.dispatchError( event, request.getBaseDirectory(), e );

            logFailure( e, request.isShowErrors() );

            stats( request.getStartTime() );

            line();

            throw new MavenExecutionException( e.getMessage(), e );
        }
        catch ( Throwable t )
        {
            dispatcher.dispatchError( event, request.getBaseDirectory(), t );

            logFatal( t );

            stats( request.getStartTime() );

            line();

            throw new MavenExecutionException( "Error executing project within the reactor", t );
        }

        // Either the build was successful, or it was a fail_at_end/fail_never reactor build

        // TODO: should all the logging be left to the CLI?
        logReactorSummary( rm );

        if ( rm.hasBuildFailures() )
        {
            logErrors( rm, request.isShowErrors() );

            if ( !ReactorManager.FAIL_NEVER.equals( rm.getFailureBehavior() ) )
            {
                dispatcher.dispatchError( event, request.getBaseDirectory(), null );

                getLogger().info( "BUILD ERRORS" );
View Full Code Here

TOP

Related Classes of org.apache.maven.execution.ReactorManager

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.