Package org.apache.maven.settings

Examples of org.apache.maven.settings.MavenSettingsBuilder


            userSettingsPath = commandLine.getOptionValue( CLIManager.ALTERNATE_USER_SETTINGS );
        }

        Settings settings = null;

        MavenSettingsBuilder settingsBuilder = (MavenSettingsBuilder) embedder.lookup( MavenSettingsBuilder.ROLE );

        try
        {
            if ( userSettingsPath != null )
            {
                File userSettingsFile = new File( userSettingsPath );

                if ( userSettingsFile.exists() && !userSettingsFile.isDirectory() )
                {
                    settings = settingsBuilder.buildSettings( userSettingsFile );
                }
                else
                {
                    System.out.println( "WARNING: Alternate user settings file: " + userSettingsPath +
                        " is invalid. Using default path." );
                }
            }

            if ( settings == null )
            {
                settings = settingsBuilder.buildSettings();
            }
        }
        catch ( IOException e )
        {
            throw new SettingsConfigurationException( "Error reading settings file", e );
View Full Code Here


    }

    private static Settings getSettings( PlexusContainer container, File setting )
        throws ComponentLookupException, IOException
    {
        MavenSettingsBuilder mavenSettingsBuilder =
            (MavenSettingsBuilder) container.lookup( MavenSettingsBuilder.class.getName() );
        try
        {
            if ( setting != null )
            {
                return mavenSettingsBuilder.buildSettings( setting, false );
            }
            else
            {
                return mavenSettingsBuilder.buildSettings( false );
            }
        }
        catch ( XmlPullParserException e )
        {
            e.printStackTrace();
View Full Code Here

            System.setProperty( MavenSettingsBuilder.ALT_GLOBAL_SETTINGS_XML_LOCATION, globalSettingsPath );
        }

        Settings settings = null;

        MavenSettingsBuilder settingsBuilder = (MavenSettingsBuilder) embedder.lookup( MavenSettingsBuilder.ROLE );

        try
        {
            if ( userSettingsPath != null )
            {
                File userSettingsFile = new File( userSettingsPath );

                if ( userSettingsFile.exists() && !userSettingsFile.isDirectory() )
                {
                    settings = settingsBuilder.buildSettings( userSettingsFile );
                }
                else
                {
                    System.out.println( "WARNING: Alternate user settings file: " + userSettingsPath +
                        " is invalid. Using default path." );
                }
            }

            if ( settings == null )
            {
                settings = settingsBuilder.buildSettings();
            }
        }
        catch ( IOException e )
        {
            throw new SettingsConfigurationException( "Error reading settings file", e );
View Full Code Here

            userSettingsPath = commandLine.getOptionValue( CLIManager.ALTERNATE_USER_SETTINGS );
        }

        Settings settings = null;

        MavenSettingsBuilder settingsBuilder = (MavenSettingsBuilder) embedder.lookup( MavenSettingsBuilder.ROLE );

        try
        {
            if ( userSettingsPath != null )
            {
                File userSettingsFile = new File( userSettingsPath );

                if ( userSettingsFile.exists() && !userSettingsFile.isDirectory() )
                {
                    settings = settingsBuilder.buildSettings( userSettingsFile );
                }
                else
                {
                    System.out.println( "WARNING: Alternate user settings file: " + userSettingsPath +
                        " is invalid. Using default path." );
                }
            }

            if ( settings == null )
            {
                settings = settingsBuilder.buildSettings();
            }
        }
        catch ( IOException e )
        {
            throw new SettingsConfigurationException( "Error reading settings file", e );
View Full Code Here

            System.setProperty( MavenSettingsBuilder.ALT_GLOBAL_SETTINGS_XML_LOCATION, globalSettingsPath );
        }

        Settings settings = null;

        MavenSettingsBuilder settingsBuilder = (MavenSettingsBuilder) embedder.lookup( MavenSettingsBuilder.ROLE );

        try
        {
            if ( userSettingsPath != null )
            {
                File userSettingsFile = new File( userSettingsPath );

                if ( userSettingsFile.exists() && !userSettingsFile.isDirectory() )
                {
                    settings = settingsBuilder.buildSettings( userSettingsFile );
                }
                else
                {
                    System.out.println( "WARNING: Alternate user settings file: " + userSettingsPath +
                        " is invalid. Using default path." );
                }
            }

            if ( settings == null )
            {
                settings = settingsBuilder.buildSettings();
            }
        }
        catch ( IOException e )
        {
            throw new SettingsConfigurationException( "Error reading settings file", e );
View Full Code Here

    {
        super.setUp();

        helper = (DefaultBuildAgentMavenBuilderHelper) lookup( BuildAgentMavenBuilderHelper.class );

        MavenSettingsBuilder builder = mock(MavenSettingsBuilder.class);
        when( builder.buildSettings( false )).thenReturn( createSettings() );
        helper.setMavenSettingsBuilder( builder );
    }
View Full Code Here

    }

    private static Settings getSettings( PlexusContainer container )
        throws ComponentLookupException, IOException
    {
        MavenSettingsBuilder mavenSettingsBuilder =
            (MavenSettingsBuilder) container.lookup( MavenSettingsBuilder.class.getName() );
        try
        {
            return mavenSettingsBuilder.buildSettings( false );
        }
        catch ( XmlPullParserException e )
        {
            e.printStackTrace();
            throw new IOException( "Can't read settings.xml. " + e.getMessage() );
View Full Code Here

    }

    private static Settings getSettings( PlexusContainer container, File setting )
        throws ComponentLookupException, IOException
    {
        MavenSettingsBuilder mavenSettingsBuilder = (MavenSettingsBuilder) container.lookup(
            MavenSettingsBuilder.class.getName() );
        try
        {
            if ( setting != null )
            {
                return mavenSettingsBuilder.buildSettings( setting, false );
            }
            else
            {
                return mavenSettingsBuilder.buildSettings( false );
            }
        }
        catch ( XmlPullParserException e )
        {
            e.printStackTrace();
View Full Code Here

        // Build the MavenProject instance
        // -----------------------------------------------------------------------

        MavenProjectBuilder projectBuilder = (MavenProjectBuilder) lookup( MavenProjectBuilder.ROLE );

        MavenSettingsBuilder settingsBuilder = (MavenSettingsBuilder) lookup( MavenSettingsBuilder.ROLE );
        Settings settings = settingsBuilder.buildSettings();
       
        ArtifactRepositoryFactory artifactRepositoryFactory =
            (ArtifactRepositoryFactory) lookup( ArtifactRepositoryFactory.ROLE );

        String localRepoUrl = new File( settings.getLocalRepository() ).toURL().toExternalForm();
View Full Code Here

    }

    private static Settings getSettings( PlexusContainer container, File setting )
        throws ComponentLookupException, IOException
    {
        MavenSettingsBuilder mavenSettingsBuilder =
            (MavenSettingsBuilder) container.lookup( MavenSettingsBuilder.class.getName() );
        try
        {
            if ( setting != null )
            {
                return mavenSettingsBuilder.buildSettings( setting, false );
            }
            else
            {
                return mavenSettingsBuilder.buildSettings( false );
            }
        }
        catch ( XmlPullParserException e )
        {
            e.printStackTrace();
View Full Code Here

TOP

Related Classes of org.apache.maven.settings.MavenSettingsBuilder

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.