Package org.apache.maven.archiva.model

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


        System.out.println( ".\\ [" + type + "] Dependency List (size:" + deps.size() + ") \\.________________" );
        Iterator<Dependency> it = deps.iterator();
        while ( it.hasNext() )
        {
            Dependency dep = it.next();
            System.out.println( "  " + Dependency.toKey( dep ) );
        }
        System.out.println( "" );
    }
View Full Code Here


    {
        Map<String, Dependency> map = new HashMap<String, Dependency>();
        Iterator<Dependency> it = deps.iterator();
        while ( it.hasNext() )
        {
            Dependency dep = it.next();
            String key = Dependency.toKey( dep );
            map.put( key, dep );
        }
        return map;
    }
View Full Code Here

        assertEquals( "Dependencies Size", 3, model.getDependencies().size() );

        Iterator<Dependency> it = model.getDependencies().iterator();
        while ( it.hasNext() )
        {
            Dependency dep = it.next();
            assertEquals( "Dependency [" + dep.getArtifactId() + "] Group ID", "org.apache.maven.archiva", dep
                .getGroupId() );
            assertEquals( "Dependency [" + dep.getArtifactId() + "] Version", "1.0-SNAPSHOT", dep.getVersion() );
        }
    }
View Full Code Here

        return reader.read( pomFile );
    }

    private Dependency createDependency( String groupId, String artifactId, String version )
    {
        Dependency dep = new Dependency();

        dep.setGroupId( groupId );
        dep.setArtifactId( artifactId );
        dep.setVersion( version );
        dep.setTransitive( false );

        return dep;
    }
View Full Code Here

    {
        String parts[] = StringUtils.splitPreserveAllTokens( key, ':' );

        assertEquals( "Dependency key [" + key + "] should be 5 parts.", 5, parts.length );

        Dependency dep = new Dependency();

        dep.setGroupId( parts[0] );
        dep.setArtifactId( parts[1] );
        dep.setVersion( parts[2] );
        dep.setClassifier( parts[3] );
        dep.setType( parts[4] );

        return dep;
    }
View Full Code Here

        Iterator<Element> it = depsParent.elementIterator( "dependency" );
        while ( it.hasNext() )
        {
            Element elemDependency = it.next();
            Dependency dependency = new Dependency();

            dependency.setGroupId( elemDependency.elementTextTrim( "groupId" ) );
            dependency.setArtifactId( elemDependency.elementTextTrim( "artifactId" ) );
            dependency.setVersion( elemDependency.elementTextTrim( "version" ) );

            dependency.setType( StringUtils.defaultIfEmpty( elemDependency.elementTextTrim( "type" ), "jar" ) );
            dependency.setUrl( elemDependency.elementTextTrim( "url" ) );
            /* Following are not valid for <pomVersion>3</pomVersion> / Maven 1 pom files.
             *
             * dependency.setClassifier( StringUtils.defaultString( elemDependency.elementTextTrim( "classifier" ) ) );
             * dependency.setScope( StringUtils.defaultIfEmpty( elemDependency.elementTextTrim( "scope" ), "compile" ) );
             * dependency.setOptional( toBoolean( elemDependency.elementTextTrim( "optional" ), false ) );
             */

            dependency.setSystemPath( elemDependency.elementTextTrim( "jar" ) );

            if ( dependencyList.contains( dependency ) )
            {
                // TODO: throw into monitor as "duplicate dependency" issue.
            }
View Full Code Here

        if ( deps != null )
        {
            for ( int i = 0; i < deps.length; i++ )
            {
                Dependency dep = deps[i];
                model.addDependency( dep );
            }
        }

        return model;
View Full Code Here

    {
        String parts[] = StringUtils.splitPreserveAllTokens( key, ':' );

        assertEquals( "Dependency key [" + key + "] should be 5 parts.", 5, parts.length );

        Dependency dep = new Dependency();

        dep.setGroupId( parts[0] );
        dep.setArtifactId( parts[1] );
        dep.setVersion( parts[2] );
        dep.setClassifier( parts[3] );
        dep.setType( parts[4] );

        return dep;
    }
View Full Code Here

    }

    public void testPushPopSimple()
    {
        DependencyGraphNode node = toNode( "org.apache.maven.archiva:depmanstack-testcase:1.0::jar" );
        Dependency dep = toDependency( "junit:junit:3.8.1::jar" );
        dep.setScope( "test" );
        node.addDependencyManagement( dep );

        DependencyManagementStack stack = new DependencyManagementStack();
        stack.push( node );
        DependencyGraphNode oldnode = stack.pop();
View Full Code Here

    }

    public void testPushPopTwoDeep()
    {
        DependencyManagementStack stack = new DependencyManagementStack();
        Dependency dep;

        // top node.
        DependencyGraphNode projectNode = toNode( "org.apache.maven.archiva:depmanstack-testcase:1.0::jar" );
        dep = toDependency( "junit:junit:3.8.1::jar" );
        dep.setScope( "test" );
        projectNode.addDependencyManagement( dep );
        stack.push( projectNode );

        // direct node.
        DependencyGraphNode directNode = toNode( "org.apache.maven.archiva:depmanstack-common:1.0::jar" );
        dep = toDependency( "junit:junit:3.7::jar" );
        dep.setScope( "test" );
        directNode.addDependencyManagement( dep );
        stack.push( directNode );

        // transitive node.
        DependencyGraphNode transNode = toNode( "org.apache.maven.archiva:depmanstack-model:1.0::jar" );
View Full Code Here

TOP

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

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.