Package org.apache.maven.profiles.io.xpp3

Examples of org.apache.maven.profiles.io.xpp3.ProfilesXpp3Reader


        ProfilesRoot profilesRoot = null;

        if ( profilesXml.exists() )
        {
            ProfilesXpp3Reader reader = new ProfilesXpp3Reader();
            Reader profileReader = null;
            try
            {
                profileReader = ReaderFactory.newXmlReader( profilesXml );

                StringWriter sWriter = new StringWriter();

                IOUtil.copy( profileReader, sWriter );

                String rawInput = sWriter.toString();

                try
                {
                    RegexBasedInterpolator interpolator = new RegexBasedInterpolator();
                    interpolator.addValueSource( new EnvarBasedValueSource() );

                    rawInput = interpolator.interpolate( rawInput, "settings" );
                }
                catch ( Exception e )
                {
                    getLogger().warn( "Failed to initialize environment variable resolver. Skipping environment substitution in " + PROFILES_XML_FILE + "." );
                    getLogger().debug( "Failed to initialize envar resolver. Skipping resolution.", e );
                }

                StringReader sReader = new StringReader( rawInput );

                profilesRoot = reader.read( sReader );
            }
            finally
            {
                IOUtil.close( profileReader );
            }
View Full Code Here


        ProfilesRoot profilesRoot = null;

        if ( profilesXml.exists() )
        {
            ProfilesXpp3Reader reader = new ProfilesXpp3Reader();
            FileReader fileReader = null;
            try
            {
                fileReader = new FileReader( profilesXml );
               
                StringWriter sWriter = new StringWriter();
               
                IOUtil.copy( fileReader, sWriter );
               
                String rawInput = sWriter.toString();
               
                try
                {
                    RegexBasedInterpolator interpolator = new RegexBasedInterpolator();
                    interpolator.addValueSource( new EnvarBasedValueSource() );
                   
                    rawInput = interpolator.interpolate( rawInput, "settings" );
                }
                catch ( Exception e )
                {
                    getLogger().warn( "Failed to initialize environment variable resolver. Skipping environment substitution in " + PROFILES_XML_FILE + "." );
                    getLogger().debug( "Failed to initialize envar resolver. Skipping resolution.", e );
                }

                StringReader sReader = new StringReader( rawInput );

                profilesRoot = reader.read( sReader );
            }
            finally
            {
                IOUtil.close( fileReader );
            }
View Full Code Here

        ProfilesRoot profilesRoot = null;

        if ( profilesXml.exists() )
        {
            ProfilesXpp3Reader reader = new ProfilesXpp3Reader();
            Reader profileReader = null;
            try
            {
                profileReader = ReaderFactory.newXmlReader( profilesXml );

                StringWriter sWriter = new StringWriter();

                IOUtil.copy( profileReader, sWriter );

                String rawInput = sWriter.toString();

                try
                {
                    RegexBasedInterpolator interpolator = new RegexBasedInterpolator();
                    interpolator.addValueSource( new EnvarBasedValueSource() );

                    rawInput = interpolator.interpolate( rawInput, "settings" );
                }
                catch ( Exception e )
                {
                    getLogger().warn( "Failed to initialize environment variable resolver. Skipping environment "
                                          + "substitution in " + PROFILES_XML_FILE + "." );
                    getLogger().debug( "Failed to initialize envar resolver. Skipping resolution.", e );
                }

                StringReader sReader = new StringReader( rawInput );

                profilesRoot = reader.read( sReader );
            }
            finally
            {
                IOUtil.close( profileReader );
            }
View Full Code Here

        ProfilesRoot profilesRoot = null;

        if ( profilesXml.exists() )
        {
            ProfilesXpp3Reader reader = new ProfilesXpp3Reader();
            FileReader fileReader = null;
            try
            {
                fileReader = new FileReader( profilesXml );
               
                StringWriter sWriter = new StringWriter();
               
                IOUtil.copy( fileReader, sWriter );
               
                String rawInput = sWriter.toString();
               
                try
                {
                    RegexBasedInterpolator interpolator = new RegexBasedInterpolator();
                    interpolator.addValueSource( new EnvarBasedValueSource() );
                   
                    rawInput = interpolator.interpolate( rawInput, "settings" );
                }
                catch ( Exception e )
                {
                    getLogger().warn( "Failed to initialize environment variable resolver. Skipping environment substitution in " + PROFILES_XML_FILE + "." );
                    getLogger().debug( "Failed to initialize envar resolver. Skipping resolution.", e );
                }

                StringReader sReader = new StringReader( rawInput );

                profilesRoot = reader.read( sReader );
            }
            finally
            {
                IOUtil.close( fileReader );
            }
View Full Code Here

        ProfilesRoot profilesRoot = null;

        if ( profilesXml.exists() )
        {
            ProfilesXpp3Reader reader = new ProfilesXpp3Reader();
            Reader profileReader = null;
            try
            {
                profileReader = ReaderFactory.newXmlReader( profilesXml );

                StringWriter sWriter = new StringWriter();

                IOUtil.copy( profileReader, sWriter );

                String rawInput = sWriter.toString();

                try
                {
                    RegexBasedInterpolator interpolator = new RegexBasedInterpolator();
                    interpolator.addValueSource( new EnvarBasedValueSource() );

                    rawInput = interpolator.interpolate( rawInput, "settings" );
                }
                catch ( Exception e )
                {
                    getLogger().warn( "Failed to initialize environment variable resolver. Skipping environment substitution in " + PROFILES_XML_FILE + "." );
                    getLogger().debug( "Failed to initialize envar resolver. Skipping resolution.", e );
                }

                StringReader sReader = new StringReader( rawInput );

                profilesRoot = reader.read( sReader );
            }
            finally
            {
                IOUtil.close( profileReader );
            }
View Full Code Here

        ProfilesRoot profilesRoot = null;

        if ( profilesXml.exists() )
        {
            ProfilesXpp3Reader reader = new ProfilesXpp3Reader();
            Reader profileReader = null;
            try
            {
                profileReader = ReaderFactory.newXmlReader( profilesXml );

                StringWriter sWriter = new StringWriter();

                IOUtil.copy( profileReader, sWriter );

                String rawInput = sWriter.toString();

                try
                {
                    RegexBasedInterpolator interpolator = new RegexBasedInterpolator();
                    interpolator.addValueSource( new EnvarBasedValueSource() );

                    rawInput = interpolator.interpolate( rawInput, "settings" );
                }
                catch ( Exception e )
                {
                    getLogger().warn( "Failed to initialize environment variable resolver. Skipping environment substitution in " + PROFILES_XML_FILE + "." );
                    getLogger().debug( "Failed to initialize envar resolver. Skipping resolution.", e );
                }

                StringReader sReader = new StringReader( rawInput );

                profilesRoot = reader.read( sReader );
            }
            finally
            {
                IOUtil.close( profileReader );
            }
View Full Code Here

TOP

Related Classes of org.apache.maven.profiles.io.xpp3.ProfilesXpp3Reader

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.