Package org.apache.maven.continuum.execution

Examples of org.apache.maven.continuum.execution.ContinuumBuildExecutor


    // ----------------------------------------------------------------------

    public ContinuumBuildExecutor getBuildExecutor( String builderType )
        throws ContinuumException
    {
        ContinuumBuildExecutor executor = executors.get( builderType );

        if ( executor == null )
        {
            throw new ContinuumException( "No such executor: '" + builderType + "'." );
        }
View Full Code Here


                    project.getState() != ContinuumProjectState.CHECKEDOUT &&
                    project.getState() != ContinuumProjectState.OK &&
                    project.getState() != ContinuumProjectState.FAILED &&
                    project.getState() != ContinuumProjectState.ERROR )
                {
                    ContinuumBuildExecutor executor = executorManager.getBuildExecutor( project.getExecutorId() );

                    if ( executor.isBuilding( project ) || project.getState() == ContinuumProjectState.UPDATING )
                    {
                        // project is building
                        getLogger().info( "Project '" + project.getName() + "' already being built." );

                        continue;
View Full Code Here

        ScmResult scmResult = getScmResult( context );

        List<ProjectDependency> updatedDependencies = getUpdatedDependencies( context );

        ContinuumBuildExecutor buildExecutor = buildExecutorManager.getBuildExecutor( project.getExecutorId() );

        // ----------------------------------------------------------------------
        // Make the buildResult
        // ----------------------------------------------------------------------

        BuildResult buildResult = new BuildResult();

        buildResult.setStartTime( new Date().getTime() );

        buildResult.setState( ContinuumProjectState.BUILDING );

        buildResult.setTrigger( buildTrigger.getTrigger() );
       
        buildResult.setUsername( buildTrigger.getUsername() );

        buildResult.setScmResult( scmResult );

        buildResult.setModifiedDependencies( updatedDependencies );

        buildResult.setBuildDefinition( getBuildDefinition( context ) );

        buildResultDao.addBuildResult( project, buildResult );

        AbstractContinuumAction.setBuildId( context, Integer.toString( buildResult.getId() ) );

        setCancelled( context, false );

        buildResult = buildResultDao.getBuildResult( buildResult.getId() );

        try
        {
            notifier.runningGoals( project, buildDefinition, buildResult );

            File buildOutputFile = configurationService.getBuildOutputFile( buildResult.getId(), project.getId() );

            ContinuumBuildExecutionResult result = buildExecutor.build( project, buildDefinition, buildOutputFile );

            buildResult.setState( result.getExitCode() == 0 ? ContinuumProjectState.OK : ContinuumProjectState.FAILED );

            buildResult.setExitCode( result.getExitCode() );
        }
        catch ( ContinuumBuildCancelledException e )
        {
            getLogger().info( "Cancelled build" );

            buildResult.setState( ContinuumProjectState.CANCELLED );

            setCancelled( context, true );
        }
        catch ( Throwable e )
        {
            getLogger().error( "Error running buildResult", e );

            buildResult.setState( ContinuumProjectState.ERROR );

            buildResult.setError( ContinuumUtils.throwableToString( e ) );
        }
        finally
        {
            project = projectDao.getProject( project.getId() );

            if ( buildResult.getState() == ContinuumProjectState.CANCELLED )
            {
                project.setState( project.getOldState() );

                project.setOldState( 0 );

                int buildResultId = getOldBuildId( context );

                project.setLatestBuildId( buildResultId );

                buildResultDao.removeBuildResult( buildResult );
            }
            else
            {
                buildResult.setEndTime( new Date().getTime() );

                if ( buildResult.getState() == ContinuumProjectState.OK )
                {
                    project.setBuildNumber( project.getBuildNumber() + 1 );
                }

                project.setLatestBuildId( buildResult.getId() );

                buildResult.setBuildNumber( project.getBuildNumber() );

                if ( buildResult.getState() != ContinuumProjectState.OK &&
                    buildResult.getState() != ContinuumProjectState.FAILED &&
                    buildResult.getState() != ContinuumProjectState.ERROR )
                {
                    buildResult.setState( ContinuumProjectState.ERROR );
                }

                project.setState( buildResult.getState() );

                // ----------------------------------------------------------------------
                // Copy over the buildResult result
                // ----------------------------------------------------------------------

                buildResultDao.updateBuildResult( buildResult );

                buildResult = buildResultDao.getBuildResult( buildResult.getId() );

                notifier.goalsCompleted( project, buildDefinition, buildResult );
            }

            AbstractContinuumAction.setProject( context, project );

            projectDao.updateProject( project );

            // ----------------------------------------------------------------------
            // Backup test result files
            // ----------------------------------------------------------------------
            //TODO: Move as a plugin
            buildExecutor.backupTestFiles( project, buildResult.getId() );
        }
    }
View Full Code Here

    // ----------------------------------------------------------------------

    protected ContinuumBuildExecutor getBuildExecutor( String id )
        throws Exception
    {
        ContinuumBuildExecutor buildExecutor = (ContinuumBuildExecutor) lookup( ContinuumBuildExecutor.ROLE, id );

        assertNotNull( "Could not look up build executor '" + id + "'", buildExecutor );

        return buildExecutor;
    }
View Full Code Here

        if ( !shouldBuild && ( ( !allChangesUnknown && context.getScmResult() != null && !context.getScmResult().getChanges().isEmpty() ) ||
            project.getExecutorId().equals( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR ) ) )
        {
            try
            {
                ContinuumBuildExecutor executor = buildExecutorManager.getBuildExecutor( project.getExecutorId() );

                if ( executor == null )
                {
                    log.warn( "No continuum build executor found for project " + project.getId() +
                              " with executor '" + project.getExecutorId() + "'" );
                }
                else if ( context.getScmResult() != null )
                {
                    shouldBuild = executor.shouldBuild( context.getScmResult().getChanges(), project,
                                                        workingDirectoryService.getWorkingDirectory( project ),
                                                        context.getBuildDefinition() );
                }
            }
            catch ( Exception e )
View Full Code Here

        // ----------------------------------------------------------------------
        // Make a new descriptor
        // ----------------------------------------------------------------------

        ContinuumBuildExecutor builder = buildExecutorManager.getBuildExecutor( project.getExecutorId() );

        ScmResult scmResult = (ScmResult) context.get( "scmResult" );
        builder.updateProjectFromCheckOut( workingDirectoryService.getWorkingDirectory( project ), project,
                                           buildDefinition, scmResult );

        // ----------------------------------------------------------------------
        // Store the new descriptor
        // ----------------------------------------------------------------------
View Full Code Here

        if ( deploymentRepositoryDirectory != null )
        {

            Project project = getProject( context );

            ContinuumBuildExecutor buildExecutor = buildExecutorManager.getBuildExecutor( project.getExecutorId() );

            // ----------------------------------------------------------------------
            // This is really a precondition for this action to execute
            // ----------------------------------------------------------------------

            if ( project.getState() == ContinuumProjectState.OK )
            {
                BuildDefinition buildDefinition = getBuildDefinition( context );

                List<Artifact> artifacts = buildExecutor.getDeployableArtifacts( project,
                                                                                 workingDirectoryService.getWorkingDirectory(
                                                                                     project ), buildDefinition );

                LocalRepository repository = project.getProjectGroup().getLocalRepository();
View Full Code Here

        // ----------------------------------------------------------------------
        // Make a new descriptor
        // ----------------------------------------------------------------------

        ContinuumBuildExecutor builder = buildExecutorManager.getBuildExecutor( project.getExecutorId() );

        builder.updateProjectFromCheckOut( workingDirectoryService.getWorkingDirectory( project ), project,
                                           buildDefinition );

        // ----------------------------------------------------------------------
        // Store the new descriptor
        // ----------------------------------------------------------------------
View Full Code Here

        if ( deploymentRepositoryDirectory != null )
        {

            Project project = getProject( context );

            ContinuumBuildExecutor buildExecutor = buildExecutorManager.getBuildExecutor( project.getExecutorId() );

            // ----------------------------------------------------------------------
            // This is really a precondition for this action to execute
            // ----------------------------------------------------------------------

            if ( project.getState() == ContinuumProjectState.OK )
            {
                BuildDefinition buildDefinition = getBuildDefinition( context );

                List<Artifact> artifacts = buildExecutor.getDeployableArtifacts( project,
                                                                       workingDirectoryService.getWorkingDirectory(
                                                                           project ), buildDefinition );

                LocalRepository repository = project.getProjectGroup().getLocalRepository();
               
View Full Code Here

        if ( !shouldBuild && ( ( !allChangesUnknown && !context.getScmResult().getChanges().isEmpty() ) ||
            project.getExecutorId().equals( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR ) ) )
        {
            try
            {
                ContinuumBuildExecutor executor = buildExecutorManager.getBuildExecutor( project.getExecutorId() );
                shouldBuild = executor.shouldBuild( context.getScmResult().getChanges(), project,
                                                    workingDirectoryService.getWorkingDirectory( project ),
                                                    context.getBuildDefinition() );
            }
            catch ( Exception e )
            {
View Full Code Here

TOP

Related Classes of org.apache.maven.continuum.execution.ContinuumBuildExecutor

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.