[ 
http://jira.codehaus.org/browse/WAGON-82?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Marc Wilhelm updated WAGON-82:
------------------------------

    Attachment: wagon-webdav.patch

Here is the small patch for the proxy problem which is based on 
"https://svn.apache.org/repos/asf/maven/wagon/tags/wagon-1.0-beta-2/wagon-providers/wagon-webdav";.

I have added also a new feature to the webdav-provider to specify a firewall 
proxy for normal http-connections and for webdav-connections in *one* 
settings.xml config.

The problem:
------------------
To activate a proxy server for the webdav provider you must enter or change the 
proxy settings in your settings.xml to something like the following:
{noformat} 
<settings>
        <proxies>
                <proxy>
                        <active />
                        <protocol>dav</protocol>
                        <username>scott</username>
                        <password>tiger</password>
                        <port>8080</port>
                        <host>my.http-proxy.url</host>
                        <id />
                </proxy>
        </proxies>
</settings>
{noformat} 
This will work with the (patched) version of webdav-wagon but lead into trouble 
with the normal http-proxy for artifact downloads.

If you try to specify a proxy for each protocol "http" and "dav" like:
{noformat} 
        <proxies>
                <proxy>
                        <active />
                        <protocol>http</protocol>
                        <username>scott</username>
                        <password>tiger</password>
                        <port>8080</port>
                        <host>my.http-proxy.url</host>
                        <id />
                </proxy>
                <proxy>
                        <active />
                        <protocol>dav</protocol>
                        <username>scott</username>
                        <password>tiger</password>
                        <port>8080</port>
                        <host>my.http-proxy.url</host>
                        <id />
                </proxy>
        </proxies>
{noformat} 

The proxy settings are ignored at all for the webdav provider, since only one 
proxy server could be declared as active (maybe this is a bug in 2.0.4).

To solve this problem i have declared a new field "proxy" for the 
webdav-provider and used the "configuration" subtag from the "server" tag to 
specify the proxy were it is needed:

{noformat} 
<settings>

        <proxies>
                <proxy>
                        <active />
                        <protocol>http</protocol>
                        <username>scott</username>
                        <password>tiger</password>
                        <port>8080</port>
                        <host>my.http-proxy.url</host>
                        <id />
                </proxy>
      </proxies>
        <servers>
                <server>
                        <id>my-upload-server</id>
                        <username>foo</username>
                        <password>bar</password>
                        <configuration>
                                <proxy>
                                        <userName>scott</userName>
                                        <password>tiger</password>
                                        <port>8080</port>
                                        <host>my.special-proxy.url</host>
                                        <type>dav</type>
                                </proxy>
                        </configuration>
                </server>
  ...
</settings>
{noformat} 

I tried to write a unit test for the proxy-server-connections and have 
introduced a small test setup which takes a normal http-proxy, but this hasn't 
worked well with the webdav protocol. So i have decided that it makes no sence 
to write a fix in 5 minutes and work more than one hour at the test cases. As 
result this patch only provides the solution without any test cases :( 

But since the fix contains only a handful lines of code i hope it could be 
verified easy be reading it.

Cheers,
Marc



> wagon-webdav does not set http-proxy correctly
> ----------------------------------------------
>
>                 Key: WAGON-82
>                 URL: http://jira.codehaus.org/browse/WAGON-82
>             Project: wagon
>          Issue Type: Bug
>          Components: wagon-webdav
>    Affects Versions: 1.0-beta-2
>         Environment: any system
>            Reporter: Marc Wilhelm
>            Priority: Blocker
>         Attachments: wagon-webdav.patch
>
>
> Webdav connections through a http-proxy are currently not possible.
> The webdav provider opens first a connection to the target system and checks 
> after this, if a proxy should be used.
> To fix this in the method 
> "org.apache.maven.wagon.providers.webdav.WebdavWagon#openConnection()"  the 
> call "webdavResource = new CorrectedWebdavResource( httpURL );" must be 
> changed into "webdavResource = new CorrectedWebdavResource( );" and after 
> configuring the http-proxy the method call 
> "webdavResource.setHttpURL(httpURL);" must be added.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to