Package org.apache.maven.archiva.model

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


        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

    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

    /* .\ 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

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

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

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

        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

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

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

   
    private ArtifactDAO artifactDao;

    public ArchivaArtifact createArtifact( String groupId, String artifactId, String version )
    {
        ArchivaArtifact artifact = artifactDao.createArtifact( groupId, artifactId, version, "", "jar" );
        artifact.getModel().setLastModified( new Date() ); // mandatory field.
        artifact.getModel().setRepositoryId( "central" );
        return artifact;
    }
View Full Code Here

    }

    public void saveTestData()
        throws Exception
    {
        ArchivaArtifact artifact;

        // Setup artifacts in fresh DB.
        artifact = createArtifact( "commons-lang", "commons-lang", "2.0" );
        artifactDao.saveArtifact( artifact );
View Full Code Here

        ManagedRepositoryConfiguration repo = createRepository( "testRepo", "Test Repository", repoDir );
        assertNotNull( repo );

        ArtifactDAO adao = dao.getArtifactDAO();

        ArchivaArtifact sqlArtifact = adao.createArtifact( "javax.sql", "jdbc", "2.0", "", "jar" );
        sqlArtifact.getModel().setLastModified( new Date() );
        sqlArtifact.getModel().setSize( 1234 );
        sqlArtifact.getModel().setOrigin( "testcase" );
        sqlArtifact.getModel().setWhenProcessed( null );

        adao.saveArtifact( sqlArtifact );

        ArchivaArtifact artifact = adao.getArtifact( "javax.sql", "jdbc", "2.0", null, "jar" );

        assertNotNull( artifact );

        // Test for artifact existance.
        List artifactList = adao.queryArtifacts( null );
View Full Code Here

TOP

Related Classes of org.apache.maven.archiva.model.ArchivaArtifact

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.