mojohaus / jaxws-maven-plugin

https://www.mojohaus.org/jaxws-maven-plugin/
Apache License 2.0
25 stars 37 forks source link

nonProxyHosts settings are ignored #60

Closed MichaelWarnecke closed 6 years ago

MichaelWarnecke commented 7 years ago

When nonProxyHosts are configured in maven's settings, this configuration is ignored by the jaxws-maven-plugin.

Given these settings:

<settings>
    <proxies>
        <proxy>
            <active>true</active>
            <protocol>http</protocol>
            <host>proxy.intern</host>
            <port>1234</port>
            <nonProxyHosts>*.intern</nonProxyHosts>
        </proxy>
    </proxies>
</settings>

and this pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>test</groupId>
    <artifactId>test</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jaxws-maven-plugin</artifactId>
                <version>2.5</version>
                <executions>
                    <execution>
                        <id>jaxws-wsimport</id>
                        <goals>
                            <goal>wsimport</goal>
                        </goals>
                        <configuration>
                            <wsdlUrls>
                                <wsdlUrl>http://test.intern/service?wsdl</wsdlUrl>
                            </wsdlUrls>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

When executing mvn clean generate-sources, the following line is shown in maven's log, even though the URL test.intern is covered by the nonProxyHosts settings.

[INFO] jaxws:wsimport args: [-keep, -s, 'C:\dev\issue\target\generated-sources\wsimport', -d, 'C:\dev\is
sue\target\classes', -Xnocompile, -httpproxy:proxy.intern:1234, "http://test.intern/service?wsdl"]

Expected behaviour is: the parameter -httpproxy:proxy.intern:1234 should not be generated.

beirtipol commented 6 years ago

I've just hit this pain. @MichaelWarnecke - have you found a workaround?

beirtipol commented 6 years ago

Looks like the Java wsimport tool doesn't support nonProxyHosts. Have created a pull request to check against this regex before generating the command line

hwirnsberger commented 6 years ago

For a workaround try to set the a wrong httpproxy in the plugin configuration. For example: <httpproxy>localhost:8080</httpproxy>