Package org.apache.archiva.configuration

Examples of org.apache.archiva.configuration.ManagedRepositoryConfiguration


            Artifact pomArtifact =
                factory.createProjectArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(),
                                               artifact.getScope() );

            ManagedRepositoryConfiguration repository = findArtifactInRepositories( repositoryIds, pomArtifact );

            Model project = null;
            if ( !Artifact.SCOPE_SYSTEM.equals( artifact.getScope() ) && repository != null )
            {
                File basedir = new File( repository.getLocation() );

                try
                {
                    project =
                        buildProject( new RepositoryModelResolver( basedir, pathTranslator ), artifact.getGroupId(),
View Full Code Here


        throws Exception
    {
        super.setUp();

        Configuration c = new Configuration();
        ManagedRepositoryConfiguration testRepo = new ManagedRepositoryConfiguration();
        testRepo.setId( TEST_REPO_ID );
        testRepo.setLocation( new File( "target/test-repository" ).getAbsolutePath() );
        c.addManagedRepository( testRepo );

        RemoteRepositoryConfiguration testRemoteRepo = new RemoteRepositoryConfiguration();
        testRemoteRepo.setId( TEST_REMOTE_REPO_ID );
        testRemoteRepo.setLayout( "default" );
View Full Code Here

    public ProjectVersionMetadata readProjectVersionMetadata( String repoId, String namespace, String projectId,
                                                              String projectVersion )
        throws RepositoryStorageMetadataNotFoundException, RepositoryStorageMetadataInvalidException
    {
        ManagedRepositoryConfiguration repositoryConfiguration =
            archivaConfiguration.getConfiguration().findManagedRepositoryById( repoId );

        String artifactVersion = projectVersion;

        File basedir = new File( repositoryConfiguration.getLocation() );
        if ( VersionUtil.isSnapshot( projectVersion ) )
        {
            File metadataFile =
                pathTranslator.toFile( basedir, namespace, projectId, projectVersion, METADATA_FILENAME );
            try
View Full Code Here

        return fileNames;
    }

    private File getRepositoryBasedir( String repoId )
    {
        ManagedRepositoryConfiguration repositoryConfiguration =
            archivaConfiguration.getConfiguration().findManagedRepositoryById( repoId );

        return new File( repositoryConfiguration.getLocation() );
    }
View Full Code Here

    {
        DependencyTreeResolutionListener listener =
            new DependencyTreeResolutionListener( new Slf4JPlexusLogger( getClass() ) );

        Artifact projectArtifact = factory.createProjectArtifact( groupId, artifactId, version );
        ManagedRepositoryConfiguration repository = findArtifactInRepositories( repositoryIds, projectArtifact );

        if ( repository == null )
        {
            // metadata could not be resolved
            return;
        }

        File basedir = new File( repository.getLocation() );

        try
        {
            // MRM-1411
            // TODO: this is a workaround for a lack of proxy capability in the resolvers - replace when it can all be
            //       handled there. It doesn't cache anything locally!
            List< RemoteRepositoryConfiguration > remoteRepositories = new ArrayList<RemoteRepositoryConfiguration>();
            Map<String, ProxyInfo > networkProxies = new HashMap<String, ProxyInfo>();

            Map<String, List< ProxyConnectorConfiguration >> proxyConnectorsMap = archivaConfiguration.getConfiguration().getProxyConnectorAsMap();
            List<ProxyConnectorConfiguration> proxyConnectors = proxyConnectorsMap.get( repository.getId() );
            if( proxyConnectors != null )
            {
                for( ProxyConnectorConfiguration proxyConnector : proxyConnectors )
                {
                    remoteRepositories.add( archivaConfiguration.getConfiguration().findRemoteRepositoryById( proxyConnector.getTargetRepoId() ) );
View Full Code Here

    private ManagedRepositoryConfiguration findArtifactInRepositories( List<String> repositoryIds, Artifact projectArtifact )
    {
        for ( String repoId : repositoryIds )
        {
            ManagedRepositoryConfiguration repositoryConfiguration =
                archivaConfiguration.getConfiguration().findManagedRepositoryById( repoId );

            File repoDir = new File( repositoryConfiguration.getLocation() );
            File file = pathTranslator.toFile( repoDir, projectArtifact.getGroupId(), projectArtifact.getArtifactId(),
                                               projectArtifact.getBaseVersion(),
                                               projectArtifact.getArtifactId() + "-" + projectArtifact.getVersion()
                                                   + ".pom" );
View Full Code Here

                int count = 0;
                for ( Iterator iter = value.getManagedRepositories().iterator(); iter.hasNext(); count++ )
                {
                    String name = "managedRepositories.managedRepository(" + count + ")";
                    ManagedRepositoryConfiguration o = ( ManagedRepositoryConfiguration ) iter.next();
                    writeManagedRepositoryConfiguration( prefix + name + ".", o, registry );
                }
            }
            if ( value.getRemoteRepositories() != null && value.getRemoteRepositories().size() > 0
)
View Full Code Here

        value.setRepositoryGroups( repositoryGroups );
        java.util.List managedRepositories = new java.util.ArrayList/*<ManagedRepositoryConfiguration>*/();
        List managedRepositoriesSubsets = registry.getSubsetList( prefix + "managedRepositories.managedRepository" );
        for ( Iterator i = managedRepositoriesSubsets.iterator(); i.hasNext(); )
        {
            ManagedRepositoryConfiguration v = readManagedRepositoryConfiguration( "", (Registry) i.next() );
            managedRepositories.add( v );
        }
        value.setManagedRepositories( managedRepositories );
        java.util.List remoteRepositories = new java.util.ArrayList/*<RemoteRepositoryConfiguration>*/();
        List remoteRepositoriesSubsets = registry.getSubsetList( prefix + "remoteRepositories.remoteRepository" );
View Full Code Here

        return value;
    }
   
    private ManagedRepositoryConfiguration readManagedRepositoryConfiguration( String prefix, Registry registry )
    {
        ManagedRepositoryConfiguration value = new ManagedRepositoryConfiguration();

        String location = registry.getString( prefix + "location", value.getLocation() );
        value.setLocation( location );
        boolean releases = registry.getBoolean( prefix + "releases", value.isReleases() );
        value.setReleases( releases );
        boolean blockRedeployments = registry.getBoolean( prefix + "blockRedeployments", value.isBlockRedeployments() );
        value.setBlockRedeployments( blockRedeployments );
        boolean snapshots = registry.getBoolean( prefix + "snapshots", value.isSnapshots() );
        value.setSnapshots( snapshots );
        boolean scanned = registry.getBoolean( prefix + "scanned", value.isScanned() );
        value.setScanned( scanned );
        String refreshCronExpression = registry.getString( prefix + "refreshCronExpression", value.getRefreshCronExpression() );
        value.setRefreshCronExpression( refreshCronExpression );
        int retentionCount = registry.getInt( prefix + "retentionCount", value.getRetentionCount() );
        value.setRetentionCount( retentionCount );
        int daysOlder = registry.getInt( prefix + "daysOlder", value.getDaysOlder() );
        value.setDaysOlder( daysOlder );
        boolean deleteReleasedSnapshots = registry.getBoolean( prefix + "deleteReleasedSnapshots", value.isDeleteReleasedSnapshots() );
        value.setDeleteReleasedSnapshots( deleteReleasedSnapshots );
        String id = registry.getString( prefix + "id", value.getId() );
        value.setId( id );
        String name = registry.getString( prefix + "name", value.getName() );
        value.setName( name );
        String layout = registry.getString( prefix + "layout", value.getLayout() );
        value.setLayout( layout );
        String indexDir = registry.getString( prefix + "indexDir", value.getIndexDir() );
        value.setIndexDir( indexDir );

        return value;
    }
View Full Code Here

        value.setRepositoryGroups( repositoryGroups );
        java.util.List managedRepositories = new java.util.ArrayList/*<ManagedRepositoryConfiguration>*/();
        List managedRepositoriesSubsets = registry.getSubsetList( prefix + "managedRepositories.managedRepository" );
        for ( Iterator i = managedRepositoriesSubsets.iterator(); i.hasNext(); )
        {
            ManagedRepositoryConfiguration v = readManagedRepositoryConfiguration( "", (Registry) i.next() );
            managedRepositories.add( v );
        }
        value.setManagedRepositories( managedRepositories );
        java.util.List remoteRepositories = new java.util.ArrayList/*<RemoteRepositoryConfiguration>*/();
        List remoteRepositoriesSubsets = registry.getSubsetList( prefix + "remoteRepositories.remoteRepository" );
View Full Code Here

TOP

Related Classes of org.apache.archiva.configuration.ManagedRepositoryConfiguration

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.