Package org.apache.continuum.model.repository

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


    }

    private void createDefaultLocalRepository()
        throws ContinuumStoreException, ContinuumInitializationException
    {
        LocalRepository repository;

        repository = localRepositoryDao.getLocalRepositoryByName( "DEFAULT" );

        Settings settings = getSettings();

        if ( repository == null )
        {
            log.info( "create Default Local Repository" );

            repository = new LocalRepository();

            repository.setName( "DEFAULT" );

            repository.setLocation( settings.getLocalRepository() );

            repository = localRepositoryDao.addLocalRepository( repository );

            createDefaultPurgeConfiguration( repository );
        }
        else if ( !repository.getLocation().equals( settings.getLocalRepository() ) )
        {
            log.info( "updating location of Default Local Repository" );

            repository.setLocation( settings.getLocalRepository() );

            localRepositoryDao.updateLocalRepository( repository );
        }
    }
View Full Code Here


        throws Exception
    {
        Continuum continuum = getContinuum();
        RepositoryService service = (RepositoryService) lookup( RepositoryService.ROLE );

        LocalRepository repository = new LocalRepository();
        repository.setName( "defaultRepo" );
        repository.setLocation( getTestFile( "target/default-repository" ).getAbsolutePath() );
        repository = service.addLocalRepository( repository );

        ProjectGroup group = new ProjectGroup();
        group.setGroupId( "testGroup" );
        group.setName( "testGroup" );
        group.setLocalRepository( repository );
        continuum.addProjectGroup( group );

        ProjectGroup retrievedDefaultProjectGroup = continuum.getProjectGroupByGroupId( "testGroup" );
        assertNotNull( retrievedDefaultProjectGroup.getLocalRepository() );

        continuum.removeProjectGroup( retrievedDefaultProjectGroup.getId() );

        try
        {
            continuum.getProjectGroupByGroupId( "testGroup" );
            fail( "project group was not deleted" );
        }
        catch ( Exception e )
        {
            // should fail. do nothing.
        }

        LocalRepository retrievedRepository = service.getLocalRepository( repository.getId() );
        assertNotNull( retrievedRepository );
        assertEquals( repository, retrievedRepository );
    }
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

            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() ) );
       
        Map<String, String> environments = getEnvironments( buildDefinition );
View Full Code Here

        // Local Repository
        // ----------------------------------------------------------------------

        try
        {
            LocalRepository repository = localRepositoryDao.getLocalRepositoryByName( "DEFAULT" );

            projectGroup.setLocalRepository( repository );
        }
        catch ( ContinuumStoreException e )
        {
View Full Code Here

    public RepositoryManagedContent getManagedRepositoryContent( int repositoryId )
        throws PurgeConfigurationServiceException
    {
        try
        {
            LocalRepository repository = localRepositoryDao.getLocalRepository( repositoryId );

            RepositoryManagedContent repoContent;

            repoContent =
                (RepositoryManagedContent) container.lookup( RepositoryManagedContent.class, repository.getLayout() );
            repoContent.setRepository( repository );

            return repoContent;
        }
        catch ( ContinuumObjectNotFoundException e )
View Full Code Here

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

                List<Artifact> artifacts = buildExecutor.getDeployableArtifacts( project,
                                                                                 workingDirectoryService.getWorkingDirectory(
                                                                                     project ), buildDefinition );

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

                builderHelper.setLocalRepository( repository );

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

        if ( BooleanUtils.toBoolean( useEditMode ) )
        {
            descriptor.setScmUseEditMode( Boolean.valueOf( useEditMode ) );
        }

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

        if ( repository != null )
        {
            String args = descriptor.getAdditionalArguments();

            if ( StringUtils.isNotEmpty( args ) )
            {
                descriptor.setAdditionalArguments( args +
                                                   " \"-Dmaven.repo.local=" + repository.getLocation() + "\"" );
            }
            else
            {
                descriptor.setAdditionalArguments( "\"-Dmaven.repo.local=" + repository.getLocation() + "\"" );
            }
        }

        //other properties
        if ( releaseProperties.containsKey( "username" ) )
View Full Code Here

                {
                    context.put( ContinuumBuildConstant.KEY_LATEST_UPDATE_DATE, new Date(
                        buildResult.getLastChangedDate() ) );
                }

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

                if ( localRepo != null )
                {
                    // CONTINUUM-2391
                    context.put( ContinuumBuildConstant.KEY_LOCAL_REPOSITORY, localRepo.getName() );
                }
                else
                {
                    context.put( ContinuumBuildConstant.KEY_LOCAL_REPOSITORY, "" );
                }
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.