Package org.apache.maven.shared.release

Examples of org.apache.maven.shared.release.ReleaseResult


            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


    private PlexusContainer container;

    public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
        throws ReleaseExecutionException, ReleaseFailureException
    {
        ReleaseResult result = new ReleaseResult();

        try
        {
            reactorProjects.addAll( getReactorProjects( releaseDescriptor ) );
        }
        catch ( ContinuumReleaseException e )
        {
            throw new ReleaseExecutionException( "Unable to get reactor projects: " + e.getMessage(), e );
        }

        result.setResultCode( ReleaseResult.SUCCESS );

        return result;
    }
View Full Code Here

    public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, File workingDirectory,
                                  String additionalArguments )
        throws ReleaseExecutionException
    {
        ReleaseResult result = new ReleaseResult();
       
        try
        {
            String goals = getGoals( releaseDescriptor );
            if ( !StringUtils.isEmpty( goals ) )
            {
                Map<String, String> environments = null;
               
                if ( releaseDescriptor instanceof ContinuumReleaseDescriptor )
                {
                    environments = ( (ContinuumReleaseDescriptor) releaseDescriptor ).getEnvironments();
                }

                String executable = installationService.getExecutorConfigurator( InstallationService.MAVEN2_TYPE ).getExecutable();

                if ( environments != null )
                {
                    String m2Home = environments.get( installationService.getEnvVar( InstallationService.MAVEN2_TYPE ) );
                    if ( StringUtils.isNotEmpty( m2Home ) )
                    {
                        executable = m2Home + File.separator + "bin" + File.separator + executable;
                    }
                }

                shellCommandHelper.executeGoals( determineWorkingDirectory( workingDirectory,
                                                                            releaseDescriptor.getScmRelativePathProjectDirectory() ),
                                                 executable, goals, releaseDescriptor.isInteractive(), additionalArguments, result,
                                                 environments );
            }
        }
        catch ( Exception e )
        {
            throw new ReleaseExecutionException( e.getMessage(), e );
        }

        result.setResultCode( ReleaseResult.SUCCESS );

        return result;
    }
View Full Code Here

        assertTrue( "Test released version", pom.indexOf( "<version>2.0</version>" ) > 0 );

        performExec.executeTask(
            getPerformTask( "testRelease", descriptor, new File( getBasedir(), "target/test-classes/build-dir" ) ) );

        ReleaseResult result = (ReleaseResult) releaseManager.getReleaseResults().get( "testRelease" );
        if ( result.getResultCode() != ReleaseResult.SUCCESS )
        {
            fail( "Error in release:perform. Release output follows:\n" + result.getOutput() );
        }
    }
View Full Code Here

    private void doPrepareWithNoError( ReleaseDescriptor descriptor )
        throws TaskExecutionException
    {
        prepareExec.executeTask( getPrepareTask( "testRelease", descriptor ) );

        ReleaseResult result = (ReleaseResult) releaseManager.getReleaseResults().get( "testRelease" );
        if ( result.getResultCode() != ReleaseResult.SUCCESS )
        {
            fail( "Error in release:prepare. Release output follows:\n" + result.getOutput() );
        }
    }
View Full Code Here

            argList.add("-P" + profileId);
        }
       
        String additionalArgs = Joiner.on(" ").join(argList);
       
        ReleaseResult result = new ReleaseResult();
        ReleaseEnvironment env = new DefaultReleaseEnvironment();
        MavenExecutor mavenExecutor = mavenExecutors.get(env.getMavenExecutorId());
       
        String goal = "deploy";
       
View Full Code Here

    public Map<String, Object> getReleaseResult( String releaseId )
        throws ContinuumBuildAgentException
    {
        log.debug( "Getting release result of release {}", releaseId );
        ReleaseResult result = buildAgentReleaseManager.getReleaseResult( releaseId );

        Map<String, Object> map = new HashMap<String, Object>();
        map.put( ContinuumBuildAgentUtil.KEY_START_TIME, Long.toString( result.getStartTime() ) );
        map.put( ContinuumBuildAgentUtil.KEY_END_TIME, Long.toString( result.getEndTime() ) );
        map.put( ContinuumBuildAgentUtil.KEY_RELEASE_RESULT_CODE, result.getResultCode() );
        map.put( ContinuumBuildAgentUtil.KEY_RELEASE_OUTPUT, result.getOutput() );

        return map;
    }
View Full Code Here

        getProjectGroupDao().updateProjectGroup( defaultGroup );
        project = getProjectDao().getProjectByName( "test-project" );
        assertNotNull( project );
        assertEquals( 0, continuum.getAllContinuumReleaseResults().size() );

        ReleaseResult result = new ReleaseResult();
        result.setStartTime( System.currentTimeMillis() );
        result.setEndTime( System.currentTimeMillis() );
        result.setResultCode( 200 );
        result.appendOutput( "Error in release" );

        ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
        descriptor.setPreparationGoals( "clean" );
        descriptor.setReleaseBy( "admin" );
View Full Code Here

    }

    public ContinuumReleaseResult addContinuumReleaseResult( int projectId, String releaseId, String releaseType )
        throws ContinuumException
    {
        ReleaseResult result;
        String releaseBy = "";

        if ( getConfiguration().isDistributedBuildEnabled() )
        {
            try
            {
                result = (ReleaseResult) distributedReleaseManager.getReleaseResult( releaseId );
                PreparedRelease preparedRelease = distributedReleaseManager.getPreparedRelease( releaseId,
                                                                                                releaseType );
                if ( preparedRelease != null )
                {
                    releaseBy = preparedRelease.getReleaseBy();
                }
            }
            catch ( ContinuumReleaseException e )
            {
                throw new ContinuumException( "Failed to release project: " + projectId, e );
            }
            catch ( BuildAgentConfigurationException e )
            {
                throw new ContinuumException( "Failed to release project: " + projectId, e );
            }
        }
        else
        {
            result = (ReleaseResult) releaseManager.getReleaseResults().get( releaseId );
            ContinuumReleaseDescriptor descriptor =
                (ContinuumReleaseDescriptor) releaseManager.getPreparedReleases().get( releaseId );
            if ( descriptor != null )
            {
                releaseBy = descriptor.getReleaseBy();
            }
        }

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

    private ReleaseResult execute( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
                                   List<MavenProject> reactorProjects, boolean simulate )
        throws ReleaseExecutionException, ReleaseFailureException
    {
        ReleaseResult result = new ReleaseResult();

        if ( releaseDescriptor.isGenerateReleasePoms() )
        {
            logInfo( result, "Generating release POMs..." );

            generateReleasePoms( releaseDescriptor, releaseEnvironment, reactorProjects, simulate, result );
        }
        else
        {
            logInfo( result, "Not generating release POMs" );
        }

        result.setResultCode( ReleaseResult.SUCCESS );

        return result;
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.shared.release.ReleaseResult

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.