Package org.apache.maven.project

Examples of org.apache.maven.project.Build


     * @param parser
     */
    private Build parseBuild(String tagName, XmlPullParser parser, boolean strict, String encoding)
        throws IOException, XmlPullParserException
    {
        Build build = new Build();
        build.setModelEncoding( encoding );
        java.util.Set parsed = new java.util.HashSet();
        while ( parser.nextTag() == XmlPullParser.START_TAG )
        {
            if ( parser.getName().equals( "nagEmailAddress" )  )
            {
                if ( parsed.contains( "nagEmailAddress" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "nagEmailAddress" );
                build.setNagEmailAddress( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "sourceDirectory" )  )
            {
                if ( parsed.contains( "sourceDirectory" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "sourceDirectory" );
                build.setSourceDirectory( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "unitTestSourceDirectory" )  )
            {
                if ( parsed.contains( "unitTestSourceDirectory" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "unitTestSourceDirectory" );
                build.setUnitTestSourceDirectory( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "aspectSourceDirectory" )  )
            {
                if ( parsed.contains( "aspectSourceDirectory" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "aspectSourceDirectory" );
                build.setAspectSourceDirectory( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "integrationUnitTestSourceDirectory" )  )
            {
                if ( parsed.contains( "integrationUnitTestSourceDirectory" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "integrationUnitTestSourceDirectory" );
                build.setIntegrationUnitTestSourceDirectory( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "sourceModifications" )  )
            {
                if ( parsed.contains( "sourceModifications" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "sourceModifications" );
                java.util.List sourceModifications = new java.util.ArrayList();
                build.setSourceModifications( sourceModifications );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    if ( parser.getName().equals( "sourceModification" ) )
                    {
                        sourceModifications.add( parseSourceModification( "sourceModification", parser, strict, encoding ) );
                    }
                    else
                    {
                        parser.nextText();
                    }
                }
            }
            else if ( parser.getName().equals( "unitTest" )  )
            {
                if ( parsed.contains( "unitTest" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "unitTest" );
                build.setUnitTest( parseUnitTest( "unitTest", parser, strict, encoding ) );
            }
            else if ( parser.getName().equals( "defaultGoal" )  )
            {
                if ( parsed.contains( "defaultGoal" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "defaultGoal" );
                build.setDefaultGoal( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "resources" )  )
            {
                if ( parsed.contains( "resources" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "resources" );
                java.util.List resources = new java.util.ArrayList();
                build.setResources( resources );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    if ( parser.getName().equals( "resource" ) )
                    {
                        resources.add( parseResource( "resource", parser, strict, encoding ) );
View Full Code Here


     * @param xmlStreamReader
     */
    private Build parseBuild(String tagName, XMLStreamReader xmlStreamReader, boolean strict, String encoding)
        throws IOException, XMLStreamException
    {
        Build build = new Build();
        build.setModelEncoding( encoding );
        java.util.Set parsed = new java.util.HashSet();
        while ( xmlStreamReader.nextTag() == XMLStreamConstants.START_ELEMENT )
        {
            if ( xmlStreamReader.getLocalName().equals( "nagEmailAddress" )  )
            {
                if ( parsed.contains( "nagEmailAddress" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "nagEmailAddress" );
                build.setNagEmailAddress( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "sourceDirectory" )  )
            {
                if ( parsed.contains( "sourceDirectory" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "sourceDirectory" );
                build.setSourceDirectory( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "unitTestSourceDirectory" )  )
            {
                if ( parsed.contains( "unitTestSourceDirectory" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "unitTestSourceDirectory" );
                build.setUnitTestSourceDirectory( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "aspectSourceDirectory" )  )
            {
                if ( parsed.contains( "aspectSourceDirectory" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "aspectSourceDirectory" );
                build.setAspectSourceDirectory( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "integrationUnitTestSourceDirectory" )  )
            {
                if ( parsed.contains( "integrationUnitTestSourceDirectory" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "integrationUnitTestSourceDirectory" );
                build.setIntegrationUnitTestSourceDirectory( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "sourceModifications" )  )
            {
                if ( parsed.contains( "sourceModifications" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "sourceModifications" );
                java.util.List sourceModifications = new java.util.ArrayList();
                build.setSourceModifications( sourceModifications );
                while ( xmlStreamReader.nextTag() == XMLStreamConstants.START_ELEMENT )
                {
                    if ( xmlStreamReader.getLocalName().equals( "sourceModification" ) )
                    {
                        build.addSourceModification( parseSourceModification( "sourceModification", xmlStreamReader, strict, encoding ) );
                    }
                    else
                    {
                        throw new XMLStreamException( "Unrecognised tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                    }
                }
            }
            else if ( xmlStreamReader.getLocalName().equals( "unitTest" )  )
            {
                if ( parsed.contains( "unitTest" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "unitTest" );
                build.setUnitTest( parseUnitTest( "unitTest", xmlStreamReader, strict, encoding ) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "defaultGoal" )  )
            {
                if ( parsed.contains( "defaultGoal" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "defaultGoal" );
                build.setDefaultGoal( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "resources" )  )
            {
                if ( parsed.contains( "resources" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "resources" );
                java.util.List resources = new java.util.ArrayList();
                build.setResources( resources );
                while ( xmlStreamReader.nextTag() == XMLStreamConstants.START_ELEMENT )
                {
                    if ( xmlStreamReader.getLocalName().equals( "resource" ) )
                    {
                        build.addResource( parseResource( "resource", xmlStreamReader, strict, encoding ) );
                    }
                    else
                    {
                        throw new XMLStreamException( "Unrecognised tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                    }
View Full Code Here

     * @param element
     */
    private Build parseBuild(String tagName, Element element, boolean strict, String encoding)
        throws IOException, DocumentException
    {
        Build build = new Build();
        build.setModelEncoding( encoding );
        java.util.Set parsed = new java.util.HashSet();
        for ( Iterator i = element.nodeIterator(); i.hasNext(); )
        {
            Node node = (Node) i.next();
            if ( node.getNodeType() != Node.ELEMENT_NODE )
            {
            }
            else
            {
                Element childElement = (Element) node;
                if ( childElement.getName().equals( "nagEmailAddress" )  )
                {
                    if ( parsed.contains( "nagEmailAddress" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "nagEmailAddress" );
                    build.setNagEmailAddress( getTrimmedValue( childElement.getText() ) );
                }
                else if ( childElement.getName().equals( "sourceDirectory" )  )
                {
                    if ( parsed.contains( "sourceDirectory" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "sourceDirectory" );
                    build.setSourceDirectory( getTrimmedValue( childElement.getText() ) );
                }
                else if ( childElement.getName().equals( "unitTestSourceDirectory" )  )
                {
                    if ( parsed.contains( "unitTestSourceDirectory" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "unitTestSourceDirectory" );
                    build.setUnitTestSourceDirectory( getTrimmedValue( childElement.getText() ) );
                }
                else if ( childElement.getName().equals( "aspectSourceDirectory" )  )
                {
                    if ( parsed.contains( "aspectSourceDirectory" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "aspectSourceDirectory" );
                    build.setAspectSourceDirectory( getTrimmedValue( childElement.getText() ) );
                }
                else if ( childElement.getName().equals( "integrationUnitTestSourceDirectory" )  )
                {
                    if ( parsed.contains( "integrationUnitTestSourceDirectory" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "integrationUnitTestSourceDirectory" );
                    build.setIntegrationUnitTestSourceDirectory( getTrimmedValue( childElement.getText() ) );
                }
                else if ( childElement.getName().equals( "sourceModifications" )  )
                {
                    if ( parsed.contains( "sourceModifications" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "sourceModifications" );
                    java.util.List sourceModifications = new java.util.ArrayList();
                    build.setSourceModifications( sourceModifications );
                    for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
                    {
                        Node n = (Node) j.next();
                        if ( n.getNodeType() != Node.ELEMENT_NODE )
                        {
                        }
                        else
                        {
                            Element listElement = (Element) n;
                            if ( listElement.getName().equals( "sourceModification" ) )
                            {
                                sourceModifications.add( parseSourceModification( "sourceModification", listElement, strict, encoding ) );
                            }
                            else
                            {
                            }
                        }
                    }
                }
                else if ( childElement.getName().equals( "unitTest" )  )
                {
                    if ( parsed.contains( "unitTest" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "unitTest" );
                    build.setUnitTest( parseUnitTest( "unitTest", childElement, strict, encoding ) );
                }
                else if ( childElement.getName().equals( "defaultGoal" )  )
                {
                    if ( parsed.contains( "defaultGoal" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "defaultGoal" );
                    build.setDefaultGoal( getTrimmedValue( childElement.getText() ) );
                }
                else if ( childElement.getName().equals( "resources" )  )
                {
                    if ( parsed.contains( "resources" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "resources" );
                    java.util.List resources = new java.util.ArrayList();
                    build.setResources( resources );
                    for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
                    {
                        Node n = (Node) j.next();
                        if ( n.getNodeType() != Node.ELEMENT_NODE )
                        {
View Full Code Here

TOP

Related Classes of org.apache.maven.project.Build

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.