Package org.apache.maven.archiva.layer

Examples of org.apache.maven.archiva.layer.RepositoryQueryLayer


    private static final String ROLE_HINT = "dependency";

    public void processArtifact( Artifact artifact, Model model )
    {
        RepositoryQueryLayer queryLayer = layerFactory.createRepositoryQueryLayer( artifact.getRepository() );
        if ( !queryLayer.containsArtifact( artifact ) )
        {
            // TODO: is this even possible?
            addFailure( artifact, "missing-artifact", "Artifact does not exist in the repository" );
        }
View Full Code Here


     * @param repository the repository where the metadata was encountered
     * @param reporter   the ReportingDatabase to receive processing results
     */
    private void checkSnapshotMetadata( RepositoryMetadata metadata, ArtifactRepository repository )
    {
        RepositoryQueryLayer repositoryQueryLayer = repositoryQueryLayerFactory.createRepositoryQueryLayer( repository );

        Versioning versioning = metadata.getMetadata().getVersioning();
        if ( versioning != null )
        {
            Snapshot snapshot = versioning.getSnapshot();

            String version = StringUtils.replace( metadata.getBaseVersion(), Artifact.SNAPSHOT_VERSION, snapshot
                .getTimestamp()
                + "-" + snapshot.getBuildNumber() );
            Artifact artifact = artifactFactory.createProjectArtifact( metadata.getGroupId(), metadata.getArtifactId(),
                                                                       version );
            artifact.isSnapshot(); // trigger baseVersion correction

            if ( !repositoryQueryLayer.containsArtifact( artifact ) )
            {
                addFailure( metadata, "missing-snapshot-artifact-from-repository:" + version, "Snapshot artifact "
                    + version + " does not exist." );
            }
        }
View Full Code Here

     * @param repository the repository where the metadata was encountered
     * @param reporter   the ReportingDatabase to receive processing results
     */
    private void checkMetadataVersions( RepositoryMetadata metadata, ArtifactRepository repository )
    {
        RepositoryQueryLayer repositoryQueryLayer = repositoryQueryLayerFactory.createRepositoryQueryLayer( repository );

        Versioning versioning = metadata.getMetadata().getVersioning();
        if ( versioning != null )
        {
            for ( Iterator versions = versioning.getVersions().iterator(); versions.hasNext(); )
            {
                String version = (String) versions.next();

                Artifact artifact = artifactFactory.createProjectArtifact( metadata.getGroupId(), metadata
                    .getArtifactId(), version );

                if ( !repositoryQueryLayer.containsArtifact( artifact ) )
                {
                    addFailure( metadata, "missing-artifact-from-repository:" + version, "Artifact version " + version
                        + " is present in metadata but " + "missing in the repository." );
                }
            }
View Full Code Here

TOP

Related Classes of org.apache.maven.archiva.layer.RepositoryQueryLayer

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.