You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Marc Wilhelm (JIRA)" <ji...@codehaus.org> on 2007/04/27 12:37:26 UTC

[jira] Created: (WAGON-82) wagon-webdav does not set http-proxy correctly

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


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

        

[jira] Updated: (WAGON-82) wagon-webdav does not set http-proxy correctly

Posted by "Jochen Wiedmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/WAGON-82?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jochen Wiedmann updated WAGON-82:
---------------------------------

    Attachment: 0001-Added-the-ProxyInfoProvider-interface-in-order-to-fi.patch

Updated patch for WAGON, created using git.


> 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
>            Assignee: Brett Porter
>            Priority: Blocker
>         Attachments: 0001-Added-the-ProxyInfoProvider-interface-in-order-to-fi.patch, WAGON-82-maven-artifact-manager.patch, WAGON-82-tested-maven-artifact-manager.patch, WAGON-82-tested-wagon.patch, WAGON-82-wagon.patch, 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

        

[jira] Commented: (WAGON-82) wagon-webdav does not set http-proxy correctly

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/WAGON-82?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_106820 ] 

Brett Porter commented on WAGON-82:
-----------------------------------

ok, I successfully applied this - but I'm not entirely comfortable with it. Firstly, I can't get that change into Maven trunk/branch until wagon would be released with it's changes.

However, the upshot of the patch is that the webdav wagon ignores the proxy that is passed in.

I think it would be better to take the earlier solution provided by Jochen where:
a) we fix the wagon manager to pass the correct proxy in (presumably it's giving dav instead of http - surely we can figure that out), or otherwise
b) pass in all the proxies and let the wagon decide which to use.

I'll have to take a closer look at this next week - sorry.

> 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
>            Assignee: Brett Porter
>            Priority: Blocker
>         Attachments: WAGON-82-maven-artifact-manager.patch, WAGON-82-tested-maven-artifact-manager.patch, WAGON-82-tested-wagon.patch, WAGON-82-wagon.patch, 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

        

[jira] Updated: (WAGON-82) wagon-webdav does not set http-proxy correctly

Posted by "Arnaud Heritier (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/WAGON-82?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Arnaud Heritier updated WAGON-82:
---------------------------------

    Attachment: WAGON-82-tested-wagon.patch

>From : Jochen Wiedmann

> 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-82-maven-artifact-manager.patch, WAGON-82-tested-wagon.patch, WAGON-82-wagon.patch, 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

        

[jira] Commented: (WAGON-82) wagon-webdav does not set http-proxy correctly

Posted by "Jochen Wiedmann (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/WAGON-82?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_106894 ] 

Jochen Wiedmann commented on WAGON-82:
--------------------------------------


> Firstly, I can't get that change into Maven trunk/branch until wagon would be released with it's changes.

Agreed, but I do not have any idea, how to solve the problem without any API changes. The current API depends on the assumptions that a) there is exactly one protocol being used by the wagon provider and b) the Wagon user is responsible to know which protocol that is. Both assumptions are, IMO, plainly wrong, as the webdav provider obviously demonstrates.

> However, the upshot of the patch is that the webdav wagon ignores the proxy that is passed in.

I can't follow you here. The old proxy configuration is still in place and the patch should take care that the old proxy configuration is used, if no ProxyInfo is present.

> I think it would be better to take the earlier solution provided by Jochen where:
> a) we fix the wagon manager to pass the correct proxy in (presumably it's giving dav instead of http - surely we can figure that out), or otherwise

You refer to the solution proposed by Joakim, not Jochen? It is up to you to determine whether such an ugly workaround should be installed. My strategy would clearly be to push out a wagon release ASAP (perhaps even a version 1.0-beta-2.1, which could be identical to 1.0-beta-2, apart from this patch) and use that in the Maven core, if 1.0-beta-3-SNAPSHOT is undesirable.

> b) pass in all the proxies and let the wagon decide which to use.

That is, IMO, exactly, what the ProxyInfo does.



> 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
>            Assignee: Brett Porter
>            Priority: Blocker
>         Attachments: WAGON-82-maven-artifact-manager.patch, WAGON-82-tested-maven-artifact-manager.patch, WAGON-82-tested-wagon.patch, WAGON-82-wagon.patch, 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

        

[jira] Commented: (WAGON-82) wagon-webdav does not set http-proxy correctly

Posted by "Joakim Erdfelt (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/WAGON-82?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_95802 ] 

Joakim Erdfelt commented on WAGON-82:
-------------------------------------

