Package org.apache.maven.settings

Examples of org.apache.maven.settings.Settings


        List<ArtifactRepository> remoteRepositories = new ArrayList<ArtifactRepository>();
        remoteRepositories.add(
            factory.createArtifactRepository( "central", "http://repo1.maven.org/maven2", layout, null, null ) );
        //Load extra repositories from active profile
       
        Settings settings = getSettings( container, setting );
        List<String> profileIds = settings.getActiveProfiles();
        Map<String, Profile> profilesAsMap = settings.getProfilesAsMap();
        if ( profileIds != null && !profileIds.isEmpty() )
        {
            for ( String profileId : profileIds )
            {
                Profile profile = profilesAsMap.get( profileId );
View Full Code Here


    {
        String repositoryPath;
        File settingsFile = new File( System.getProperty( "user.home" ), ".m2/settings.xml" );
        if ( setting != null )
        {
            Settings settings = getSettings( container, setting );
            repositoryPath = new File( settings.getLocalRepository() ).toURL().toString();
        }
        else if ( !settingsFile.exists() )
        {
            repositoryPath = new File( System.getProperty( "user.home" ), ".m2/repository" ).toURL().toString();
        }
        else
        {
            Settings settings = getSettings( container, null );
            repositoryPath = new File( settings.getLocalRepository() ).toURL().toString();
        }
        return repositoryPath;
    }
View Full Code Here

            public List<String> findVersions( Artifact artifact )
            {
                return Collections.emptyList();
            }
        } );
        final Settings settings = getSettings();

        getContainer().lookup( MavenExecutionRequestPopulator.class ).populateFromSettings( request, settings );

        getContainer().lookup( MavenExecutionRequestPopulator.class ).populateDefaults( request );
View Full Code Here

        settingsBuildingRequest.setUserSettingsFile( MavenCli.DEFAULT_USER_SETTINGS_FILE );

        settingsBuildingRequest.getSystemProperties().putAll( System.getProperties() );

        Settings settings =
            getContainer().lookup( SettingsBuilder.class ).build( settingsBuildingRequest ).getEffectiveSettings();

        return settings;

    }
View Full Code Here

        if ( localRepo == null )
        {
            File settingsFile = new File( System.getProperty( "user.home" ), ".m2/settings.xml" );
            if ( settingsFile.exists() )
            {
                Settings settings = new SettingsXpp3Reader().read( ReaderFactory.newXmlReader( settingsFile ) );
                localRepo = settings.getLocalRepository();
            }
        }
        if ( localRepo == null )
        {
            localRepo = System.getProperty( "user.home" ) + "/.m2/repository";
View Full Code Here

    {
        LocalRepository repository;

        repository = localRepositoryDao.getLocalRepositoryByName( "DEFAULT" );

        Settings settings = getSettings();

        if ( repository == null )
        {
            log.info( "create Default Local Repository" );

            repository = new LocalRepository();

            repository.setName( "DEFAULT" );

            repository.setLocation( settings.getLocalRepository() );

            repository = localRepositoryDao.addLocalRepository( repository );

            createDefaultPurgeConfiguration( repository );
        }
        else if ( !repository.getLocation().equals( settings.getLocalRepository() ) )
        {
            log.info( "updating location of Default Local Repository" );

            repository.setLocation( settings.getLocalRepository() );

            localRepositoryDao.updateLocalRepository( repository );
        }
    }
View Full Code Here

        try
        {
            //   TODO: This seems like code that is shared with DefaultMaven, so it should be moved to the project
            //   builder perhaps

            Settings settings = getSettings();

            if ( log.isDebugEnabled() )
            {
                writeSettings( settings );
            }
View Full Code Here

    public void initialize()
        throws InitializationException
    {
        try
        {
            Settings settings = getSettings();

            resolveParameters( settings );
        }
        catch ( Exception e )
        {
View Full Code Here

                String username = null;
                String password = null;

                try
                {
                    Settings settings = getSettings();

                    getLogger().info( "checking for settings auth setup" );
                    if ( settings != null && settings.getServer( url.getHost() ) != null )
                    {
                        getLogger().info( "found setting based auth setup, using" );
                        Server server = settings.getServer( url.getHost() );

                        username = server.getUsername();
                        password = server.getPassword();
                    }
                }
View Full Code Here

            response.append( sWriter.toString() );
        }
        // handle Maven Settings object
        else if ( obj instanceof Settings )
        {
            Settings settingsAsked = (Settings) obj;
            StringWriter sWriter = new StringWriter();
            SettingsXpp3Writer settingsWriter = new SettingsXpp3Writer();
            try
            {
                settingsWriter.write( sWriter, settingsAsked );
View Full Code Here

TOP

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

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.