Package org.apache.maven.archiva.model

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


                                              String artifactId, String version )
        throws ObjectNotFoundException, ArchivaDatabaseException
    {
        ArchivaArtifact pomArtifact = getArtifact( principle, observableRepositoryIds, groupId, artifactId, version );

        ArchivaProjectModel model;
        version = pomArtifact.getVersion();

        if ( !pomArtifact.getModel().isProcessed() )
        {
            // Process it.
View Full Code Here


    private ArchivaProjectModel getProjectModel( String groupId, String artifactId, String version )
        throws ArchivaDatabaseException
    {
        try
        {
            ArchivaProjectModel model = dao.getProjectModelDAO().getProjectModel( groupId, artifactId, version );

            if ( model == null )
            {
                throw new ObjectNotFoundException( "Unable to find project model for ["
                    + Keys.toKey( groupId, artifactId, version ) + "]" );
View Full Code Here

    }

    private File createPom( File targetPath, String filename )
        throws IOException, ProjectModelException
    {
        ArchivaProjectModel projectModel = new ArchivaProjectModel();
        projectModel.setGroupId( groupId );
        projectModel.setArtifactId( artifactId );
        projectModel.setVersion( version );
        projectModel.setPackaging( packaging );

        File pomFile = new File( targetPath, filename );
        pomWriter.write( projectModel, pomFile );

        return pomFile;
View Full Code Here

        {
            throw new ArchivaDatabaseException( "There are no observable repositories for the user " + principal );
        }

        ArchivaArtifact pomArtifact = getArtifact( principal, observableRepositoryIds, groupId, artifactId, version );
        ArchivaProjectModel model;

        if ( !pomArtifact.getModel().isProcessed() )
        {
            // Process it.
            dbUpdater.updateUnprocessed( pomArtifact );
        }

        model = getProjectModel( groupId, artifactId, pomArtifact.getVersion() );

        if ( model.getPackaging() == null || "".equals( model.getPackaging() ) )
        {
            model.setPackaging( pomArtifact.getType() );
        }

        return model;
    }
View Full Code Here

     * @throws ArchivaDatabaseException
     */
    private ArchivaProjectModel getProjectModel( String groupId, String artifactId, String version )
        throws ArchivaDatabaseException
    {
        ArchivaProjectModel model = null;

        try
        {
            model = dao.getProjectModelDAO().getProjectModel( groupId, artifactId, version );
        }
        catch ( ObjectNotFoundException e )
        {
            log.debug( "Unable to find project model for [" + Keys.toKey( groupId, artifactId, version ) + "]", e );
        }

        if ( model == null )
        {
            model = new ArchivaProjectModel();
            model.setGroupId( groupId );
            model.setArtifactId( artifactId );
            model.setVersion( version );
        }

        return model;
    }
View Full Code Here

    public void testViewArtifact()
        throws Exception
    {
        RepositoryBrowsing browser = lookupBrowser();
        ArchivaProjectModel artifact = browser.selectVersion( USER_GUEST, GUEST_REPO_IDS, "commons-lang", "commons-lang", "2.0" );
        assertNotNull( "Artifact should not be null.", artifact );
    assertEquals( "commons-lang", artifact.getGroupId() );
    assertEquals( "commons-lang", artifact.getArtifactId() );
    assertEquals( "2.0", artifact.getVersion() );   
    assertEquals( "jar", artifact.getPackaging() );
 
    // MRM-1278
    String repoId = browser.getRepositoryId( USER_GUEST, GUEST_REPO_IDS, "commons-lang", "commons-lang", "2.0" );
    assertEquals( "central", repoId );
    }   
View Full Code Here

   
    public void testViewArtifactWithMultipleTimestampedVersions()
        throws Exception
    {  
        RepositoryBrowsing browser = lookupBrowser();
        ArchivaProjectModel artifact = browser.selectVersion( USER_GUEST, GUEST_REPO_IDS, "org.apache.archiva", "archiva-indexer", "1.0-SNAPSHOT" );
        assertNotNull( "Artifact should not be null.", artifact );
        assertEquals( "org.apache.archiva", artifact.getGroupId() );
        assertEquals( "archiva-indexer", artifact.getArtifactId() );
        assertEquals( "1.0-20070522.143249-1", artifact.getVersion() );      
        assertEquals( "jar", artifact.getPackaging() );
       
        String repoId = browser.getRepositoryId( USER_GUEST, GUEST_REPO_IDS, "org.apache.archiva", "archiva-indexer", "1.0-SNAPSHOT" );
        assertEquals( "central", repoId );
    }
View Full Code Here

        artifactDaoMockControl.verify();
        projectDaoMockControl.verify();

        assertActionParameters( action );
        ArchivaProjectModel model = action.getModel();
        assertDefaultModel( model );

        assertEquals( TEST_REPO, action.getRepositoryId() );

        assertNull( action.getDependees() );
View Full Code Here

        projectDaoMockControl.verify();

        assertEquals( TEST_GROUP_ID, action.getGroupId() );
        assertEquals( TEST_ARTIFACT_ID, action.getArtifactId() );
        assertEquals( TEST_SNAPSHOT_VERSION, action.getVersion() );
        ArchivaProjectModel model = action.getModel();
        assertDefaultModel( model, TEST_SNAPSHOT_VERSION );

        assertEquals( TEST_REPO, action.getRepositoryId() );

        assertEquals( ALL_TEST_SNAPSHOT_VERSIONS, action.getSnapshotVersions() );
View Full Code Here

        projectDaoMockControl.verify();

        assertEquals( TEST_GROUP_ID, action.getGroupId() );
        assertEquals( TEST_ARTIFACT_ID, action.getArtifactId() );
        assertEquals( TEST_TS_SNAPSHOT_VERSION, action.getVersion() );
        ArchivaProjectModel model = action.getModel();
        assertDefaultModel( model, TEST_TS_SNAPSHOT_VERSION );

        assertEquals( TEST_REPO, action.getRepositoryId() );

        assertEquals( Arrays.asList( ALL_TEST_SNAPSHOT_VERSIONS.get( 1 ), ALL_TEST_SNAPSHOT_VERSIONS.get( 2 ) ),
View Full Code Here

TOP

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

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.