I've considered making the protocol on wagon-webdav 'dav' (normal http) and 'davs' (secure/https) respectively.  Would that ease your pain?

(bakwards compatibility is a must, obviously)

> 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

        

[jira] Closed: (WAGON-82) wagon-webdav does not set http-proxy correctly

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/WAGON-82?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brett Porter closed WAGON-82.
-----------------------------

    Resolution: Fixed

> wagon-webdav does not set http-proxy correctly
> ----------------------------------------------
>
>                 Key: WAGON-82
>                 URL: http://jira.codehaus.org/browse/WAGON-82
>             Project: Maven Wagon
>          Issue Type: Bug
>          Components: wagon-webdav
>    Affects Versions: 1.0-beta-2
>         Environment: any system
>            Reporter: Marc Wilhelm
>            Assignee: Brett Porter
>            Priority: Blocker
>             Fix For: 1.0-beta-3
>
>         Attachments: 0001-Added-the-ProxyInfoProvider-interface-in-order-to-fi.patch, 0001-Make-the-artifact-manager-using-wagons-ProxyInfoProv.patch, WAGON-82-maven-artifact-manager.patch, WAGON-82-tested-maven-artifact-manager.patch, WAGON-82-tested-wagon.patch, WAGON-82-wagon.patch, 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

        

[jira] Commented: (WAGON-82) wagon-webdav does not set http-proxy correctly

Posted by "Emmanuel Venisse (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/WAGON-82?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_94317 ] 

Emmanuel Venisse commented on WAGON-82:
---------------------------------------

can you provide a patch instead of explain how to do it? Thanks.

> 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
>
> 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

        

[jira] Commented: (WAGON-82) wagon-webdav does not set http-proxy correctly

Posted by "Marc Wilhelm (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/WAGON-82?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_94322 ] 

Marc Wilhelm commented on WAGON-82:
-----------------------------------

yepp. I am actually setting up a new testcase which uses a proxy connection to verify the patch. when its done, i will upload the patch.

> 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
>
> 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

        

[jira] Updated: (WAGON-82) wagon-webdav does not set http-proxy correctly

Posted by "Jochen Wiedmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/WAGON-82?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jochen Wiedmann updated WAGON-82:
---------------------------------

    Attachment: 0001-Make-the-artifact-manager-using-wagons-ProxyInfoProv.patch

Updated patch for the artifact manager to use the wagon ProxyInfoProvider. Note, that it is possibly to apply this patch later on.


> 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
>            Assignee: Brett Porter
>            Priority: Blocker
>         Attachments: 0001-Added-the-ProxyInfoProvider-interface-in-order-to-fi.patch, 0001-Make-the-artifact-manager-using-wagons-ProxyInfoProv.patch, WAGON-82-maven-artifact-manager.patch, WAGON-82-tested-maven-artifact-manager.patch, WAGON-82-tested-wagon.patch, WAGON-82-wagon.patch, 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

        

[jira] Commented: (WAGON-82) wagon-webdav does not set http-proxy correctly

Posted by "Jochen Wiedmann (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/WAGON-82?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_100428 ] 

Jochen Wiedmann commented on WAGON-82:
--------------------------------------

I've got updated versions of the patches ready, which work for me. After testing, I actually wonder whether anyone got dav via proxy working at all, because I found another bug. Even if the proxy is set on the webdavResource, it isn't used, because the resources internal instance of HttpClient isn't updated. I have added a call to webdavResource.closeSession().

I also noticed, that I receive a lot of warnings like 

    WARNING: Default credentials for httpprox.hq.sag not available
    WARNING: Preemptive proxy authentication failed

I would assume that these are related to a superfluous call to setAuthorizationPreemptive() within the webdav library. I didn't bother to track this down, because the warning is nasty, but ignorable.

I have attempted to add the updated patches to Jira. Unfortunately, this is currently not possible for me, because I receive an error message whenever I try to attach a file, Please contact me, if you are interested in the updated files.


> 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-82-maven-artifact-manager.patch, WAGON-82-wagon.patch, 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

        

[jira] Updated: (WAGON-82) wagon-webdav does not set http-proxy correctly

Posted by "Arnaud Heritier (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/WAGON-82?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Arnaud Heritier updated WAGON-82:
---------------------------------

    Attachment: WAGON-82-tested-maven-artifact-manager.patch

>From : Jochen Wiedmann

> 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-82-maven-artifact-manager.patch, WAGON-82-tested-maven-artifact-manager.patch, WAGON-82-tested-wagon.patch, WAGON-82-wagon.patch, 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

        

