Examples of ArchivaArtifact


Examples of org.apache.maven.archiva.model.ArchivaArtifact

    }

    public void testSearchByChecksum()
        throws Exception
    {
        ArchivaArtifact artifact;

        // Setup artifacts in fresh DB.
        artifact = createArtifact( "org.apache.maven.test", "test-one", "1.2" );
        artifact.getModel().setChecksumMD5( MD5_HASH1 );
        artifactDao.saveArtifact( artifact );

        artifact = createArtifact( "org.apache.maven.test.foo", "test-two", "1.0" );
        artifact.getModel().setChecksumSHA1( SHA1_HASH1 );
        artifactDao.saveArtifact( artifact );

        List results = dbSearch.searchArtifactsByChecksum( MD5_HASH1 );
        assertEquals( 1, results.size() );
View Full Code Here

Examples of org.apache.maven.archiva.model.ArchivaArtifact

        {
            for ( ArtifactReference reference : references )
            {  
                File artifactFile = repository.toFile( reference );
               
                ArchivaArtifact artifact =
                    new ArchivaArtifact( reference.getGroupId(), reference.getArtifactId(), reference.getVersion(),
                                         reference.getClassifier(), reference.getType(), repository.getId() );
   
                for ( RepositoryListener listener : listeners )
                {
                    listener.deleteArtifact( repository, artifact );
View Full Code Here

Examples of org.apache.maven.archiva.model.ArchivaArtifact

            VersionedReference versionRef = new VersionedReference();
            versionRef.setGroupId( artifactRef.getGroupId() );
            versionRef.setArtifactId( artifactRef.getArtifactId() );
           
            ArchivaArtifact artifact =
                new ArchivaArtifact( artifactRef.getGroupId(), artifactRef.getArtifactId(), artifactRef.getVersion(),
                                     artifactRef.getClassifier(), artifactRef.getType(), repository.getId() );
           
            for ( String version : snapshotVersions )
            {  
                if( releasedVersions.contains( VersionUtil.getReleaseVersion( version ) ) )
View Full Code Here

Examples of org.apache.maven.archiva.model.ArchivaArtifact

    protected void populateDb( String groupId, String artifactId, List<String> versions )
        throws ArchivaDatabaseException
    {
        for ( String version : versions )
        {
            ArchivaArtifact artifact = dao.createArtifact( groupId, artifactId, version, "", "jar" );
            assertNotNull( artifact );
            artifact.getModel().setLastModified( new Date() );
            artifact.getModel().setOrigin( "test" );
            ArchivaArtifact savedArtifact = dao.saveArtifact( artifact );
            assertNotNull( savedArtifact );

            //POM
            artifact = dao.createArtifact( groupId, artifactId, version, "", "pom" );
            assertNotNull( artifact );
View Full Code Here

Examples of org.apache.maven.archiva.model.ArchivaArtifact

        for ( ArtifactReference reference : references )
        {
            File artifactFile = repository.toFile( reference );

            ArchivaArtifact artifact =
                new ArchivaArtifact( reference.getGroupId(), reference.getArtifactId(), reference.getVersion(),
                                     reference.getClassifier(), reference.getType() );

            FileContentRecord fileContentRecord = new FileContentRecord();
            fileContentRecord.setFilename( repository.toPath( artifact ) );
            fileContentRecords.add( fileContentRecord );
View Full Code Here

Examples of org.apache.maven.archiva.model.ArchivaArtifact

    private void updateDatabase( String path )
        throws ArchivaDatabaseException, LayoutException
    {
        ArtifactReference artifact = repository.toArtifactReference( path );
        ArchivaArtifact queriedArtifact =
            artifactDao.getArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(),
                                     artifact.getClassifier(), artifact.getType() );

        artifactDao.deleteArtifact( queriedArtifact );
View Full Code Here

Examples of org.apache.maven.archiva.model.ArchivaArtifact

    /* .\ Archiva Artifact \. _____________________________________________________________ */

    public ArchivaArtifact createArtifact( String groupId, String artifactId, String version, String classifier,
                                           String type )
    {
        ArchivaArtifact artifact;

        try
        {
            artifact = getArtifact( groupId, artifactId, version, classifier, type );
        }
        catch ( ArchivaDatabaseException e )
        {
            artifact = new ArchivaArtifact( groupId, artifactId, version, classifier, type );
        }

        return artifact;
    }
View Full Code Here

Examples of org.apache.maven.archiva.model.ArchivaArtifact

        key.setClassifier( classifier );
        key.setType( type );

        ArchivaArtifactModel model = (ArchivaArtifactModel) jdo.getObjectById( ArchivaArtifactModel.class, key, null );

        return new ArchivaArtifact( model );
    }
View Full Code Here

Examples of org.apache.maven.archiva.model.ArchivaArtifact

        List ret = new ArrayList();
        Iterator it = results.iterator();
        while ( it.hasNext() )
        {
            ArchivaArtifactModel model = (ArchivaArtifactModel) it.next();
            ret.add( new ArchivaArtifact( model ) );
        }

        return ret;
    }
View Full Code Here

Examples of org.apache.maven.archiva.model.ArchivaArtifact

        if ( model == null )
        {
            return null;
        }

        return new ArchivaArtifact( model );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.