Package org.apache.maven.profiles

Examples of org.apache.maven.profiles.ProfilesRoot


    {
        if ( projectDir != null )
        {
            try
            {
                ProfilesRoot root = profilesBuilder.buildProfiles( projectDir );

                if ( root != null )
                {
                    List active = root.getActiveProfiles();

                    if ( ( active != null ) && !active.isEmpty() )
                    {
                        profileManager.explicitlyActivate( root.getActiveProfiles() );
                    }

                    for ( Iterator it = root.getProfiles().iterator(); it.hasNext(); )
                    {
                        org.apache.maven.profiles.Profile rawProfile = (org.apache.maven.profiles.Profile) it.next();

                        Profile converted = ProfilesConversionUtils.convertFromProfileXmlProfile( rawProfile );
View Full Code Here


    {
        if ( projectDir != null )
        {
            try
            {
                ProfilesRoot root = profilesBuilder.buildProfiles( projectDir );

                if ( root != null )
                {
                    List active = root.getActiveProfiles();

                    if ( ( active != null ) && !active.isEmpty() )
                    {
                        profileManager.explicitlyActivate( root.getActiveProfiles() );
                    }

                    for ( Iterator it = root.getProfiles().iterator(); it.hasNext(); )
                    {
                        org.apache.maven.profiles.Profile rawProfile = (org.apache.maven.profiles.Profile) it.next();

                        Profile converted = ProfilesConversionUtils.convertFromProfileXmlProfile( rawProfile );
View Full Code Here

        }

        try
        {
            DefaultMavenProfilesBuilder profilesBuilder = new DefaultMavenProfilesBuilder();
            ProfilesRoot root = profilesBuilder.buildProfiles( projectDir );
            if ( root != null )
            {
                List<org.apache.maven.profiles.Profile> profiles = root.getProfiles();
                for ( org.apache.maven.profiles.Profile rawProfile : profiles )
                {
                    Profile converted = ProfilesConversionUtils.convertFromProfileXmlProfile( rawProfile );
                    profileManager.addProfile( converted );
                    profileManager.explicitlyActivate( converted.getId() );
View Full Code Here

    {
        if ( projectDir != null )
        {
            try
            {
                ProfilesRoot root = profilesBuilder.buildProfiles( projectDir );

                if ( root != null )
                {
                    List active = root.getActiveProfiles();

                    if ( ( active != null ) && !active.isEmpty() )
                    {
                        profileManager.explicitlyActivate( root.getActiveProfiles() );
                    }

                    for ( Iterator it = root.getProfiles().iterator(); it.hasNext(); )
                    {
                        org.apache.maven.profiles.Profile rawProfile = (org.apache.maven.profiles.Profile) it.next();

                        Profile converted = ProfilesConversionUtils.convertFromProfileXmlProfile( rawProfile );
View Full Code Here

     * @return ProfilesRoot
     */
    private ProfilesRoot parseProfilesRoot( String tagName, XmlPullParser parser, boolean strict )
        throws IOException, XmlPullParserException
    {
        ProfilesRoot profilesRoot = new ProfilesRoot();
        java.util.Set parsed = new java.util.HashSet();
        int eventType = parser.getEventType();
        boolean foundRoot = false;
        profilesRoot.setModelEncoding( parser.getInputEncoding() );
        while ( eventType != XmlPullParser.END_DOCUMENT )
        {
            if ( eventType == XmlPullParser.START_TAG )
            {
                if ( parser.getName().equals( tagName ) )
                {
                    foundRoot = true;
                }
                else if ( strict && ! foundRoot )
                {
                    throw new XmlPullParserException( "Expected root element '" + tagName + "' but found '" + parser.getName() + "'", parser, null );
                }
                else if ( checkFieldWithDuplicate( parser, "profiles", null, parsed ) )
                {
                    java.util.List profiles = new java.util.ArrayList/*<Profile>*/();
                    profilesRoot.setProfiles( profiles );
                    while ( parser.nextTag() == XmlPullParser.START_TAG )
                    {
                        if ( parser.getName().equals( "profile" ) )
                        {
                            profiles.add( parseProfile( "profile", parser, strict ) );
                        }
                        else if ( strict )
                        {
                            throw new XmlPullParserException( "Unrecognised association: '" + parser.getName() + "'", parser, null );
                        }
                        else
                        {
                            // swallow up to end tag since this is not valid
                            while ( parser.next() != XmlPullParser.END_TAG ) {}
                        }
                    }
                }
                else if ( checkFieldWithDuplicate( parser, "activeProfiles", null, parsed ) )
                {
                    java.util.List activeProfiles = new java.util.ArrayList/*<String>*/();
                    profilesRoot.setActiveProfiles( activeProfiles );
                    while ( parser.nextTag() == XmlPullParser.START_TAG )
                    {
                        if ( parser.getName().equals( "activeProfile" ) )
                        {
                            activeProfiles.add( getTrimmedValue( parser.nextText() ) );
View Full Code Here

     * @param parser
     */
    private ProfilesRoot parseProfilesRoot(String tagName, XmlPullParser parser, boolean strict, String encoding)
        throws IOException, XmlPullParserException
    {
        ProfilesRoot profilesRoot = new ProfilesRoot();
        profilesRoot.setModelEncoding( encoding );
        java.util.Set parsed = new java.util.HashSet();
        int eventType = parser.getEventType();
        boolean foundRoot = false;
        while ( eventType != XmlPullParser.END_DOCUMENT )
        {
            if ( eventType == XmlPullParser.START_TAG )
            {
                if ( parser.getName().equals( tagName ) )
                {
                    foundRoot = true;
                }
                else if ( parser.getName().equals( "profiles" )  )
                {
                    if ( parsed.contains( "profiles" ) )
                    {
                        throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                    }
                    parsed.add( "profiles" );
                    java.util.List profiles = new java.util.ArrayList();
                    profilesRoot.setProfiles( profiles );
                    while ( parser.nextTag() == XmlPullParser.START_TAG )
                    {
                        if ( parser.getName().equals( "profile" ) )
                        {
                            profiles.add( parseProfile( "profile", parser, strict, encoding ) );
                        }
                        else
                        {
                            parser.nextText();
                        }
                    }
                }
                else if ( parser.getName().equals( "activeProfiles" )  )
                {
                    if ( parsed.contains( "activeProfiles" ) )
                    {
                        throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                    }
                    parsed.add( "activeProfiles" );
                    java.util.List activeProfiles = new java.util.ArrayList();
                    profilesRoot.setActiveProfiles( activeProfiles );
                    while ( parser.nextTag() == XmlPullParser.START_TAG )
                    {
                        if ( parser.getName().equals( "activeProfile" ) )
                        {
                            activeProfiles.add( getTrimmedValue( parser.nextText()) );
View Full Code Here

    {
        if ( projectDir != null )
        {
            try
            {
                ProfilesRoot root = profilesBuilder.buildProfiles( projectDir );

                if ( root != null )
                {
                    List active = root.getActiveProfiles();

                    if ( active != null && !active.isEmpty() )
                    {
                        profileManager.explicitlyActivate( root.getActiveProfiles() );
                    }

                    for ( Iterator it = root.getProfiles().iterator(); it.hasNext(); )
                    {
                        org.apache.maven.profiles.Profile rawProfile = (org.apache.maven.profiles.Profile) it.next();

                        Profile converted = ProfilesConversionUtils.convertFromProfileXmlProfile( rawProfile );
View Full Code Here

    {
        if ( projectDir != null )
        {
            try
            {
                ProfilesRoot root = profilesBuilder.buildProfiles( projectDir );

                if ( root != null )
                {
                    List active = root.getActiveProfiles();

                    if ( active != null && !active.isEmpty() )
                    {
                        profileManager.explicitlyActivate( root.getActiveProfiles() );
                    }

                    for ( Iterator it = root.getProfiles().iterator(); it.hasNext(); )
                    {
                        org.apache.maven.profiles.Profile rawProfile = (org.apache.maven.profiles.Profile) it.next();

                        Profile converted = ProfilesConversionUtils.convertFromProfileXmlProfile( rawProfile );
View Full Code Here

    {
        if ( projectDir != null )
        {
            try
            {
                ProfilesRoot root = profilesBuilder.buildProfiles( projectDir );

                if ( root != null )
                {
                    List active = root.getActiveProfiles();

                    if ( active != null && !active.isEmpty() )
                    {
                        profileManager.explicitlyActivate( root.getActiveProfiles() );
                    }

                    for ( Iterator it = root.getProfiles().iterator(); it.hasNext(); )
                    {
                        org.apache.maven.profiles.Profile rawProfile = (org.apache.maven.profiles.Profile) it.next();

                        Profile converted = ProfilesConversionUtils.convertFromProfileXmlProfile( rawProfile );
View Full Code Here

    {
        if ( projectDir != null )
        {
            try
            {
                ProfilesRoot root = profilesBuilder.buildProfiles( projectDir );

                if ( root != null )
                {
                    List active = root.getActiveProfiles();

                    if ( ( active != null ) && !active.isEmpty() )
                    {
                        profileManager.explicitlyActivate( root.getActiveProfiles() );
                    }

                    for ( Iterator it = root.getProfiles().iterator(); it.hasNext(); )
                    {
                        org.apache.maven.profiles.Profile rawProfile = (org.apache.maven.profiles.Profile) it.next();

                        Profile converted = ProfilesConversionUtils.convertFromProfileXmlProfile( rawProfile );
View Full Code Here

TOP

Related Classes of org.apache.maven.profiles.ProfilesRoot

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.