Package org.apache.maven.settings

Examples of org.apache.maven.settings.Proxy



    protected void getProxyInfo( String jiraUrl )
    {
        // see whether there is any proxy defined in maven
        Proxy proxy = null;

        if ( project == null )
        {
            getLog().error( "No project set. No proxy info available." );

            return;
        }

        if ( settings != null )
        {
            proxy = settings.getActiveProxy();
        }

        if ( proxy != null )
        {

            ProxyInfo proxyInfo = new ProxyInfo();
            proxyInfo.setNonProxyHosts( proxy.getNonProxyHosts() );

            // Get the host out of the JIRA URL
            URL url = null;
            try
            {
View Full Code Here


    }
  }

  private void addProxyOption(final List<String> args) {
    if (hasServerSettings() && proxy == null) {
        final Proxy activCfgProxy = settings.getActiveProxy();
        if (activCfgProxy != null) {
            addStringOption(args, "--proxy=",
                activCfgProxy.getHost() + ":" + activCfgProxy.getPort());
        }
    } else {
        addStringOption(args, "--proxy=", proxy);
    }
  }
View Full Code Here

    }
  }

  private void addProxyOption(final List<String> args) {
    if (hasServerSettings() && proxy == null) {
        final Proxy activCfgProxy = settings.getActiveProxy();
        if (activCfgProxy != null) {
            addStringOption(args, "--proxy=",
                activCfgProxy.getHost() + ":" + activCfgProxy.getPort());
        }
    } else {
        addStringOption(args, "--proxy=", proxy);
    }
  }
View Full Code Here

    }
  }

  private void addProxyOption(final List<String> args) {
    if (hasServerSettings() && proxy == null) {
        final Proxy activCfgProxy = settings.getActiveProxy();
        if (activCfgProxy != null) {
            addStringOption(args, "--proxy=",
                activCfgProxy.getHost() + ":" + activCfgProxy.getPort());
        }
    } else {
        addStringOption(args, "--proxy=", proxy);
    }
  }
View Full Code Here

    }
  }

  private void addProxyOption(final List<String> args) {
    if (hasServerSettings() && proxy == null) {
        final Proxy activCfgProxy = settings.getActiveProxy();
        if (activCfgProxy != null) {
            addStringOption(args, "--proxy=",
                activCfgProxy.getHost() + ":" + activCfgProxy.getPort());
        }
    } else {
        addStringOption(args, "--proxy=", proxy);
    }
  }
View Full Code Here

    }
  }

  private void addProxyOption(final List<String> args) {
    if (hasServerSettings() && proxy == null) {
        final Proxy activCfgProxy = settings.getActiveProxy();
        if (activCfgProxy != null) {
            addStringOption(args, "--proxy=",
                activCfgProxy.getHost() + ":" + activCfgProxy.getPort());
        }
    } else {
        addStringOption(args, "--proxy=", proxy);
    }
  }
View Full Code Here

    }
  }

  private void addProxyOption(final List<String> args) {
    if (hasServerSettings() && proxy == null) {
        final Proxy activCfgProxy = settings.getActiveProxy();
        if (activCfgProxy != null) {
            addStringOption(args, "--proxy=",
                activCfgProxy.getHost() + ":" + activCfgProxy.getPort());
        }
    } else {
        addStringOption(args, "--proxy=", proxy);
    }
  }
View Full Code Here

  protected ClientConfiguration getClientConfiguration() {
    ClientConfiguration clientConfiguration = new ClientConfiguration()
        .withUserAgent(getUserAgent());

    if (null != this.settings && null != settings.getActiveProxy()) {
      Proxy proxy = settings.getActiveProxy();

      clientConfiguration.setProxyHost(proxy.getHost());
      clientConfiguration.setProxyUsername(proxy.getUsername());
      clientConfiguration.setProxyPassword(proxy.getPassword());
      clientConfiguration.setProxyPort(proxy.getPort());
    }

    return clientConfiguration;
  }
View Full Code Here

                            }
                            wagon.setTimeout(1000);
                            Settings settings = mavenSettingsBuilder.buildSettings();
                            ProxyInfo proxyInfo = null;
                            if (settings != null && settings.getActiveProxy() != null) {
                                Proxy settingsProxy = settings.getActiveProxy();

                                proxyInfo = new ProxyInfo();
                                proxyInfo.setHost(settingsProxy.getHost());
                                proxyInfo.setType(settingsProxy.getProtocol());
                                proxyInfo.setPort(settingsProxy.getPort());
                                proxyInfo.setNonProxyHosts(settingsProxy.getNonProxyHosts());
                                proxyInfo.setUserName(settingsProxy.getUsername());
                                proxyInfo.setPassword(settingsProxy.getPassword());
                            }

                            if (proxyInfo != null) {
                                wagon.connect(repository,
                                              wagonManager.getAuthenticationInfo(repository.getId()),
View Full Code Here

    }

    protected void configureProxyServerSettings() throws MojoExecutionException {

        Proxy proxy = mavenSession.getSettings().getActiveProxy();

        if (proxy != null) {

            getLog().info("Using proxy server configured in maven.");

            if (proxy.getHost() == null) {
                throw new MojoExecutionException("Proxy in settings.xml has no host");
            } else {
                System.setProperty("proxySet", "true");
                System.setProperty("proxyHost", proxy.getHost());
                System.setProperty("proxyPort", String.valueOf(proxy.getPort()));
            }

        }
    }
View Full Code Here

TOP

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

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.