Package org.apache.maven.settings

Examples of org.apache.maven.settings.Server


                                       proxy.getPassword(), proxy.getNonProxyHosts() );
            }

            for ( Iterator i = settings.getServers().iterator(); i.hasNext(); )
            {
                Server server = (Server) i.next();

                wagonManager.addAuthenticationInfo( server.getId(), server.getUsername(), server.getPassword(),
                                                    server.getPrivateKey(), server.getPassphrase() );

                wagonManager.addPermissionInfo( server.getId(), server.getFilePermissions(),
                                                server.getDirectoryPermissions() );

                if ( server.getConfiguration() != null )
                {
                    wagonManager.addConfiguration( server.getId(), (Xpp3Dom) server.getConfiguration() );
                }
            }

            RepositoryPermissions defaultPermissions = new RepositoryPermissions();
View Full Code Here


                    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();
                    }
                }
                catch ( SettingsConfigurationException se )
                {
                    getLogger().warn( "problem with settings file, disabling scm resolution of username and password" );
View Full Code Here

        return result;
    }

    private void getCredentialsFromSettings() {
        if(settings != null) {
            Server server = settings.getServer(id);
            if(server != null) {
                getLog().debug(DEBUG_MESSAGE_SETTINGS_HAS_ID);
                password = server.getPassword();
                username = server.getUsername();
                if(username != null && password != null) {
                    getLog().debug(DEBUG_MESSAGE_SETTINGS_HAS_CREDS);
                } else {
                    getLog().debug(DEBUG_MESSAGE_NO_CREDS);
                }
View Full Code Here

                                       pass, proxy.getNonProxyHosts() );
            }
           
            for ( Iterator i = settings.getServers().iterator(); i.hasNext(); )
            {
                Server server = (Server) i.next();
               
                String passWord = server.getPassword();

                if ( sd != null )
                {
                    try
                    {
                        passWord = sd.decrypt( passWord );
                    }
                    catch ( SecDispatcherException e )
                    {
                        reportSecurityConfigurationError( "password for server '" + server.getId() + "'", e );
                    }
                }
               
                String passPhrase = server.getPassphrase();

                if ( sd != null )
                {
                    try
                    {
                        passPhrase = sd.decrypt( passPhrase );
                    }
                    catch ( SecDispatcherException e )
                    {
                        reportSecurityConfigurationError( "passphrase for server '" + server.getId() + "'", e );
                    }
                }

                wagonManager.addAuthenticationInfo( server.getId(), server.getUsername(), passWord,
                                                    server.getPrivateKey(), passPhrase );

                wagonManager.addPermissionInfo( server.getId(), server.getFilePermissions(),
                                                server.getDirectoryPermissions() );

                if ( server.getConfiguration() != null )
                {
                    wagonManager.addConfiguration( server.getId(), (Xpp3Dom) server.getConfiguration() );
                }
            }

            for ( Iterator i = settings.getMirrors().iterator(); i.hasNext(); )
            {
View Full Code Here

                                       proxy.getPassword(), proxy.getNonProxyHosts() );
            }

            for ( Iterator i = settings.getServers().iterator(); i.hasNext(); )
            {
                Server server = (Server) i.next();

                wagonManager.addAuthenticationInfo( server.getId(), server.getUsername(), server.getPassword(),
                                                    server.getPrivateKey(), server.getPassphrase() );

                wagonManager.addPermissionInfo( server.getId(), server.getFilePermissions(),
                                                server.getDirectoryPermissions() );

                if ( server.getConfiguration() != null )
                {
                    wagonManager.addConfiguration( server.getId(), (Xpp3Dom) server.getConfiguration() );
                }
            }

            RepositoryPermissions defaultPermissions = new RepositoryPermissions();
View Full Code Here

                    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();
                    }
                }
                catch ( SettingsConfigurationException se )
                {
                    getLogger().warn( "problem with settings file, disabling scm resolution of username and password" );
View Full Code Here

        Settings clone = SettingsUtils.copySettings( settings );

        List<Server> clonedServers = new ArrayList<Server>( settings.getServers().size() );
        for ( Server server : settings.getServers() )
        {
            Server clonedServer = new Server();
            clonedServer.setConfiguration( server.getConfiguration() );
            clonedServer.setDirectoryPermissions( server.getDirectoryPermissions() );
            clonedServer.setFilePermissions( server.getFilePermissions() );
            clonedServer.setId( server.getId() );
            clonedServer.setPassphrase( server.getPassphrase() );
            clonedServer.setPassword( server.getPassword() );
            clonedServer.setPrivateKey( server.getPrivateKey() );
            clonedServer.setSourceLevel( server.getSourceLevel() );
            clonedServer.setUsername( server.getUsername() );
           
            clonedServers.add( clonedServer );
        }
        clone.setServers( clonedServers );
       
View Full Code Here

        return remoteBuilder;
    }

    private static RemoteRepository.Builder toRemoteRepositoryBuilder(Settings settings, String id, String layout, String url) {
        RemoteRepository.Builder remoteBuilder = new RemoteRepository.Builder( id, layout, url );
        Server server = settings.getServer( id );
        if (server != null) {
            remoteBuilder.setAuthentication( new AuthenticationBuilder().addUsername(server.getUsername())
                                                                        .addPassword(server.getPassword())
                                                                        .build() );
        }
        return remoteBuilder;

    }
View Full Code Here

    {
        log.debug( " configureWagon " );
        // MSITE-25: Make sure that the server settings are inserted
        for ( int i = 0; i < settings.getServers().size(); i++ )
        {
            Server server = (Server) settings.getServers().get( i );
            String id = server.getId();
            if ( id != null && id.equals( repositoryId ) )
            {
                if ( server.getConfiguration() != null )
                {
                    final PlexusConfiguration plexusConf =
                        new XmlPlexusConfiguration( (Xpp3Dom) server.getConfiguration() );

                    ComponentConfigurator componentConfigurator = null;
                    try
                    {
                        // FIXME role-hint basic ?
View Full Code Here

public class YoutrackChangesMojo extends AbstractYoutrackMojo {

    public void execute() throws MojoExecutionException {

        try {
            final Server mavenServer = session.getSettings().getServer(server);
            final MavenProject currentProject = session.getCurrentProject();

            if (mavenServer == null) {
                throw new MojoExecutionException("No server entry for '" + server + "', check your settings.xml file.");
            }

            Xpp3Dom mavenServerConfiguration = (Xpp3Dom) mavenServer.getConfiguration();
            final String url = mavenServerConfiguration.getChild("url").getValue();

            final YoutrackClient client = new YoutrackClient(url, project, mavenServer.getUsername(), mavenServer.getPassword(), getLog());

            File releaseFile = new File("release.properties");
            if (releaseFile.exists()) {
                // During release, create new version, release old version, migrate tickets
                Properties properties = new Properties();
View Full Code Here

TOP

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

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.