Package org.apache.maven.continuum.release

Examples of org.apache.maven.continuum.release.ContinuumReleaseManager


                throw new Exception( "There is no release on-going or finished with id: " + releaseId );
            }
        }
        else
        {
            ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();

            listenerSummary = releaseManager.getListener( releaseId );

            if ( listenerSummary != null )
            {
                if ( listenerSummary.getState() == ContinuumReleaseManagerListener.FINISHED )
                {
                    releaseManager.getListeners().remove( releaseId );

                    result = (ReleaseResult) releaseManager.getReleaseResults().get( releaseId );

                    status = "finished";
                }
                else
                {
View Full Code Here


                return RELEASE_ERROR;
            }
        }
        else
        {
            ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();

            ContinuumReleaseManagerListener listener = new DefaultReleaseManagerListener();

            listener.setUsername( getPrincipal() );

            Project project = getContinuum().getProject( projectId );

            releaseManager.rollback( releaseId, workingDirectoryService.getWorkingDirectory( project ).getPath(),
                                     listener );

            //recurse until rollback is finished
            while ( listener.getState() != ContinuumReleaseManagerListener.FINISHED )
            {
                try
                {
                    Thread.sleep( 1000 );
                }
                catch ( InterruptedException e )
                {
                    //do nothing
                }
            }

            AuditLog event = new AuditLog( "Release id=" + releaseId, AuditLogConstants.ROLLBACK_RELEASE );
            event.setCategory( AuditLogConstants.PROJECT );
            event.setCurrentUser( getPrincipal() );
            event.log();

            releaseManager.getPreparedReleases().remove( releaseId );
        }

        return SUCCESS;
    }
View Full Code Here

                return RELEASE_ERROR;
            }
        }
        else
        {
            ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();

            listenerSummary = releaseManager.getListener( releaseId );

            if ( listenerSummary != null )
            {
                username = listenerSummary.getUsername();

                if ( listenerSummary.getState() == ContinuumReleaseManagerListener.FINISHED )
                {
                    result = (ReleaseResult) releaseManager.getReleaseResults().get( releaseId );

                    return SUCCESS;
                }
                else
                {
View Full Code Here

                return RELEASE_ERROR;
            }
        }
        else
        {
            ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();

            releaseManager.getReleaseResults().remove( releaseId );

            ContinuumReleaseManagerListener listener =
                (ContinuumReleaseManagerListener) releaseManager.getListeners().remove( releaseId );

            if ( listener != null )
            {
                String goal = listener.getGoalName();
View Full Code Here

            preparedReleases = releaseManager.getPreparedReleases( project.getGroupId(), project.getArtifactId() );
        }
        else
        {
            ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();

            this.preparedReleases = releaseManager.getPreparedReleasesForProject( project.getGroupId(),
                                                                                  project.getArtifactId() );
        }

        if ( !preparedReleases.isEmpty() )
        {
View Full Code Here

                throw new Exception( "There is no on-going or finished release operation with id " + releaseId );
            }
        }
        else
        {
            ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();

            listenerSummary = releaseManager.getListener( releaseId );

            if ( listenerSummary != null )
            {
                username = listenerSummary.getUsername();
View Full Code Here

        {
            listener = new DefaultReleaseManagerListener();

            listener.setUsername( username );

            ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();

            //todo should be configurable
            File performDirectory = new File( getContinuum().getConfiguration().getWorkingDirectory(),
                                              "releases-" + System.currentTimeMillis() );
            performDirectory.mkdirs();

            releaseManager.perform( releaseId, performDirectory, goals, arguments, useReleaseProfile, listener,
                                    repository );
        }

        AuditLog event = new AuditLog( "ReleaseId=" + releaseId, AuditLogConstants.PERFORM_RELEASE );
        event.setCategory( AuditLogConstants.PROJECT );
View Full Code Here

            return SUCCESS;
        }
        else
        {
            ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();

            ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
            descriptor.setScmSourceUrl( scmUrl );
            descriptor.setScmUsername( scmUsername );
            descriptor.setScmPassword( scmPassword );
            descriptor.setScmReleaseLabel( scmTag );
            descriptor.setScmTagBase( scmTagBase );

            if ( profileId != -1 )
            {
                Profile profile = getContinuum().getProfileService().getProfile( profileId );
                descriptor.setEnvironments( getEnvironments( profile, null ) );
            }

            do
            {
                releaseId = String.valueOf( System.currentTimeMillis() );
            }
            while ( releaseManager.getPreparedReleases().containsKey( releaseId ) );

            releaseManager.getPreparedReleases().put( releaseId, descriptor );

            return execute();
        }
    }
View Full Code Here

                return ERROR;
            }
        }
        else
        {
            ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
   
            listener = (ContinuumReleaseManagerListener) releaseManager.getListeners().get( releaseId );
   
            if ( listener != null )
            {
                listenerSummary.setPhases( listener.getPhases() );
                listenerSummary.setCompletedPhases( listener.getCompletedPhases() );
                listenerSummary.setInProgress( listener.getInProgress() );
                listenerSummary.setError( listener.getError() );

                if ( listener.getState() == ContinuumReleaseManagerListener.FINISHED )
                {
                    result = (ReleaseResult) releaseManager.getReleaseResults().get( releaseId );
   
                    return SUCCESS;
                }
                else
                {
View Full Code Here

                throw new Exception( "There is no on-going or finished release operation with id " + releaseId );
            }
        }
        else
        {
            ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
   
            listener = (ContinuumReleaseManagerListener) releaseManager.getListeners().get( releaseId );
   
            if ( listener != null )
            {
                if ( listener.getState() == ContinuumReleaseManagerListener.LISTENING )
                {
                    status = "inProgress";
                }
                else if ( listener.getState() == ContinuumReleaseManagerListener.FINISHED )
                {
                    status = SUCCESS;
                }
                else
                {
                    status = "initialized";
                }

                listenerSummary.setPhases( listener.getPhases() );
                listenerSummary.setCompletedPhases( listener.getCompletedPhases() );
                listenerSummary.setInProgress( listener.getInProgress() );
                listenerSummary.setError( listener.getError() );
            }
            else
            {
                throw new Exception( "There is no on-going or finished release operation with id " + releaseId );
            }

            if ( status.equals( SUCCESS ) )
            {
                ReleaseResult result = (ReleaseResult) releaseManager.getReleaseResults().get( releaseId );

                if ( result != null && getContinuum().getContinuumReleaseResult( projectId, releaseGoal, result.getStartTime(), result.getEndTime() ) == null )
                {
                    ContinuumReleaseResult releaseResult = createContinuumReleaseResult( result );
                    getContinuum().addContinuumReleaseResult( releaseResult );
View Full Code Here

TOP

Related Classes of org.apache.maven.continuum.release.ContinuumReleaseManager

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.