[ 
https://issues.apache.org/jira/browse/IVY-1435?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

jaikiran pai resolved IVY-1435.
-------------------------------
       Resolution: Resolved
    Fix Version/s: master

As you note, Ant added the support for {{useragent}} attribute for the {{get}} 
task starting 1.9.3 release of Ant[1]. As noted in its docs, the value for it 
defaults to {{Apache Ant <version>}}. This should solve the original issue 
reported in this JIRA. 

[1] http://ant.apache.org/manual-1.9.x/Tasks/get.html

P.S: The {{get}} task is internally invoked via Ivy's packager resolver and it 
internally doesn't override the {{useragent}} value to anything specific. 
Unless there is a real use case or a request to allow it to be overridden while 
configuring this resolver, we will continue to let Ant use their default value.

> Ivy does not override HTTP User-Agent for Packager resolver requests
> --------------------------------------------------------------------
>
>                 Key: IVY-1435
>                 URL: https://issues.apache.org/jira/browse/IVY-1435
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.3.0
>            Reporter: Archie Cobbs
>            Priority: Minor
>             Fix For: master
>
>
> Not sure if this link is public or not, but here is some background: 
> http://support.sonatype.com/tickets/2468
> Basically, due to some unspecified "abuse" Maven central has blocked access 
> for HTTP clients with "Java" as their User-Agent for the "scala-library" 
> module (at least).
> This causes resolution of this module via Ivy RoundUp to fail, because the 
> Packager resolver's HTTP requests do not override the default "Java" 
> User-Agent.
> Need to fix/update the Packager resolver to go through the same logic as 
> normal Url Resolver.
> Problem occurs whether or not commons-httpclient is used.
> {noformat}
> $ grep scala src/ivy/ivy.xml 
>         <dependency force="true" org="org.scala-lang" name="scala-library" 
> rev="2.10.2" conf="base->default"/>
> $ ant -v javac.classpath
> ...
> [ivy:resolve] Loading 
> jar:file:/usr/share/java/ivy.jar!/org/apache/ivy/core/settings/ivy.properties
> [ivy:resolve] impossible to define new type: class not found: 
> org.apache.ivy.plugins.signer.bouncycastle.OpenPGPSignatureGenerator in [] 
> nor Ivy classloader
> [ivy:resolve] :: Apache Ivy 2.3.0-local-20130129124219 - 20130129124219 :: 
> http://ant.apache.org/ivy/ ::
> [ivy:resolve] jakarta commons httpclient detected: using it for http 
> downloading
> [ivy:resolve] no proxy configured
> [ivy:resolve] :: loading settings :: file = 
> /home/archie/svn/eng/proj/pcom/trunk/src/build/ivysettings.xml
> [ivy:resolve] no default ivy user dir defined: set to /home/archie/.ivy2
> [ivy:resolve] no default cache defined: set to /home/archie/.ivy2/cache
> [ivy:resolve] settings loaded (99ms)
> ...
> [ivy:resolve] download.1.N1000B:
> [ivy:resolve] 
> [ivy:resolve]       [get] Getting: 
> http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.10.2/scala-library-2.10.2.jar
> [ivy:resolve] 
> [ivy:resolve]       [get] To: 
> /home/archie/.ivy2/packager/cache/scala-library-2.10.2.jar
> [ivy:resolve] 
> [ivy:resolve]       [get] Error opening connection java.io.IOException: 
> Server returned HTTP response code: 403 for URL: 
> http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.10.2/scala-library-2.10.2.jar
> [ivy:resolve] 
> [ivy:resolve]       [get] Error opening connection java.io.IOException: 
> Server returned HTTP response code: 403 for URL: 
> http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.10.2/scala-library-2.10.2.jar
> [ivy:resolve] 
> [ivy:resolve]       [get] Error opening connection java.io.IOException: 
> Server returned HTTP response code: 403 for URL: 
> http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.10.2/scala-library-2.10.2.jar
> {noformat}
> tcpdump:
> {noformat}
> 10:33:14.448797 IP (tos 0x0, ttl 64, id 5765, offset 0, flags [DF], proto TCP 
> (6), length 273)
>     173.230.134.93.49463 > 199.27.75.185.80: Flags [P.], cksum 0x481c 
> (incorrect -> 0x9aee), seq 1:222, ack 1, win 115, options [nop,nop,TS val 
> 2578795345 ecr 221332757], length 221
>       0x0000:  4500 0111 1685 4000 4006 dc49 ade6 865d  E.....@.@..I...]
>       0x0010:  c71b 4bb9 c137 0050 f657 5dbe c2ef d7f8  ..K..7.P.W].....
>       0x0020:  8018 0073 481c 0000 0101 080a 99b5 4b51  ...sH.........KQ
>       0x0030:  0d31 4515 4745 5420 2f6d 6176 656e 322f  .1E.GET./maven2/
>       0x0040:  6f72 672f 7363 616c 612d 6c61 6e67 2f73  org/scala-lang/s
>       0x0050:  6361 6c61 2d6c 6962 7261 7279 2f32 2e31  cala-library/2.1
>       0x0060:  302e 322f 7363 616c 612d 6c69 6272 6172  0.2/scala-librar
>       0x0070:  792d 322e 3130 2e32 2e6a 6172 2048 5454  y-2.10.2.jar.HTT
>       0x0080:  502f 312e 310d 0a55 7365 722d 4167 656e  P/1.1..User-Agen
>       0x0090:  743a 204a 6176 612f 312e 372e 305f 3231  t:.Java/1.7.0_21
>       0x00a0:  0d0a 486f 7374 3a20 7265 706f 312e 6d61  ..Host:.repo1.ma
>       0x00b0:  7665 6e2e 6f72 670d 0a41 6363 6570 743a  ven.org..Accept:
>       0x00c0:  2074 6578 742f 6874 6d6c 2c20 696d 6167  .text/html,.imag
>       0x00d0:  652f 6769 662c 2069 6d61 6765 2f6a 7065  e/gif,.image/jpe
>       0x00e0:  672c 202a 3b20 713d 2e32 2c20 2a2f 2a3b  g,.*;.q=.2,.*/*;
>       0x00f0:  2071 3d2e 320d 0a43 6f6e 6e65 6374 696f  .q=.2..Connectio
>       0x0100:  6e3a 206b 6565 702d 616c 6976 650d 0a0d  n:.keep-alive...
>       0x0110:  0a                                       .
> ...
> 10:33:14.466163 IP (tos 0x0, ttl 59, id 37603, offset 0, flags [DF], proto 
> TCP (6), length 742)
>     199.27.75.185.80 > 173.230.134.93.49463: Flags [P.], cksum 0xf7e1 
> (correct), seq 1:691, ack 222, win 31, options [nop,nop,TS val 221332762 ecr 
> 2578795345], length 690
>       0x0000:  4500 02e6 92e3 4000 3b06 6316 c71b 4bb9  E.....@.;.c...K.
>       0x0010:  ade6 865d 0050 c137 c2ef d7f8 f657 5e9b  ...].P.7.....W^.
>       0x0020:  8018 001f f7e1 0000 0101 080a 0d31 451a  .............1E.
>       0x0030:  99b5 4b51 4854 5450 2f31 2e31 2034 3033  ..KQHTTP/1.1.403
>       0x0040:  2044 656e 6965 6420 4163 6365 7373 0d0a  .Denied.Access..
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to