Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F3BDF6E0C for ; Sat, 28 May 2011 10:12:18 +0000 (UTC) Received: (qmail 6575 invoked by uid 500); 28 May 2011 10:12:18 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 6535 invoked by uid 500); 28 May 2011 10:12:18 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 6528 invoked by uid 99); 28 May 2011 10:12:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 May 2011 10:12:18 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 May 2011 10:12:16 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id D722523889BF; Sat, 28 May 2011 10:11:55 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1128586 - in /cxf/branches/2.3.x-fixes: ./ maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java Date: Sat, 28 May 2011 10:11:55 -0000 To: commits@cxf.apache.org From: ffang@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110528101155.D722523889BF@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ffang Date: Sat May 28 10:11:55 2011 New Revision: 1128586 URL: http://svn.apache.org/viewvc?rev=1128586&view=rev Log: Merged revisions 1128585 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r1128585 | ffang | 2011-05-28 18:02:57 +0800 (六, 28 5 2011) | 1 line [CXF-3547]code-gen-plugin should take advantage of maven proxy setting ........ Modified: cxf/branches/2.3.x-fixes/ (props changed) cxf/branches/2.3.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java Propchange: cxf/branches/2.3.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.3.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java?rev=1128586&r1=1128585&r2=1128586&view=diff ============================================================================== --- cxf/branches/2.3.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java (original) +++ cxf/branches/2.3.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java Sat May 28 10:11:55 2011 @@ -43,6 +43,7 @@ import org.apache.maven.plugin.AbstractM import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.project.MavenProject; import org.apache.maven.project.ProjectUtils; +import org.apache.maven.settings.Proxy; /** * @goal wsdl2java @@ -333,6 +334,26 @@ public class WSDL2JavaMojo extends Abstr } } + private 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())); + } + + + } + } + public void execute() throws MojoExecutionException { if (includes == null) { includes = new String[] { @@ -344,6 +365,8 @@ public class WSDL2JavaMojo extends Abstr classesDir.mkdirs(); markerDirectory.mkdirs(); + configureProxyServerSettings(); + List effectiveWsdlOptions = createWsdlOptionsFromScansAndExplicitWsdlOptions(); if (effectiveWsdlOptions.size() == 0) {