Package org.apache.maven.project

Examples of org.apache.maven.project.Dependency


        if (classLoader == null) {
            String repo = context.getMavenRepoLocal();
            List urls = new ArrayList();
            for (Iterator iterator = pluginArtifacts.iterator(); iterator.hasNext();) {
                Artifact artifact = (Artifact) iterator.next();
                Dependency dependency = (Dependency) artifact.getDependency();
                if ("true".equals(dependency.getProperty(PACKAGING_CLASSPATH_PROPERTY))) {
                    String urlString = artifact.getUrlPath();
                    URL url = new File(repo + urlString).toURL();
                    urls.add(url);
                }
            }
            boolean found = false;
            for (Iterator iterator = artifacts.iterator(); iterator.hasNext();) {
                Artifact artifact = (Artifact) iterator.next();
                Dependency dependency = (Dependency) artifact.getDependency();
                if ("geronimo".equals(dependency.getGroupId())
                && "geronimo-packaging-plugin".equals(dependency.getArtifactId())
                && "plugin".equals(dependency.getType())) {
                    String urlString = artifact.getUrlPath();
                    URL url = new File(repo + urlString).toURL();
                    urls.add(url);
                    found = true;
                }
View Full Code Here


            {
                Element listElement = element;
                listElement = element.addElement( "dependencies" );
                for ( Iterator iter = model.getDependencies().iterator(); iter.hasNext(); )
                {
                    Dependency o = (Dependency) iter.next();
                    writeDependency( o, "dependency", listElement );
                }
            }
        }
    } //-- void writeModel(Model, String, Document)
View Full Code Here

            {
                Element listElement = element;
                listElement = element.addElement( "dependencies" );
                for ( Iterator iter = modelBase.getDependencies().iterator(); iter.hasNext(); )
                {
                    Dependency o = (Dependency) iter.next();
                    writeDependency( o, "dependency", listElement );
                }
            }
        }
    } //-- void writeModelBase(ModelBase, String, Element)
View Full Code Here


    private Dependency dependency;

    public AddDependency() {
        dependency = new Dependency();
    }
View Full Code Here

     * @param parser
     */
    private Dependency parseDependency(String tagName, XmlPullParser parser, boolean strict, String encoding)
        throws IOException, XmlPullParserException
    {
        Dependency dependency = new Dependency();
        dependency.setModelEncoding( encoding );
        java.util.Set parsed = new java.util.HashSet();
        while ( parser.nextTag() == XmlPullParser.START_TAG )
        {
            if ( parser.getName().equals( "id" )  )
            {
                if ( parsed.contains( "id" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "id" );
                dependency.setId( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "groupId" )  )
            {
                if ( parsed.contains( "groupId" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "groupId" );
                dependency.setGroupId( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "artifactId" )  )
            {
                if ( parsed.contains( "artifactId" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "artifactId" );
                dependency.setArtifactId( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "version" )  )
            {
                if ( parsed.contains( "version" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "version" );
                dependency.setVersion( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "url" )  )
            {
                if ( parsed.contains( "url" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "url" );
                dependency.setUrl( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "jar" )  )
            {
                if ( parsed.contains( "jar" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "jar" );
                dependency.setJar( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "type" )  )
            {
                if ( parsed.contains( "type" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "type" );
                dependency.setType( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "properties" )  )
            {
                if ( parsed.contains( "properties" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "properties" );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    String key = parser.getName();
                    String value = parser.nextText()
                    .trim()
                    ;
                    dependency.addProperty( key, value );
                }
            }
            else
            {
                if ( strict )
View Full Code Here

     * @param xmlStreamReader
     */
    private Dependency parseDependency(String tagName, XMLStreamReader xmlStreamReader, boolean strict, String encoding)
        throws IOException, XMLStreamException
    {
        Dependency dependency = new Dependency();
        dependency.setModelEncoding( encoding );
        java.util.Set parsed = new java.util.HashSet();
        while ( xmlStreamReader.nextTag() == XMLStreamConstants.START_ELEMENT )
        {
            if ( xmlStreamReader.getLocalName().equals( "id" )  )
            {
                if ( parsed.contains( "id" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "id" );
                dependency.setId( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "groupId" )  )
            {
                if ( parsed.contains( "groupId" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "groupId" );
                dependency.setGroupId( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "artifactId" )  )
            {
                if ( parsed.contains( "artifactId" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "artifactId" );
                dependency.setArtifactId( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "version" )  )
            {
                if ( parsed.contains( "version" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "version" );
                dependency.setVersion( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "url" )  )
            {
                if ( parsed.contains( "url" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "url" );
                dependency.setUrl( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "jar" )  )
            {
                if ( parsed.contains( "jar" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "jar" );
                dependency.setJar( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "type" )  )
            {
                if ( parsed.contains( "type" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "type" );
                dependency.setType( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "properties" )  )
            {
                if ( parsed.contains( "properties" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "properties" );
                while ( xmlStreamReader.nextTag() == XMLStreamConstants.START_ELEMENT )
                {
                    String key = xmlStreamReader.getLocalName();
                    String value = xmlStreamReader.getElementText()
                    .trim()
                    ;
                    dependency.addProperty( key, value );
                }
            }
            else
            {
                if ( strict )
View Full Code Here

            if ( model.getDependencies() != null && model.getDependencies().size() > 0 )
            {
                serializer.startTag( NAMESPACE, "dependencies" );
                for ( Iterator iter = model.getDependencies().iterator(); iter.hasNext(); )
                {
                    Dependency o = (Dependency) iter.next();
                    writeDependency( o, "dependency", serializer );
                }
                serializer.endTag( NAMESPACE, "dependencies" );
            }
            serializer.endTag( NAMESPACE, tagName );
View Full Code Here

            if ( modelBase.getDependencies() != null && modelBase.getDependencies().size() > 0 )
            {
                serializer.startTag( NAMESPACE, "dependencies" );
                for ( Iterator iter = modelBase.getDependencies().iterator(); iter.hasNext(); )
                {
                    Dependency o = (Dependency) iter.next();
                    writeDependency( o, "dependency", serializer );
                }
                serializer.endTag( NAMESPACE, "dependencies" );
            }
            serializer.endTag( NAMESPACE, tagName );
View Full Code Here

            if ( model.getDependencies() != null && model.getDependencies().size() > 0 )
            {
                serializer.writeStartElement( "dependencies" );
                for ( Iterator iter = model.getDependencies().iterator(); iter.hasNext(); )
                {
                    Dependency o = (Dependency) iter.next();
                    writeDependency( o, "dependency", serializer );
                }
                serializer.writeEndElement();
            }
            serializer.writeEndElement();
View Full Code Here

            if ( modelBase.getDependencies() != null && modelBase.getDependencies().size() > 0 )
            {
                serializer.writeStartElement( "dependencies" );
                for ( Iterator iter = modelBase.getDependencies().iterator(); iter.hasNext(); )
                {
                    Dependency o = (Dependency) iter.next();
                    writeDependency( o, "dependency", serializer );
                }
                serializer.writeEndElement();
            }
            serializer.writeEndElement();
View Full Code Here

TOP

Related Classes of org.apache.maven.project.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.