You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Paolo Castagna <pa...@hplb.hpl.hp.com> on 2009/06/10 10:33:20 UTC

mvn test -DproxyHost=... -DproxyPort=...

Hi,
I need to run a test suite which needs to connect to public web servers and
I am behind a web proxy.

I use:

  mvn test -DproxyHost=... -DproxyPort=...
  mvn test -DproxySet=true -DproxyHost=... -DproxyPort=...

Everything works fine with Maven v2.0.9 but with Maven v2.0.10 or v2.1.0
seems to me that the proxy does not get used.

I am probably missing something obvious...

Any help?

Paolo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: mvn test -DproxyHost=... -DproxyPort=...

Posted by Robert Glover <ro...@yahoo.com>.
Hi Paolo,
     Thanks for the reply back.  Actually, the group had told me earlier that unless a number of people experienced the same problem I was having, it is unrealistic to expect a resolution because proxy issues are so difficult to figure out. But to answer your question, I use the same proxy config within settings.xml.  When I use maven 2.0.9 the proxy works fine. However when I change to maven 2.1.0  (or also, I think but it's been a while so I'm not 100% sure, also with 2.0.10) the proxy fails.  The only solution for me is to stick with maven 2.0.9.  When each new version of maven comes out (I think maven 3 may be the next one to come out?), I'll give it a try.  When a future version works for me,  I'll upgrade then.
   My guess is that m2eclipse (the maven eclipse plugin) uses an embedded version of maven and so maybe is not affected by what version of maven I use.  that is just a guess. m2eclipse continues to work fine even when I upgrade to maven 2.1.0. I wonder if that is significant or not?
Robert



----- Original Message ----
From: Paolo Castagna <pa...@hplb.hpl.hp.com>
To: Maven Users List <us...@maven.apache.org>
Sent: Wednesday, June 10, 2009 9:52:52 AM
Subject: Re: mvn test -DproxyHost=... -DproxyPort=...

Hi Robert,
thank you for your reply.

But, no... I do not see any "access denied" problem when I run Maven in debug mode.
It definitely downloaded the surefire plugin v2.4.3 and the plugin is used to run the
tests. However, it seems to me that the plugin is ignoring the -DproxyHost=... and
-DproxyPort=... options.

Are you sure you have properly configured your web proxy in $MAVEN_HOME/conf/settings.xml ?

Your problem is different: Maven is not able to download the surefire plugin using
your web proxy.

Paolo

Robert Glover wrote:
> I'm having the same problem.  Below I paste the error message I get. (I posted this a few days earlier as well).  Is this similar to the error you receive? (Note you need to use the -X option on the mvn command you are using to make the expanded console output appear so that you can see if you too get this error message).
> 
> ...snip...
> [DEBUG] Connecting to repository: 'central' with url: 'http://repo1.maven.org/maven2'.
> [DEBUG] Using Proxy: b1web1.obfuscated.org
> Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.4.3/maven-surefire-plugin-2.4.3.pom
> [DEBUG] Access denied to: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.4.3/maven-surefire-plugin-2.4.3.pom
> org.apache.maven.wagon.authorization.AuthorizationException: Access denied to: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.4.3/maven-surefire-plugin-2.4.3.pom
>     at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:119)
>     at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)
>     at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
>     at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
>     at org.apache.maven.artifact.manager.DefaultWagonManager.getRemoteFile(DefaultWagonManager.java:491)
>     at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:372)
>   ...snip...
> 
> 
> 
> 
> ----- Original Message ----
> From: Paolo Castagna <pa...@hplb.hpl.hp.com>
> To: "users@maven.apache.org" <us...@maven.apache.org>
> Sent: Wednesday, June 10, 2009 4:33:20 AM
> Subject: mvn test -DproxyHost=... -DproxyPort=...
> 
> Hi,
> I need to run a test suite which needs to connect to public web servers and
> I am behind a web proxy.
> 
> I use:
> 
> mvn test -DproxyHost=... -DproxyPort=...
> mvn test -DproxySet=true -DproxyHost=... -DproxyPort=...
> 
> Everything works fine with Maven v2.0.9 but with Maven v2.0.10 or v2.1.0
> seems to me that the proxy does not get used.
> 
> I am probably missing something obvious...
> 
> Any help?
> 
> Paolo
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: mvn test -DproxyHost=... -DproxyPort=...

