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

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


        catch ( AuthorizationRequiredException e )
        {
            return REQUIRES_AUTHORIZATION;
        }

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

        LocalRepository repository = project.getProjectGroup().getLocalRepository();
       
        String username = getPrincipal();

        if ( getContinuum().getConfiguration().isDistributedBuildEnabled() )
        {
View Full Code Here


    public String executeFromScm()
        throws Exception
    {
        if ( getContinuum().getConfiguration().isDistributedBuildEnabled() )
        {
            Project project = getContinuum().getProject( projectId );

            LocalRepository repository = project.getProjectGroup().getLocalRepository();

            DistributedReleaseManager releaseManager = getContinuum().getDistributedReleaseManager();
            Map<String, String> environments = new HashMap<String, String>();
           
            if ( profileId != -1 )
View Full Code Here

    }

    private void populateFromProject()
        throws Exception
    {
        Project project = getContinuum().getProjectWithAllDetails( projectId );

        scmUrl = project.getScmUrl();
        scmUsername = project.getScmUsername();
        scmPassword = project.getScmPassword();

        if ( scmUrl.startsWith( "scm:svn:" ) )
        {
            scmTagBase = new SvnScmProviderRepository( scmUrl, scmUsername, scmPassword ).getTagBase();
        }
View Full Code Here

    public String releasePrepare( Map<String, Object> projectMap, Map<String, Object> properties,
                                  Map<String, String> releaseVersion, Map<String, String> developmentVersion,
                                  Map<String, String> environments, String username )
        throws ContinuumReleaseException
    {
        Project project = getProject( projectMap );

        Properties releaseProperties = getReleaseProperties( properties );

        ContinuumReleaseManagerListener listener = new DefaultReleaseManagerListener();
       
        listener.setUsername( username );

        String workingDirectory = buildAgentConfigurationService.getWorkingDirectory( project.getId() ).getPath();

        String executable = buildAgentInstallationService.getExecutorConfigurator(
            BuildAgentInstallationService.MAVEN2_TYPE ).getExecutable();

        if ( environments != null )
View Full Code Here

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

    private Project getProject( Map<String, Object> context )
    {
        Project project = new Project();

        project.setId( ContinuumBuildAgentUtil.getProjectId( context ) );
        project.setGroupId( ContinuumBuildAgentUtil.getGroupId( context ) );
        project.setArtifactId( ContinuumBuildAgentUtil.getArtifactId( context ) );
        project.setScmUrl( ContinuumBuildAgentUtil.getScmUrl( context ) );

        ProjectGroup group = new ProjectGroup();

        String localRepo = ContinuumBuildAgentUtil.getLocalRepositoryName( context );
       
        if ( StringUtils.isBlank( localRepo ) )
        {
            group.setLocalRepository( null );
        }
        else
        {
            LocalRepository localRepository = new LocalRepository();
            List<org.apache.continuum.buildagent.model.LocalRepository> localRepos = buildAgentConfigurationService.getLocalRepositories();
            for( org.apache.continuum.buildagent.model.LocalRepository localRepoBA : localRepos )
            {
                if( localRepoBA.getName().equalsIgnoreCase( localRepo ) )
                {
                    localRepository.setLocation( localRepoBA.getLocation() );
                    group.setLocalRepository( localRepository );
                    break;
                }
            }
        }

        project.setProjectGroup( group );

        return project;
    }
View Full Code Here

    {
        Map<String, Object> actionContext = new HashMap<String, Object>();

        actionContext.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, buildContext.getProjectId() );

        Project project = BuildContextToProject.getProject( buildContext );
        ProjectGroup projectGroup = new ProjectGroup();
        projectGroup.setId( buildContext.getProjectGroupId() );
        projectGroup.setName( buildContext.getProjectGroupName() );
        project.setProjectGroup( projectGroup );

        actionContext.put( ContinuumBuildAgentUtil.KEY_PROJECT, project );
        actionContext.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION,
                           BuildContextToBuildDefinition.getBuildDefinition( buildContext ) );
        actionContext.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, buildContext.getBuildDefinitionId() );
View Full Code Here

                date = ContinuumBuildAgentUtil.getLatestUpdateDate( actionContext );
            }
        }
        else
        {
            Project project = ContinuumBuildAgentUtil.getProject( actionContext );

            actionContext.put( ContinuumBuildAgentUtil.KEY_WORKING_DIRECTORY,
                               buildAgentConfigurationService.getWorkingDirectory(
                                   project.getId() ).getAbsolutePath() );

            performAction( "checkout-agent-project", buildContext );

            scmResult = ContinuumBuildAgentUtil.getCheckoutScmResult( actionContext, null );
View Full Code Here

                addActionError( getText( "projectName.already.exist.error" ) );
                return INPUT;
            }
        }

        Project project = new Project();

        project.setName( projectNameTrim );

        if ( projectDescription != null )
        {
            project.setDescription( projectDescription.trim() );
        }

        project.setVersion( versionTrim );

        project.setScmUrl( scmTrim );

        project.setScmUsername( projectScmUsername );

        project.setScmPassword( projectScmPassword );

        project.setScmTag( projectScmTag );

        project.setScmUseCache( projectScmUseCache );

        project.setExecutorId( projectType );

        getContinuum().addProject( project, projectType, selectedProjectGroup, this.getBuildDefintionTemplateId() );

        if ( this.getSelectedProjectGroup() > 0 )
        {
            this.setProjectGroupId( this.getSelectedProjectGroup() );
            return "projectGroupSummary";
        }

        AuditLog event = new AuditLog( "Project id=" + project.getId(), AuditLogConstants.ADD_PROJECT );
        event.setCategory( AuditLogConstants.PROJECT );
        event.setCurrentUser( getPrincipal() );
        event.log();

        return SUCCESS;
View Full Code Here

    private List<BuildDefinitionSummary> gatherProjectBuildDefinitionSummaries( int projectId )
        throws ContinuumException
    {
        List<BuildDefinitionSummary> summaryList = new ArrayList<BuildDefinitionSummary>();

        Project project = getContinuum().getProjectWithAllDetails( projectId );
        for ( BuildDefinition bd : (List<BuildDefinition>) project.getBuildDefinitions() )
        {
            BuildDefinitionSummary bds = generateBuildDefinitionSummary( bd );
            bds.setFrom( "PROJECT" );
            bds.setProjectId( project.getId() );
            bds.setProjectName( project.getName() );

            summaryList.add( bds );
        }

        return summaryList;
View Full Code Here

    {
        PersistenceManager pm = getPersistenceManager();

        Transaction tx = pm.currentTransaction();

        Project project = build.getProject();
        try
        {
            tx.begin();

            if ( !JDOHelper.isDetached( build ) )
            {
                throw new ContinuumStoreException( "Not detached: " + build );
            }

            pm.makePersistent( build );

            if ( !JDOHelper.isDetached( project ) )
            {
                throw new ContinuumStoreException( "Not detached: " + project );
            }

            project.setState( build.getState() );

            //TODO: Use projectDao
            pm.makePersistent( project );

            tx.commit();
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.