Package org.apache.archiva.metadata.repository

Examples of org.apache.archiva.metadata.repository.MetadataResolver


        RepositorySession repositorySession = repositorySessionFactory.createSession();
        Set<String> namespaces;
        try
        {
            MetadataResolver metadataResolver = repositorySession.getResolver();

            Set<String> namespacesToCollapse = new LinkedHashSet<>();
            for ( String repoId : selectedRepos )
            {
                namespacesToCollapse.addAll( metadataResolver.resolveNamespaces( repositorySession, repoId, groupId ) );

                projects.addAll( metadataResolver.resolveProjects( repositorySession, repoId, groupId ) );
            }

            // TODO: this logic should be optional, particularly remembering we want to keep this code simple
            // it is located here to avoid the content repository implementation needing to do too much for what
            // is essentially presentation code
View Full Code Here


    {
        RepositorySession repositorySession = repositorySessionFactory.createSession();
        try
        {
            MetadataResolver metadataResolver = repositorySession.getResolver();

            Set<String> versions = new LinkedHashSet<String>();

            for ( String repoId : selectedRepos )
            {
                Collection<String> projectVersions =
                    metadataResolver.resolveProjectVersions( repositorySession, repoId, groupId, artifactId );
                versions.addAll( projectVersions );
            }

            List<String> sortedVersions = new ArrayList<>( versions );
View Full Code Here

        RepositorySession repositorySession = null;
        try
        {
            repositorySession = repositorySessionFactory.createSession();

            MetadataResolver metadataResolver = repositorySession.getResolver();

            ProjectVersionMetadata versionMetadata = null;
            for ( String repoId : selectedRepos )
            {
                if ( versionMetadata == null || versionMetadata.isIncomplete() )
                {
                    try
                    {
                        versionMetadata =
                            metadataResolver.resolveProjectVersion( repositorySession, repoId, groupId, artifactId,
                                                                    version );
                    }
                    catch ( MetadataResolutionException e )
                    {
                        log.warn( "Skipping invalid metadata while compiling shared model for {}:{} in repo {}: {}",
View Full Code Here

            Collection<String> projectVersions = getVersions( selectedRepos, groupId, artifactId );

            repositorySession = repositorySessionFactory.createSession();

            MetadataResolver metadataResolver = repositorySession.getResolver();

            ProjectVersionMetadata sharedModel = new ProjectVersionMetadata();

            MavenProjectFacet mavenFacet = new MavenProjectFacet();
            mavenFacet.setGroupId( groupId );
            mavenFacet.setArtifactId( artifactId );
            sharedModel.addFacet( mavenFacet );

            boolean isFirstVersion = true;

            for ( String version : projectVersions )
            {
                ProjectVersionMetadata versionMetadata = null;
                for ( String repoId : selectedRepos )
                {
                    if ( versionMetadata == null || versionMetadata.isIncomplete() )
                    {
                        try
                        {
                            ProjectVersionMetadata projectVersionMetadataResolved = null;
                            boolean useCache = !StringUtils.endsWith( version, VersionUtil.SNAPSHOT );
                            String cacheKey = null;
                            boolean cacheToUpdate = false;
                            // FIXME a bit maven centric!!!
                            // not a snapshot so get it from cache
                            if ( useCache )
                            {
                                cacheKey = repoId + groupId + artifactId + version;
                                projectVersionMetadataResolved = versionMetadataCache.get( cacheKey );
                            }
                            if ( useCache && projectVersionMetadataResolved != null )
                            {
                                versionMetadata = projectVersionMetadataResolved;
                            }
                            else
                            {
                                projectVersionMetadataResolved =
                                    metadataResolver.resolveProjectVersion( repositorySession, repoId, groupId,
                                                                            artifactId, version );
                                versionMetadata = projectVersionMetadataResolved;
                                cacheToUpdate = true;
                            }
View Full Code Here

        List<ProjectVersionReference> references = new ArrayList<>();
        // TODO: what if we get duplicates across repositories?
        RepositorySession repositorySession = repositorySessionFactory.createSession();
        try
        {
            MetadataResolver metadataResolver = repositorySession.getResolver();
            for ( String repoId : getObservableRepos() )
            {
                // TODO: what about if we want to see this irrespective of version?
                references.addAll(
                    metadataResolver.resolveProjectReferences( repositorySession, repoId, groupId, artifactId,
                                                               version ) );
            }
        }
        catch ( MetadataResolutionException e )
        {
View Full Code Here

        List<Artifact> artifactDownloadInfos = new ArrayList<>();

        try (RepositorySession session = repositorySessionFactory.createSession())
        {
            MetadataResolver metadataResolver = session.getResolver();
            for ( String repoId : selectedRepos )
            {
                List<ArtifactMetadata> artifacts = new ArrayList<>(
                    metadataResolver.resolveArtifacts( session, repoId, groupId, artifactId, version ) );
                Collections.sort( artifacts, ArtifactMetadataVersionComparator.INSTANCE );
                if ( artifacts != null && !artifacts.isEmpty() )
                {
                    return buildArtifacts( artifacts, repoId );
                }
View Full Code Here

        //       is essentially presentation code
        Set<String> namespacesToCollapse;
        RepositorySession repositorySession = repositorySessionFactory.createSession();
        try
        {
            MetadataResolver metadataResolver = repositorySession.getResolver();
            namespacesToCollapse = new LinkedHashSet<String>();

            for ( String repoId : selectedRepos )
            {
                namespacesToCollapse.addAll( metadataResolver.resolveRootNamespaces( repositorySession, repoId ) );
            }
            for ( String n : namespacesToCollapse )
            {
                // TODO: check performance of this
                namespaces.add( collapseNamespaces( repositorySession, metadataResolver, selectedRepos, n ) );
View Full Code Here

        RepositorySession repositorySession = repositorySessionFactory.createSession();
        Set<String> namespaces;
        try
        {
            MetadataResolver metadataResolver = repositorySession.getResolver();

            Set<String> namespacesToCollapse = new LinkedHashSet<String>();
            for ( String repoId : selectedRepos )
            {
                namespacesToCollapse.addAll( metadataResolver.resolveNamespaces( repositorySession, repoId, groupId ) );

                projects.addAll( metadataResolver.resolveProjects( repositorySession, repoId, groupId ) );
            }

            // TODO: this logic should be optional, particularly remembering we want to keep this code simple
            // it is located here to avoid the content repository implementation needing to do too much for what
            // is essentially presentation code
View Full Code Here

    {
        RepositorySession repositorySession = repositorySessionFactory.createSession();
        try
        {
            MetadataResolver metadataResolver = repositorySession.getResolver();

            Set<String> versions = new LinkedHashSet<String>();

            for ( String repoId : selectedRepos )
            {
                Collection<String> projectVersions =
                    metadataResolver.resolveProjectVersions( repositorySession, repoId, groupId, artifactId );
                versions.addAll( projectVersions );
            }

            List<String> sortedVersions = new ArrayList<String>( versions );
View Full Code Here

        RepositorySession repositorySession = null;
        try
        {
            repositorySession = repositorySessionFactory.createSession();

            MetadataResolver metadataResolver = repositorySession.getResolver();

            ProjectVersionMetadata versionMetadata = null;
            for ( String repoId : selectedRepos )
            {
                if ( versionMetadata == null || versionMetadata.isIncomplete() )
                {
                    try
                    {
                        versionMetadata =
                            metadataResolver.resolveProjectVersion( repositorySession, repoId, groupId, artifactId,
                                                                    version );
                    }
                    catch ( MetadataResolutionException e )
                    {
                        log.warn(
View Full Code Here

TOP

Related Classes of org.apache.archiva.metadata.repository.MetadataResolver

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.