Package org.apache.maven.model

Examples of org.apache.maven.model.ConfigurationContainer


     * @return ConfigurationContainer
     */
    private ConfigurationContainer parseConfigurationContainer( String tagName, XmlPullParser parser, boolean strict )
        throws IOException, XmlPullParserException
    {
        ConfigurationContainer configurationContainer = new ConfigurationContainer();
        java.util.Set parsed = new java.util.HashSet();
        while ( parser.nextTag() == XmlPullParser.START_TAG )
        {
            if ( checkFieldWithDuplicate( parser, "inherited", null, parsed ) )
            {
                configurationContainer.setInherited( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "configuration", null, parsed ) )
            {
                configurationContainer.setConfiguration( Xpp3DomBuilder.build( parser ) );
            }
            else
            {
                if ( strict )
                {
View Full Code Here


     * @param parser
     */
    private ConfigurationContainer parseConfigurationContainer(String tagName, XmlPullParser parser, boolean strict, String encoding)
        throws IOException, XmlPullParserException
    {
        ConfigurationContainer configurationContainer = new ConfigurationContainer();
        configurationContainer.setModelEncoding( encoding );
        java.util.Set parsed = new java.util.HashSet();
        while ( parser.nextTag() == XmlPullParser.START_TAG )
        {
            if ( parser.getName().equals( "inherited" )  )
            {
                if ( parsed.contains( "inherited" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "inherited" );
                configurationContainer.setInherited( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "configuration" )  )
            {
                if ( parsed.contains( "configuration" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "configuration" );
                configurationContainer.setConfiguration( Xpp3DomBuilder.build( parser ) );
            }
            else
            {
                if ( strict )
                {
View Full Code Here

     */
    private ConfigurationContainer parseConfigurationContainer( XmlPullParser parser, boolean strict )
        throws IOException, XmlPullParserException
    {
        String tagName = parser.getName();
        ConfigurationContainer configurationContainer = new ConfigurationContainer();
        for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
        {
            String name = parser.getAttributeName( i );
            String value = parser.getAttributeValue( i );

            if ( name.indexOf( ':' ) >= 0 )
            {
                // just ignore attributes with non-default namespace (for example: xmlns:xsi)
            }
            else
            {
                checkUnknownAttribute( parser, name, tagName, strict );
            }
        }
        java.util.Set parsed = new java.util.HashSet();
        while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
        {
            if ( checkFieldWithDuplicate( parser, "inherited", null, parsed ) )
            {
                configurationContainer.setInherited( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "configuration", null, parsed ) )
            {
                configurationContainer.setConfiguration( Xpp3DomBuilder.build( parser ) );
            }
            else
            {
                checkUnknownElement( parser, strict );
            }
View Full Code Here

     */
    private ConfigurationContainer parseConfigurationContainer( XmlPullParser parser, boolean strict, InputSource source )
        throws IOException, XmlPullParserException
    {
        String tagName = parser.getName();
        ConfigurationContainer configurationContainer = new ConfigurationContainer();
        InputLocation _location;
        _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
        configurationContainer.setLocation( "", _location );
        for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
        {
            String name = parser.getAttributeName( i );
            String value = parser.getAttributeValue( i );

            if ( name.indexOf( ':' ) >= 0 )
            {
                // just ignore attributes with non-default namespace (for example: xmlns:xsi)
            }
            else
            {
                checkUnknownAttribute( parser, name, tagName, strict );
            }
        }
        java.util.Set parsed = new java.util.HashSet();
        while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
        {
            if ( checkFieldWithDuplicate( parser, "inherited", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                configurationContainer.setLocation( "inherited", _location );
                configurationContainer.setInherited( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "configuration", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                configurationContainer.setLocation( "configuration", _location );
                configurationContainer.setConfiguration( Xpp3DomBuilder.build( parser ) );
            }
            else
            {
                checkUnknownElement( parser, strict );
            }
View Full Code Here

    getLog().info(String.format("Found %d Spock specifications", specNames.size()));
    return specNames;
  }

  private void configureSurefire(List<String> specNames) throws MojoExecutionException {
    ConfigurationContainer container = getSurefireConfigurationContainer();

    Xpp3Dom config = (Xpp3Dom) container.getConfiguration();
    if (config == null) {
      config = new Xpp3Dom("configuration");
      container.setConfiguration(config);
    }

    Xpp3Dom includes = getOrAddChild(config, "includes");
    if (overrideSurefireIncludes) {
      removeChildren(includes);
View Full Code Here

TOP

Related Classes of org.apache.maven.model.ConfigurationContainer

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.