Posted by Paolo Castagna <pa...@hplb.hpl.hp.com>.
Hi Robert,
thank you for your reply.

But, no... I do not see any "access denied" problem when I run Maven in debug mode.
It definitely downloaded the surefire plugin v2.4.3 and the plugin is used to run the
tests. However, it seems to me that the plugin is ignoring the -DproxyHost=... and
-DproxyPort=... options.

Are you sure you have properly configured your web proxy in $MAVEN_HOME/conf/settings.xml ?

Your problem is different: Maven is not able to download the surefire plugin using
your web proxy.

Paolo

Robert Glover wrote:
> I'm having the same problem.  Below I paste the error message I get. (I posted this a few days earlier as well).  Is this similar to the error you receive? (Note you need to use the -X option on the mvn command you are using to make the expanded console output appear so that you can see if you too get this error message).
> 
> ...snip...
> [DEBUG] Connecting to repository: 'central' with url: 'http://repo1.maven.org/maven2'.
> [DEBUG] Using Proxy: b1web1.obfuscated.org
> Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.4.3/maven-surefire-plugin-2.4.3.pom
> [DEBUG] Access denied to: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.4.3/maven-surefire-plugin-2.4.3.pom
> org.apache.maven.wagon.authorization.AuthorizationException: Access denied to: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.4.3/maven-surefire-plugin-2.4.3.pom
>     at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:119)
>     at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)
>     at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
>     at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
>     at org.apache.maven.artifact.manager.DefaultWagonManager.getRemoteFile(DefaultWagonManager.java:491)
>     at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:372)
>   ...snip...
> 
> 
> 
> 
> ----- Original Message ----
> From: Paolo Castagna <pa...@hplb.hpl.hp.com>
> To: "users@maven.apache.org" <us...@maven.apache.org>
> Sent: Wednesday, June 10, 2009 4:33:20 AM
> Subject: mvn test -DproxyHost=... -DproxyPort=...
> 
> Hi,
> I need to run a test suite which needs to connect to public web servers and
> I am behind a web proxy.
> 
> I use:
> 
> mvn test -DproxyHost=... -DproxyPort=...
> mvn test -DproxySet=true -DproxyHost=... -DproxyPort=...
> 
> Everything works fine with Maven v2.0.9 but with Maven v2.0.10 or v2.1.0
> seems to me that the proxy does not get used.
> 
> I am probably missing something obvious...
> 
> Any help?
> 
> Paolo
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: mvn test -DproxyHost=... -DproxyPort=...

Posted by Robert Glover <ro...@yahoo.com>.
I'm having the same problem.  Below I paste the error message I get. (I posted this a few days earlier as well).  Is this similar to the error you receive? (Note you need to use the -X option on the mvn command you are using to make the expanded console output appear so that you can see if you too get this error message).

...snip...
[DEBUG] Connecting to repository: 'central' with url: 'http://repo1.maven.org/maven2'.
[DEBUG] Using Proxy: b1web1.obfuscated.org
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.4.3/maven-surefire-plugin-2.4.3.pom
[DEBUG] Access denied to: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.4.3/maven-surefire-plugin-2.4.3.pom
org.apache.maven.wagon.authorization.AuthorizationException: Access denied to: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.4.3/maven-surefire-plugin-2.4.3.pom
    at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:119)
    at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)
    at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
    at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
    at org.apache.maven.artifact.manager.DefaultWagonManager.getRemoteFile(DefaultWagonManager.java:491)
    at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:372)
  ...snip...




