Package org.apache.maven.continuum.model.project

Examples of org.apache.maven.continuum.model.project.Project


    }

    public ProjectScmRoot getProjectScmRootByProject( int projectId )
        throws ContinuumException
    {
        Project project = getProject( projectId );
        ProjectGroup group = getProjectGroupByProjectId( projectId );

        List<ProjectScmRoot> scmRoots = getProjectScmRootByProjectGroup( group.getId() );

        for ( ProjectScmRoot scmRoot : scmRoots )
        {
            if ( project.getScmUrl() != null && project.getScmUrl().startsWith( scmRoot.getScmRootAddress() ) )
            {
                return scmRoot;
            }
        }
        return null;
View Full Code Here


    {
        // ----------------------------------------------------------------------
        // Get parameters from the context
        // ----------------------------------------------------------------------
       
        Project project = ContinuumBuildAgentUtil.getProject( context );

        BuildDefinition buildDefinition = ContinuumBuildAgentUtil.getBuildDefinition( context );

        Map<String, String> environments = ContinuumBuildAgentUtil.getEnvironments( context );

        String localRepository = ContinuumBuildAgentUtil.getLocalRepository( context );

        int trigger = ContinuumBuildAgentUtil.getTrigger( context );
       
        String username = ContinuumBuildAgentUtil.getUsername( context );

        ContinuumAgentBuildExecutor buildExecutor = buildAgentBuildExecutorManager.getBuildExecutor( project.getExecutorId() );
       
        // ----------------------------------------------------------------------
        // Make the buildResult
        // ----------------------------------------------------------------------

        BuildResult buildResult = new BuildResult();

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

        buildResult.setState( ContinuumProjectState.BUILDING );

        buildResult.setTrigger( trigger );
       
        buildResult.setUsername( username );

        buildResult.setBuildDefinition( buildDefinition );

        buildResult.setScmResult( ContinuumBuildAgentUtil.getScmResult( context, null ) );

        context.put( ContinuumBuildAgentUtil.KEY_BUILD_RESULT, buildResult );

        try
        {
            File buildOutputFile = buildAgentConfigurationService.getBuildOutputFile( project.getId() );

            ContinuumAgentBuildExecutionResult result = buildExecutor.build( project, buildDefinition, buildOutputFile,
                                                                             environments, localRepository );

            buildResult.setState( result.getExitCode() == 0 ? ContinuumProjectState.OK : ContinuumProjectState.FAILED );
View Full Code Here

     */
    private List<NotifierSummary> gatherProjectNotifierSummaries( int projectId )
        throws ContinuumException
    {
        List<NotifierSummary> summaryList = new ArrayList<NotifierSummary>();
        Project project = getContinuum().getProjectWithAllDetails( projectId );

        for ( ProjectNotifier pn : (List<ProjectNotifier>) project.getNotifiers() )
        {
            NotifierSummary ns = generateProjectNotifierSummary( pn, project );
            summaryList.add( ns );
        }

View Full Code Here

            {
                Map<Integer, Integer> map = task.getProjectsBuildDefinitionsMap();
                for ( Integer projectId : map.keySet() )
                {
                    int buildDefinitionId = map.get( projectId );
                    Project project = projectDao.getProject( projectId );
                    BuildDefinition buildDef = buildDefinitionDao.getBuildDefinition( buildDefinitionId );
                    BuildResult latestBuildResult = buildResultDao.
                        getLatestBuildResultForBuildDefinition( projectId, buildDefinitionId );
                    if ( latestBuildResult == null ||
                        ( latestBuildResult.getStartTime() >= startTime && latestBuildResult.getEndTime() > 0 &&
View Full Code Here

                {
                    List<Project> projects = getContinuum().getProjectGroupWithProjects( projectGroupId ).getProjects();

                    if ( projects.size() > 0 )
                    {
                        Project project = projects.get( 0 );
                        executor = project.getExecutorId();
                    }
                }
            }

            if ( buildDefinitionId != 0 )
View Full Code Here

*/
public class BuildContextToProject
{
    public static Project getProject( BuildContext buildContext )
    {
        Project project = new Project();   

        project.setId( buildContext.getProjectId() );

        project.setName( buildContext.getProjectName() );

        project.setVersion( buildContext.getProjectVersion() );

        project.setScmUrl( buildContext.getScmUrl() );

        project.setScmUsername( buildContext.getScmUsername() );

        project.setScmPassword( buildContext.getScmPassword() );

        project.setScmTag( buildContext.getScmTag() );

        project.setExecutorId( buildContext.getExecutorId() );

        project.setState( buildContext.getProjectState() );

        project.setOldState( buildContext.getProjectState() );

        project.setBuildNumber( buildContext.getBuildNumber() );

        return project;
    }
View Full Code Here

    }

    public void sendMessage( String messageId, MessageContext context )
        throws NotificationException
    {
        Project project = context.getProject();

        List<ProjectNotifier> notifiers = context.getNotifiers();
        BuildDefinition buildDefinition = context.getBuildDefinition();
        BuildResult build = context.getBuildResult();
        ProjectScmRoot projectScmRoot = context.getProjectScmRoot();

        boolean isPrepareBuildComplete =
            messageId.equals( ContinuumNotificationDispatcher.MESSAGE_ID_PREPARE_BUILD_COMPLETE );

        if ( projectScmRoot == null && isPrepareBuildComplete )
        {
            return;
        }

        // ----------------------------------------------------------------------
        // If there wasn't any building done, don't notify
        // ----------------------------------------------------------------------

        if ( build == null && !isPrepareBuildComplete )
        {
            return;
        }

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

        List<String> recipients = new ArrayList<String>();
        for ( ProjectNotifier notifier : notifiers )
        {
            Map<String, String> configuration = notifier.getConfiguration();
            if ( configuration != null && StringUtils.isNotEmpty( configuration.get( ADDRESS_FIELD ) ) )
            {
                recipients.add( configuration.get( ADDRESS_FIELD ) );
            }
        }

        if ( recipients.size() == 0 )
        {
            log.info( "No Jabber recipients for '" + project.getName() + "'." );

            return;
        }

        // ----------------------------------------------------------------------
View Full Code Here

        ContinuumReleaseResult releaseResult = new ContinuumReleaseResult();
        releaseResult.setStartTime( result.getStartTime() );
        releaseResult.setEndTime( result.getEndTime() );
        releaseResult.setResultCode( result.getResultCode() );

        Project project = getContinuum().getProject( projectId );
        ProjectGroup projectGroup = project.getProjectGroup();
        releaseResult.setProjectGroup( projectGroup );
        releaseResult.setProject( project );
        releaseResult.setReleaseGoal( releaseGoal );
        releaseResult.setUsername( username );
View Full Code Here

        // project group should have default build definition defined
        if ( bd == null )
        {
            ProjectGroup projectGroup = projectGroupDao.getProjectGroupByProjectId( projectId );

            Project p = projectDao.getProject( projectId );

            List<BuildDefinition> bds = getDefaultBuildDefinitionsForProjectGroup( projectGroup.getId() );

            for ( BuildDefinition bdef : bds )
            {
                if ( p.getExecutorId().equals( bdef.getType() ) || ( StringUtils.isEmpty( bdef.getType() ) &&
                    ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR.equals( p.getExecutorId() ) ) )
                {
                    return bdef;
                }
            }
        }
View Full Code Here

            getReleasePluginParameters( distributedReleaseManager.getReleasePluginParameters( projectId, "pom.xml" ) );
        }
        else
        {
            Project project = getContinuum().getProject( projectId );
   
            String workingDirectory = getContinuum().getWorkingDirectory( project.getId() ).getPath();
   
            getReleasePluginParameters( workingDirectory, "pom.xml" );
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.continuum.model.project.Project

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.