Package org.apache.archiva.web.xmlrpc.api.beans

Examples of org.apache.archiva.web.xmlrpc.api.beans.Artifact


                List<String> resultHitVersions = resultHit.getVersions();
                if ( resultHitVersions != null )
                {
                    for ( String version : resultHitVersions )
                    {
                        Artifact artifact = null;
                        for ( String repoId : observableRepos )
                        {
                            // slight behaviour change to previous implementation: instead of allocating "jar" when not
                            // found in the database, we can rely on the metadata repository to create it on the fly. We
                            // just allocate the default packaging if the Maven facet is not found.
                            FacetedMetadata model = metadataResolver.resolveProjectVersion( repositorySession, repoId,
                                                                                            resultHit.getGroupId(),
                                                                                            resultHit.getArtifactId(),
                                                                                            version );

                            if ( model != null )
                            {
                                String packaging = "jar";

                                MavenProjectFacet facet = (MavenProjectFacet) model.getFacet(
                                    MavenProjectFacet.FACET_ID );
                                if ( facet != null && facet.getPackaging() != null )
                                {
                                    packaging = facet.getPackaging();
                                }
                                artifact = new Artifact( repoId, resultHit.getGroupId(), resultHit.getArtifactId(),
                                                         version, packaging );
                                break;
                            }
                        }
View Full Code Here


                for ( ArtifactMetadata artifact : metadataRepository.getArtifactsByChecksum( repoId, checksum ) )
                {
                    // TODO: customise XMLRPC to handle non-Maven artifacts
                    MavenArtifactFacet facet = (MavenArtifactFacet) artifact.getFacet( MavenArtifactFacet.FACET_ID );

                    results.add( new Artifact( artifact.getRepositoryId(), artifact.getNamespace(),
                                               artifact.getProject(), artifact.getVersion(),
                                               facet != null ? facet.getType() : null ) );
                }
            }
        }
View Full Code Here

                Collection<String> results = metadataResolver.resolveProjectVersions( repositorySession, repoId,
                                                                                      groupId, artifactId );

                for ( final String version : results )
                {
                    final Artifact artifact = new Artifact( repoId, groupId, artifactId, version, "pom" );

                    artifacts.add( artifact );
                }
            }
        }
View Full Code Here

                                                                                                      repoId, groupId,
                                                                                                      artifactId,
                                                                                                      version );
                for ( ProjectVersionReference ref : refs )
                {
                    artifacts.add( new Artifact( repoId, ref.getNamespace(), ref.getProjectId(),
                                                 ref.getProjectVersion(), "" ) );
                }
            }
        }
        finally
View Full Code Here

        metadataRepositoryControl.verify();

        assertNotNull( artifacts );
        assertEquals( 1, artifacts.size() );

        Artifact artifact = artifacts.get( 0 );
        assertEquals( ARCHIVA_TEST_GROUP_ID, artifact.getGroupId() );
        assertEquals( "archiva-webapp", artifact.getArtifactId() );
        assertEquals( "1.0", artifact.getVersion() );
        assertEquals( "war", artifact.getType() );
        assertNotNull( "Repository should not be null!", artifact.getRepositoryId() );
        assertEquals( "repo1.mirror", artifact.getRepositoryId() );
    }
View Full Code Here

        metadataRepositoryControl.verify();

        assertNotNull( artifacts );
        assertEquals( 1, artifacts.size() );

        Artifact artifact = artifacts.get( 0 );
        assertEquals( ARCHIVA_TEST_GROUP_ID, artifact.getGroupId() );
        assertEquals( ARCHIVA_TEST_ARTIFACT_ID, artifact.getArtifactId() );
        assertEquals( "1.0", artifact.getVersion() );
        assertEquals( "jar", artifact.getType() );
        assertEquals( "public.releases", artifact.getRepositoryId() );
    }
View Full Code Here

        metadataResolverControl.verify();

        assertNotNull( artifacts );
        assertEquals( 1, artifacts.size() );

        Artifact artifact = artifacts.get( 0 );
        assertEquals( ARCHIVA_TEST_GROUP_ID, artifact.getGroupId() );
        assertEquals( ARCHIVA_TEST_ARTIFACT_ID, artifact.getArtifactId() );
        assertEquals( "1.0", artifact.getVersion() );
        assertEquals( "jar", artifact.getType() );
        assertNotNull( "Repository should not be null!", artifact.getRepositoryId() );
        assertEquals( "repo1.mirror", artifact.getRepositoryId() );
    }
View Full Code Here

        metadataRepositoryControl.verify();
        userReposControl.verify();

        assertNotNull( results );
        assertEquals( 1, results.size() );
        Artifact result = results.get( 0 );
        assertEquals( ARCHIVA_TEST_GROUP_ID, result.getGroupId() );
        assertEquals( ARCHIVA_TEST_ARTIFACT_ID, result.getArtifactId() );
        assertEquals( "1.0", result.getVersion() );
        assertEquals( "jar", result.getType() );
        assertEquals( TEST_REPO, result.getRepositoryId() );
    }
View Full Code Here

        userReposControl.verify();
        metadataResolverControl.verify();

        assertNotNull( artifacts );
        assertEquals( 6, artifacts.size() );
        assertEquals( new Artifact( "repo1.mirror", ARCHIVA_TEST_GROUP_ID, ARCHIVA_TEST_ARTIFACT_ID, "1.0", "pom" ),
                      artifacts.get( 0 ) );
        assertEquals(
            new Artifact( "public.releases", ARCHIVA_TEST_GROUP_ID, ARCHIVA_TEST_ARTIFACT_ID, "1.1-beta-1", "pom" ),
            artifacts.get( 3 ) );
        assertEquals(
            new Artifact( "repo1.mirror", ARCHIVA_TEST_GROUP_ID, ARCHIVA_TEST_ARTIFACT_ID, "1.1-beta-2", "pom" ),
            artifacts.get( 1 ) );
        assertEquals( new Artifact( "public.releases", ARCHIVA_TEST_GROUP_ID, ARCHIVA_TEST_ARTIFACT_ID, "1.1", "pom" ),
                      artifacts.get( 4 ) );
        assertEquals( new Artifact( "repo1.mirror", ARCHIVA_TEST_GROUP_ID, ARCHIVA_TEST_ARTIFACT_ID, "1.2", "pom" ),
                      artifacts.get( 2 ) );
        assertEquals(
            new Artifact( "public.releases", ARCHIVA_TEST_GROUP_ID, ARCHIVA_TEST_ARTIFACT_ID, "1.2.1-SNAPSHOT", "pom" ),
            artifacts.get( 5 ) );
    }
View Full Code Here

        metadataResolverControl.verify();
        userReposControl.verify();

        assertNotNull( dependees );
        assertEquals( 2, dependees.size() );
        assertEquals( new Artifact( repoId, ARCHIVA_TEST_GROUP_ID, "archiva-dependee-one", "1.0", "" ),
                      dependees.get( 0 ) );
        assertEquals( new Artifact( repoId, ARCHIVA_TEST_GROUP_ID, "archiva-dependee-two", "1.0", "" ),
                      dependees.get( 1 ) );
    }
View Full Code Here

TOP

Related Classes of org.apache.archiva.web.xmlrpc.api.beans.Artifact

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.