Package org.apache.continuum.model.repository

Examples of org.apache.continuum.model.repository.LocalRepository


            String value = props.getProperty( name );
            arguments.append( "\"-D" ).append( name ).append( "=" ).append( value ).append( "\" " );
        }

        // append -Dmaven.repo.local if project group has a local repository
        LocalRepository repository = project.getProjectGroup().getLocalRepository();
        if ( repository != null )
        {
            arguments.append( "\"-Dmaven.repo.local=" ).append( StringUtils.clean( repository.getLocation() ) ).append(
                "\" " );
        }

        arguments.append( StringUtils.clean( buildDefinition.getGoals() ) );
View Full Code Here


    }

    private void setupDefaultRepository()
        throws Exception
    {
        repository = new LocalRepository();
        repository.setName( "DefaultRepo" );
        repository.setLocation( getTestFile( "target/default-repo" ).getAbsolutePath() );
        repository = repositoryService.addLocalRepository( repository );

        ProjectGroup group = getDefaultProjectGroup();
        group.setLocalRepository( repository );
        getProjectGroupDao().updateProjectGroup( group );

        RepositoryPurgeConfiguration repoConfig = new RepositoryPurgeConfiguration();
        repoConfig.setRepository( repository );
        repoConfig = repositoryPurgeConfigurationDao.addRepositoryPurgeConfiguration( repoConfig );

        List<LocalRepository> repositories = repositoryService.getAllLocalRepositories();
        assertEquals( "check # repositories", 1, repositories.size() );
        assertTrue( "check if repository was added", repositories.contains( repository ) );

        LocalRepository repo = repositoryService.getLocalRepositoryByName( "DefaultRepo" );
        assertNotNull( repo );
        assertEquals( "check if repository name is the same", repository.getName(), repo.getName() );

        repo = repositoryService.getLocalRepositoryByLocation( repository.getLocation() );
        assertNotNull( repo );
        assertEquals( "check if repository location is the same", repository.getLocation(), repo.getLocation() );

        ProjectGroup retrievedGroup = getDefaultProjectGroup();
        assertNotNull( retrievedGroup.getLocalRepository() );
        assertEquals( "check if repository is the same", repository, retrievedGroup.getLocalRepository() );
View Full Code Here

            String value = props.getProperty( name );
            arguments.append( "\"-D" ).append( name ).append( "=" ).append( value ).append( "\" " );
        }

        // append -Dmaven.repo.local if project group has a local repository
        LocalRepository repository = project.getProjectGroup().getLocalRepository();
        if ( repository != null )
        {
            arguments.append( "\"-Dmaven.repo.local=" ).append( StringUtils.clean( repository.getLocation() ) ).append(
                "\" " );
        }

        arguments.append( StringUtils.clean( buildDefinition.getGoals() ) );
View Full Code Here

                                                                                 workingDirectoryService.getWorkingDirectory(
                                                                                     project, projectScmRootUrl,
                                                                                     projectsWithCommonScmRoot ),
                                                                                 buildDefinition );

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

                builderHelper.setLocalRepository( repository );

                ArtifactRepository localRepository = builderHelper.getLocalRepository();
View Full Code Here

    }

    private void setupDefaultPurgeConfigurations()
        throws Exception
    {
        LocalRepository repository = new LocalRepository();
        repository.setName( "defaultRepo" );
        repository.setLocation( getTestFile( "target/default-repository" ).getAbsolutePath() );
        repository = localRepositoryDao.addLocalRepository( repository );

        repoPurge = new RepositoryPurgeConfiguration();
        repoPurge.setRepository( repository );
        repoPurge = repositoryPurgeConfigurationDao.addRepositoryPurgeConfiguration( repoPurge );
View Full Code Here

    public void purgeRepository( RepositoryPurgeConfiguration repoPurge )
        throws ContinuumPurgeManagerException
    {
        try
        {
            LocalRepository repository = repoPurge.getRepository();

            // do not purge if repository is in use and if repository is already in purge queue
            if ( !taskQueueManager.isRepositoryInUse( repository.getId() ) && !taskQueueManager.isInPurgeQueue(
                repoPurge.getId() ) )
            {
                taskQueueManager.getPurgeQueue().put( new PurgeTask( repoPurge.getId() ) );
            }
        }
View Full Code Here

    private TaskQueueManager taskQueueManager;

    public LocalRepository addLocalRepository( LocalRepository localRepository )
        throws RepositoryServiceException
    {
        LocalRepository repository = null;

        try
        {
            List<LocalRepository> repos = getAllLocalRepositories();
            for ( LocalRepository repo : repos )
            {
                if ( repo.getName().equals( localRepository.getName() ) )
                {
                    throw new RepositoryServiceException( "Local repository name must be unique" );
                }

                if ( repo.getLocation().equals( localRepository.getLocation() ) )
                {
                    throw new RepositoryServiceException( "Local repository location must be unique" );
                }
            }

            localRepository.setName( localRepository.getName().trim() );
            localRepository.setLocation( localRepository.getLocation().trim() );

            repository = localRepositoryDao.addLocalRepository( localRepository );

            log.info( "Added new local repository: " + repository.getName() );
        }
        catch ( ContinuumStoreException e )
        {
            throw new RepositoryServiceException( "Unable to add the requested local repository", e );
        }
View Full Code Here

    public void removeLocalRepository( int repositoryId )
        throws RepositoryServiceException
    {
        try
        {
            LocalRepository repository = getLocalRepository( repositoryId );

            if ( taskQueueManager.isRepositoryInUse( repositoryId ) )
            {
                return;
            }

            if ( taskQueueManager.isRepositoryInPurgeQueue( repositoryId ) )
            {
                taskQueueManager.removeRepositoryFromPurgeQueue( repositoryId );
            }

            log.info( "Remove purge configurations of " + repository.getName() );
            removePurgeConfigurationsOfRepository( repositoryId );

            List<ProjectGroup> groups = projectGroupDao.getProjectGroupByRepository( repositoryId );

            for ( ProjectGroup group : groups )
            {
                group.setLocalRepository( null );
                projectGroupDao.updateProjectGroup( group );
            }

            localRepositoryDao.removeLocalRepository( repository );

            log.info( "Removed local repository: " + repository.getName() );
        }
        catch ( TaskQueueManagerException e )
        {
            // swallow?
        }
View Full Code Here

        projectGroup.setDescription( StringEscapeUtils.escapeXml( StringEscapeUtils.unescapeXml( description ) ) );

        // [CONTINUUM-2228]. In select field can't select empty values.
        if ( repositoryId > 0 )
        {
            LocalRepository repository = getContinuum().getRepositoryService().getLocalRepository( repositoryId );
            projectGroup.setLocalRepository( repository );
        }

        getContinuum().updateProjectGroup( projectGroup );
View Full Code Here

        try
        {
            if ( repositoryId > 0 )
            {
                LocalRepository repository = getContinuum().getRepositoryService().getLocalRepository( repositoryId );
                projectGroup.setLocalRepository( repository );
            }
        }
        catch ( RepositoryServiceException e )
        {
View Full Code Here

TOP

Related Classes of org.apache.continuum.model.repository.LocalRepository

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.