Package org.apache.maven.archiva.model

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


            ArtifactReference artifact = repository.toArtifactReference( path );

            if ( VersionUtil.isSnapshot( artifact.getVersion() ) )
            {
                VersionedReference reference = new VersionedReference();
                reference.setGroupId( artifact.getGroupId() );
                reference.setArtifactId( artifact.getArtifactId() );
                reference.setVersion( artifact.getVersion() );

                List<String> versions = new ArrayList<String>( repository.getVersions( reference ) );

                Collections.sort( versions, VersionComparator.getInstance() );
View Full Code Here


    protected VersionedReference toVersionedReference( String id )
    {
        String parts[] = StringUtils.splitPreserveAllTokens( id, ':' );
        assertEquals( "Should have 3 parts [" + id + "]", 3, parts.length );
   
        VersionedReference ref = new VersionedReference();
        ref.setGroupId( parts[0] );
        ref.setArtifactId( parts[1] );
        ref.setVersion( parts[2] );
   
        assertTrue( "Group ID should not be blank [" + id + "]", StringUtils.isNotBlank( ref.getGroupId() ) );
        assertTrue( "Artifact ID should not be blank [" + id + "]", StringUtils.isNotBlank( ref.getArtifactId() ) );
        assertTrue( "Version should not be blank [" + id + "]", StringUtils.isNotBlank( ref.getVersion() ) );
   
        return ref;
    }
View Full Code Here

    private DependencyGraph fetchGraph( String groupId, String artifactId, String modelVersion )
        throws ArchivaException
    {
        // TODO Cache the results to disk, in XML format, in the same place as the artifact is located.

        VersionedReference projectRef = new VersionedReference();
        projectRef.setGroupId( groupId );
        projectRef.setArtifactId( artifactId );
        projectRef.setVersion( modelVersion );

        try
        {
            DependencyGraph depGraph = graphFactory.getGraph( projectRef );
View Full Code Here

    }

    private void assertVersions( String groupId, String artifactId, String version, String[] expectedVersions )
        throws Exception
    {
        VersionedReference reference = new VersionedReference();
        reference.setGroupId( groupId );
        reference.setArtifactId( artifactId );
        reference.setVersion( version );

        // Request the versions.
        Set<String> testedVersionSet = repoContent.getVersions( reference );

        // Sort the list (for asserts later)
View Full Code Here

            ArtifactReference artifact = repository.toArtifactReference( path );

            if ( VersionUtil.isSnapshot( artifact.getVersion() ) )
            {
                VersionedReference reference = new VersionedReference();
                reference.setGroupId( artifact.getGroupId() );
                reference.setArtifactId( artifact.getArtifactId() );
                reference.setVersion( artifact.getVersion() );

                List<String> versions = new ArrayList<String>( repository.getVersions( reference ) );

                Collections.sort( versions, VersionComparator.getInstance() );
View Full Code Here

    protected VersionedReference toVersionedReference( String key )
    {
        String parts[] = StringUtils.splitPreserveAllTokens( key, ':' );
        assertEquals( "Versioned Reference [" + key + "] part count.", 3, parts.length );

        VersionedReference ref = new VersionedReference();
        ref.setGroupId( parts[0] );
        ref.setArtifactId( parts[1] );
        ref.setVersion( parts[2] );
        return ref;
    }
View Full Code Here

        factory.setGraphBuilder( graphBuilder );
        factory.setDesiredScope( DependencyScope.TEST );
        factory.addGraphListener( this );

        // Get the model to resolve from
        VersionedReference rootRef = toVersionedReference( rootRefKey );

        // Perform the resolution.
        phaseNumber = 0;
        DependencyGraph graph = factory.getGraph( rootRef );
View Full Code Here

      DependencyGraphFactory factory = new DependencyGraphFactory();
      factory.setGraphBuilder( graphBuilder );
      factory.setDesiredScope( DependencyScope.TEST );

      // Get the model to resolve from
      VersionedReference rootRef = toVersionedReference( "org.apache.maven.plugins:maven-project-info-reports-plugin:2.1-SNAPSHOT");

      // Perform the resolution.
      DependencyGraph graph = factory.getGraph( rootRef );

      // Test the results.
View Full Code Here

        DEBUG( "Project: " + toProjectKey( pom ) );

        if ( pom.getParentProject() != null )
        {
            // Use parent reference.
            VersionedReference parentRef = pom.getParentProject();

            String parentKey = VersionedReference.toKey( parentRef );

            DEBUG( "Has parent: " + parentKey );
View Full Code Here

    private void assertFetchVersioned( String requestedResource )
        throws Exception
    {
        File expectedFile = new File( managedDefaultDir, requestedResource );

        VersionedReference metadata = createVersionedReference( requestedResource );

        File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, metadata );

        assertNotNull( "Should have downloaded a file.", downloadedFile );
        assertNoTempFiles( expectedFile );
View Full Code Here

TOP

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

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.