Package org.apache.maven.archiva.model

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


                      ( walkCollector.getCountDiscoverEdge() - walkCollector.getCountFinishEdge() ) );
    }

    private DependencyGraphEdge toEdge( String fromKey, String toKey )
    {
        ArtifactReference nodeFrom = toArtifactReference( fromKey );
        ArtifactReference nodeTo = toArtifactReference( toKey );

        return new DependencyGraphEdge( nodeFrom, nodeTo );
    }
View Full Code Here


    private ArtifactReference toArtifactReference( String key )
    {
        String parts[] = StringUtils.splitPreserveAllTokens( key, ':' );
        assertEquals( "ArtifactReference [" + key + "] parts should equal 5", 5, parts.length );

        ArtifactReference artifact = new ArtifactReference();
        artifact.setGroupId( parts[0] );
        artifact.setArtifactId( parts[1] );
        artifact.setVersion( parts[2] );
        artifact.setClassifier( parts[3] );
        artifact.setType( parts[4] );

        return artifact;
    }
View Full Code Here

    public DependencyGraphNode toNode( String key )
    {
        String parts[] = StringUtils.splitPreserveAllTokens( key, ":" );
        assertEquals( "toNode(" + key + ") requires 5 parts", 5, parts.length );

        ArtifactReference ref = new ArtifactReference();
        ref.setGroupId( parts[0] );
        ref.setArtifactId( parts[1] );
        ref.setVersion( parts[2] );
        ref.setClassifier( parts[3] );
        ref.setType( parts[4] );

        return new DependencyGraphNode( ref );
    }
View Full Code Here

    public ArtifactReference toArtifactReference( String path )
        throws LayoutException
    {
        PathReferences pathrefs = toPathReferences( path, true );

        ArtifactReference reference = new ArtifactReference();
        reference.setGroupId( pathrefs.groupId );
        reference.setArtifactId( pathrefs.artifactId );
        reference.setVersion( pathrefs.fileParts.version );
        reference.setClassifier( pathrefs.fileParts.classifier );
        reference.setType( pathrefs.type );

        return reference;
    }
View Full Code Here

            Rules merged = (Rules) depMap.get( key );
            if ( merged == null )
            {
                // New map entry.
                merged = new Rules();
                merged.artifact = new ArtifactReference();
                merged.artifact.setGroupId( dep.getGroupId() );
                merged.artifact.setArtifactId( dep.getArtifactId() );
                merged.artifact.setClassifier( dep.getClassifier() );
                merged.artifact.setType( dep.getType() );
            }
View Full Code Here

        super.finishGraph( graph );

        Iterator it = this.nodeVersionChanges.keySet().iterator();
        while ( it.hasNext() )
        {
            ArtifactReference ref = (ArtifactReference) it.next();
            String toVersion = (String) this.nodeVersionChanges.get( ref );

            collapseVersions( graph, ref, ref.getVersion(), toVersion );
        }
    }
View Full Code Here

        {
            // No point in doing anything.  nothing has changed.
            return;
        }

        ArtifactReference toRef = new ArtifactReference();
        toRef.setGroupId( fromRef.getGroupId() );
        toRef.setArtifactId( fromRef.getArtifactId() );
        toRef.setVersion( toVersion );
        toRef.setClassifier( fromRef.getClassifier() );
        toRef.setType( fromRef.getType() );

        DependencyGraphNode nodeFROM = graph.getNode( fromRef );
        DependencyGraphNode nodeTO = graph.getNode( toRef );

        if ( nodeTO == null )
        {
            // new node doesn't exist in graph (yet)
            nodeTO = new DependencyGraphNode( toRef );
            nodeTO.setResolved( false );

            graph.addNode( nodeTO );

            VersionedReference projectRef = new VersionedReference();
            projectRef.setGroupId( toRef.getGroupId() );
            projectRef.setArtifactId( toRef.getArtifactId() );
            projectRef.setVersion( toRef.getVersion() );

            builder.resolveNode( graph, nodeTO, projectRef );
            nodesAdded++;
        }
View Full Code Here

    protected void assertGraph( DependencyGraph graph, String rootRefKey, List expectedNodeKeys )
    {
        assertNotNull( "Graph.nodes should never be null.", graph.getNodes() );
        assertTrue( "Graph.nodes.size() should always be 1 or better.", graph.getNodes().size() >= 1 );

        ArtifactReference rootRef = graph.getRootNode().getArtifact();
        StringBuffer actualRootRef = new StringBuffer();
        actualRootRef.append( rootRef.getGroupId() ).append( ":" );
        actualRootRef.append( rootRef.getArtifactId() ).append( ":" );
        actualRootRef.append( rootRef.getVersion() );

        assertEquals( "Graph.root", rootRefKey, actualRootRef.toString() );

        Iterator it;
        List actualNodes = new ArrayList();
View Full Code Here

        this.walker = walker;
    }

    public void discoverEdge( DependencyGraphEdge edge )
    {
        ArtifactReference artifact = edge.getNodeTo();

        // Process for cyclic edges.
        if ( walker.getNodeVisitState( artifact ) == DependencyGraphWalker.PROCESSING )
        {
            edge.setDisabled( true );
View Full Code Here

{
    private Stack nodePath = new Stack();

    public void discoverEdge( DependencyGraphEdge edge )
    {
        ArtifactReference artifact = edge.getNodeTo();
       
        // Process for excluded edges.
        String toKey = DependencyGraphKeys.toManagementKey( artifact );
        Iterator it = this.nodePath.iterator();
        while ( it.hasNext() )
View Full Code Here

TOP

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

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.