----- Original Message ----
From: Paolo Castagna <pa...@hplb.hpl.hp.com>
To: "users@maven.apache.org" <us...@maven.apache.org>
Sent: Wednesday, June 10, 2009 4:33:20 AM
Subject: mvn test -DproxyHost=... -DproxyPort=...

Hi,
I need to run a test suite which needs to connect to public web servers and
I am behind a web proxy.

I use:

mvn test -DproxyHost=... -DproxyPort=...
mvn test -DproxySet=true -DproxyHost=... -DproxyPort=...

Everything works fine with Maven v2.0.9 but with Maven v2.0.10 or v2.1.0
seems to me that the proxy does not get used.

I am probably missing something obvious...

Any help?

Paolo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: mvn test -DproxyHost=... -DproxyPort=...

Posted by Paolo Castagna <pa...@hplb.hpl.hp.com>.
Paolo Castagna wrote:
> Paolo Castagna wrote:
>> Hi,
>> I need to run a test suite which needs to connect to public web servers and
>> I am behind a web proxy.
>>
>> I use:
>>
>>   mvn test -DproxyHost=... -DproxyPort=...
>>   mvn test -DproxySet=true -DproxyHost=... -DproxyPort=...
>>
>> Everything works fine with Maven v2.0.9 but with Maven v2.0.10 or v2.1.0
>> seems to me that the proxy does not get used.
>>
>> I am probably missing something obvious...
> 
> I think the problem comes from the surefire plugin v2.4.3 used by Maven v2.0.10.
> 
> If I use the surefire plugin v2.4.2 I can see a lot of messages for system
> properties, including:
> 
>    [DEBUG] Setting system property [proxyHost]=[...]
>    [DEBUG] Setting system property [proxyPort]=[...]
> 
> This does not happen using the surefire plugin v2.4.3.
> 
> So, now, I forced v2.4.2 in my pom.xml:
> 
>        <plugin>
>          <groupId>org.apache.maven.plugins</groupId>
>          <artifactId>maven-surefire-plugin</artifactId>
>          <version>2.4.2</version>
>          [...]
>        </plugin>
> 
> Is this a known problem?

Yes, apparently this is a known BUG and it is not limited to proxyHost or proxyPort
system properties... but, of course, is very bad for people who need to run test
suites behind a web proxy:

  "This bug is preventing us from using 2.4.3, as we're running our tests behind
   a proxy, i.e. ('mvn test -Dhttp.proxyHost=<proxyHost>
   -Dhttp.proxyPort=<proxyPort>), and the system properties http.proxyHost and
   http.proxyPort are being passed in as null. With 2.4.2, it works fine."
   -- http://jira.codehaus.org/browse/SUREFIRE-121

Paolo

> 
> Paolo
> 
>> Any help?
>>
>> Paolo
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: mvn test -DproxyHost=... -DproxyPort=...

Posted by Paolo Castagna <pa...@hplb.hpl.hp.com>.
Paolo Castagna wrote:
> Hi,
> I need to run a test suite which needs to connect to public web servers and
> I am behind a web proxy.
> 
> I use:
> 
>   mvn test -DproxyHost=... -DproxyPort=...
>   mvn test -DproxySet=true -DproxyHost=... -DproxyPort=...
> 
> Everything works fine with Maven v2.0.9 but with Maven v2.0.10 or v2.1.0
> seems to me that the proxy does not get used.
> 
> I am probably missing something obvious...

I think the problem comes from the surefire plugin v2.4.3 used by Maven v2.0.10.

If I use the surefire plugin v2.4.2 I can see a lot of messages for system
properties, including:

   [DEBUG] Setting system property [proxyHost]=[...]
   [DEBUG] Setting system property [proxyPort]=[...]

This does not happen using the surefire plugin v2.4.3.

So, now, I forced v2.4.2 in my pom.xml:

       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <version>2.4.2</version>
         [...]
       </plugin>

Is this a known problem?

Paolo

> Any help?
> 
> Paolo


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org