Package org.apache.maven.archiva.model

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


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

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

            dependency.setClassifier( StringUtils.defaultString( elemDependency.elementTextTrim( "classifier" ) ) );
            dependency.setType( StringUtils.defaultIfEmpty( elemDependency.elementTextTrim( "type" ), "jar" ) );
            dependency.setScope( StringUtils.defaultIfEmpty( elemDependency.elementTextTrim( "scope" ), "compile" ) );
            // Not for v4.0.0 -> dependency.setUrl( elemDependency.elementTextTrim("url") );
            dependency.setOptional( toBoolean( elemDependency.elementTextTrim( "optional" ), false ) );
            if ( DependencyScope.isSystemScoped( dependency ) )
            {
                dependency.setSystemPath( elemDependency.elementTextTrim( "systemPath" ) );
            }

            dependency.setExclusions( getExclusions( elemDependency ) );

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


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

        while ( it.hasNext() )
        {
            Object o = it.next();
            assertTrue( "List contains Dependency entries. (found " + o.getClass().getName() + " instead)",
                        o instanceof Dependency );
            Dependency dep = (Dependency) o;
            String key = Dependency.toVersionlessKey( dep );
            map.put( key, dep );
        }
        return map;
    }
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 it = dependencies.iterator();
        while ( it.hasNext() )
        {
            Dependency dependency = (Dependency) it.next();
            dependency.setGroupId( evaluator.expand( dependency.getGroupId() ) );
            dependency.setVersion( evaluator.expand( dependency.getVersion() ) );
        }
    }
View Full Code Here

        Map managedDependencies = createDependencyMap( pom.getDependencyManagement() );
        Iterator it = pom.getDependencies().iterator();
        while ( it.hasNext() )
        {
            Dependency dep = (Dependency) it.next();
            String key = toVersionlessDependencyKey( dep );

            // Do we need to do anything?
            if ( managedDependencies.containsKey( key ) )
            {
                Dependency mgmtDep = (Dependency) managedDependencies.get( key );

                dep.setVersion( mgmtDep.getVersion() );
                dep.setScope( mgmtDep.getScope() );
                dep.setExclusions( ProjectModelMerge.mergeExclusions( dep.getExclusions(), mgmtDep.getExclusions() ) );
            }
        }
    }
View Full Code Here

        Map ret = new HashMap();

        Iterator it = dependencies.iterator();
        while ( it.hasNext() )
        {
            Dependency dep = (Dependency) it.next();
            String key = toVersionlessDependencyKey( dep );
            ret.put( key, dep );
        }

        return ret;
View Full Code Here

        {
            throw new IllegalArgumentException( "Dependency key [" + key + "] should be 5 parts. (detected "
                + parts.length + " instead)" );
        }

        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

        return dep;
    }

    protected Dependency toDependency( String key, String scope )
    {
        Dependency dependency = toDependency( key );
        dependency.setScope( scope );

        return dependency;
    }
View Full Code Here

        model.setPackaging( "jar" );

        Iterator it = deps.iterator();
        while ( it.hasNext() )
        {
            Dependency dep = (Dependency) it.next();
            model.addDependency( dep );
        }

        return model;
    }
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.