Package org.apache.archiva.metadata.model.facets

Examples of org.apache.archiva.metadata.model.facets.RepositoryProblemFacet


                        String errMsg =
                            "Error in resolving artifact's parent POM file. " + ( problem.getException() == null
                                ? problem.getMessage()
                                : problem.getException().getMessage() );
                        RepositoryProblemFacet repoProblemFacet = new RepositoryProblemFacet();
                        repoProblemFacet.setRepositoryId( readMetadataRequest.getRepositoryId() );
                        repoProblemFacet.setId( readMetadataRequest.getRepositoryId() );
                        repoProblemFacet.setMessage( errMsg );
                        repoProblemFacet.setProblem( errMsg );
                        repoProblemFacet.setProject( readMetadataRequest.getProjectId() );
                        repoProblemFacet.setVersion( readMetadataRequest.getProjectVersion() );
                        repoProblemFacet.setNamespace( readMetadataRequest.getNamespace() );

                        metadata.addFacet( repoProblemFacet );

                        return metadata;
                    }
View Full Code Here


            MetadataRepository metadataRepository = repositorySession.getRepository();
            for ( String repoId : observableRepositories )
            {
                for ( String name : metadataRepository.getMetadataFacets( repoId, RepositoryProblemFacet.FACET_ID ) )
                {
                    RepositoryProblemFacet metadataFacet =
                        (RepositoryProblemFacet) metadataRepository.getMetadataFacet( repoId,
                                                                                      RepositoryProblemFacet.FACET_ID,
                                                                                      name );
                    if ( StringUtils.isEmpty( groupId ) || groupId.equals( metadataFacet.getNamespace() ) )
                    {
                        problemArtifacts.add( metadataFacet );
                    }
                }
            }
View Full Code Here

    implements MetadataFacetFactory
{
    @Override
    public MetadataFacet createMetadataFacet()
    {
        return new RepositoryProblemFacet();
    }
View Full Code Here

    }

    @Override
    public MetadataFacet createMetadataFacet( String repositoryId, String name )
    {
        return new RepositoryProblemFacet();
    }
View Full Code Here

    @Override
    public void addArtifactProblem( RepositorySession session, String repoId, String namespace, String projectId,
                                    String projectVersion, RepositoryStorageMetadataException exception )
    {
        RepositoryProblemFacet problem = new RepositoryProblemFacet();
        problem.setMessage( exception.getMessage() );
        problem.setProject( projectId );
        problem.setNamespace( namespace );
        problem.setRepositoryId( repoId );
        problem.setVersion( projectVersion );
        problem.setProblem( exception.getId() );

        try
        {
            session.getRepository().addMetadataFacet( repoId, problem );
            session.markDirty();
View Full Code Here

                    log.debug( "Not counting duplicate for artifact {} for path {}", dupArtifact, path );

                    continue;
                }

                RepositoryProblemFacet problem = new RepositoryProblemFacet();
                problem.setRepositoryId( repoId );
                problem.setNamespace( originalArtifact.getNamespace() );
                problem.setProject( originalArtifact.getProject() );
                problem.setVersion( originalArtifact.getVersion() );
                problem.setId( id );
                // FIXME: need to get the right storage resolver for the repository the dupe artifact is in, it might be
                //       a different type
                // FIXME: we need the project version here, not the artifact version
                problem.setMessage( "Duplicate Artifact Detected: " + path + " <--> " + pathTranslator.toPath(
                    dupArtifact.getNamespace(), dupArtifact.getProject(), dupArtifact.getVersion(),
                    dupArtifact.getId() ) );
                problem.setProblem( "duplicate-artifact" );

                try
                {
                    metadataRepository.addMetadataFacet( repoId, problem );
                }
View Full Code Here

        consumer.processFile( TEST_FILE );
        consumer.completeScan();

        ArgumentCaptor<RepositoryProblemFacet> argument = ArgumentCaptor.forClass( RepositoryProblemFacet.class );
        verify( metadataRepository ).addMetadataFacet( eq( TEST_REPO ), argument.capture() );
        RepositoryProblemFacet problem = argument.getValue();
        assertProblem( problem );
    }
View Full Code Here

        consumer.processFile( TEST_FILE );
        consumer.completeScan();

        ArgumentCaptor<RepositoryProblemFacet> argument = ArgumentCaptor.forClass( RepositoryProblemFacet.class );
        verify( metadataRepository ).addMetadataFacet( eq( TEST_REPO ), argument.capture() );
        RepositoryProblemFacet problem = argument.getValue();
        assertProblem( problem );
    }
View Full Code Here

TOP

Related Classes of org.apache.archiva.metadata.model.facets.RepositoryProblemFacet

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.