[jira] Updated: (WAGON-82) wagon-webdav does not set http-proxy correctly

Posted by "Marc Wilhelm (JIRA)" <ji...@codehaus.org>.
     [ 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

        

[jira] Updated: (WAGON-82) wagon-webdav does not set http-proxy correctly

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/WAGON-82?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brett Porter updated WAGON-82:
------------------------------

    Fix Version/s: 1.0-beta-3

> wagon-webdav does not set http-proxy correctly
> ----------------------------------------------
>
>                 Key: WAGON-82
>                 URL: http://jira.codehaus.org/browse/WAGON-82
>             Project: Maven Wagon
>          Issue Type: Bug
>          Components: wagon-webdav
>    Affects Versions: 1.0-beta-2
>         Environment: any system
>            Reporter: Marc Wilhelm
>            Assignee: Brett Porter
>            Priority: Blocker
>             Fix For: 1.0-beta-3
>
>         Attachments: 0001-Added-the-ProxyInfoProvider-interface-in-order-to-fi.patch, 0001-Make-the-artifact-manager-using-wagons-ProxyInfoProv.patch, WAGON-82-maven-artifact-manager.patch, WAGON-82-tested-maven-artifact-manager.patch, WAGON-82-tested-wagon.patch, WAGON-82-wagon.patch, 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

        

[jira] Commented: (WAGON-82) wagon-webdav does not set http-proxy correctly

Posted by "Jochen Wiedmann (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/WAGON-82?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_99276 ] 

Jochen Wiedmann commented on WAGON-82:
--------------------------------------

I strongly disagree with the solutions discussed so far. IMO, they are all basically hacks.

IMO, the actual problem is, that not the wagon provider itself decides on the use of proxies, but the DefaultWagonManager. It does so, based on the "protocol". A far better solution would be, either

- to give the proxy settings to the wagon provider and let him decide, whether to use them or not, or.
  The best way to do this would be a new interface, for example

      package org.apache.maven.wagon;
      public interface ProxyProvider {
           /* Returns a proxy for the given protocol, if available, or null.
            */
          public ProxyInfo getProxyForProtocol(String protocol);
      }

  The proxy provider might have a setter for ProxyProvider, which the DefaultWagonManager might invoke.

- to introduce a new method (for example isProxyInfoRequired(String url)), which the DefaultWagonManager
  uses to query the wagon provider, whether it wants proxy settings or not.


> 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

        

[jira] Updated: (WAGON-82) wagon-webdav does not set http-proxy correctly

Posted by "Jochen Wiedmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/WAGON-82?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jochen Wiedmann updated WAGON-82:
---------------------------------

    Attachment: WAGON-82-wagon.patch
                WAGON-82-maven-artifact-manager.patch

Proposed alternative patch. Has yet to be tested.


> 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-82-maven-artifact-manager.patch, WAGON-82-wagon.patch, 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

        

[jira] Commented: (WAGON-82) wagon-webdav does not set http-proxy correctly

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/WAGON-82?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_100647 ] 

Brett Porter commented on WAGON-82:
-----------------------------------

Arnaud - if this is working, please go ahead and apply it.

> 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-82-maven-artifact-manager.patch, WAGON-82-tested-maven-artifact-manager.patch, WAGON-82-tested-wagon.patch, WAGON-82-wagon.patch, 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

        

[jira] Commented: (WAGON-82) wagon-webdav does not set http-proxy correctly

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/WAGON-82?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=136229#action_136229 ] 

Brett Porter commented on WAGON-82:
-----------------------------------

applied the patch to wagon - this is a useful concept, since we may have a situation where the ssh wagons want multiple proxies also

> wagon-webdav does not set http-proxy correctly
> ----------------------------------------------
>
>                 Key: WAGON-82
>                 URL: http://jira.codehaus.org/browse/WAGON-82
>             Project: Maven Wagon
>          Issue Type: Bug
>          Components: wagon-webdav
>    Affects Versions: 1.0-beta-2
>         Environment: any system
>            Reporter: Marc Wilhelm
>            Assignee: Brett Porter
>            Priority: Blocker
>             Fix For: 1.0-beta-3
>
>         Attachments: 0001-Added-the-ProxyInfoProvider-interface-in-order-to-fi.patch, 0001-Make-the-artifact-manager-using-wagons-ProxyInfoProv.patch, WAGON-82-maven-artifact-manager.patch, WAGON-82-tested-maven-artifact-manager.patch, WAGON-82-tested-wagon.patch, WAGON-82-wagon.patch, 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