Gradlew Wrapper task is unable to download m8

(Justin Ryan) #1

I have this task:

task createWrapper(type: Wrapper) {
    gradleVersion = '1.0-milestone-8'

After I run it, I get the normal gradlew files, but the URL for the distribution is pointing a location which doesn’t exists and I get this error:

  Exception in thread "main"
 at org.gradle.wrapper.Download.downloadInternal(
 at org.gradle.wrapper.Install.createDist(
 at org.gradle.wrapper.WrapperExecutor.execute(
 at org.gradle.wrapper.GradleWrapperMain.main(

It looks like is the new location, but the Wrapper task has hardcoded. I’m not sure if is the right URL, but it’d sure be nice is the was moved to

(Justin Ryan) #2

I should also mention that this breaks my Artifactory proxy/caching repository, which is configured for

(Peter Niederwieser) #3

The simplest solution is to edit and point it to the new URL.

(Luke Daley) #4

You can change your proxy configuration to point to:

(Luke Daley) #5

So there are a couple of ways to fix this:

Update ‘gradle/’ to have this entry:


Or you can change your wrapper task definition to look like this:

task wrapper(type: Wrapper) {

distributionUrl = “” }

(Michael Holm) #6

it looks like the distributions have moved yet again. all the artifacts at the http://services… url are redirect html files. Your browser will know how to navigate that redirect but unfortunately curl -O doesn’t. Perhaps there is another flag that will make curl smarter. But the new url looks to be:

(Luke Daley) #7

The URLs have always been redirects. Were you previously using the URLs without the -O flag?

(Michael Holm) #8

no but my gradle wrapper task was unable to follow the redirect and just downloded a ~300B html file instead of a 32M zip which gradlew was then unable to use:

[08:57]~/workspace/gc/rsp/rs (svn::/UI/RS/trunk)$ gradlew -v Unzipping /Users/mholm/.gradle/wrapper/dists/ to /Users/mholm/.gradle/wrapper/dists Exception in thread “main” error in opening zip file

at Method)



at org.gradle.wrapper.Install.unzip(

at org.gradle.wrapper.Install.createDist(

at org.gradle.wrapper.Wrapper.execute(

at org.gradle.wrapper.WrapperMain.main(

So I downloaded the zip from the redirect URL, put it in the wrapper/dists dir, and though I am still getting an error, it is a different one leading me to believe that I am further along :slight_smile:

(Luke Daley) #9

I’m not sure what’s happened here. The wrapper definitely follows redirects, and the redirect page does not server HTML. Any chance you can post what was in the HTML file?

(Michael Holm) #10

<table border='0' cellpadding='0' cellspacing='0' width='100%'

style=‘font-family: Arial,Helvetica,sans-serif;font-size:12px;padding-left: 10px;’>

<img id='headerimage' name='headerimage'


onload=‘callToSetImageSize(this)’ style=‘visibility:hidden’>

Dear <font


This is a

message from the IT Department.

The web site you are trying to access:

is listed as a

site within the category {category}


class=accessdeniedtextfont> Current Internet Access Configuration does not allow you to visit

sites within this category at this time.

<img id='footerimage' name='footerimage'


onload=‘callToSetImageSize(this)’ style=‘visibility:hidden’>

(Michael Holm) #11

well…that didn’t work great…is there a way to post html without it getting interpreted?

(Luke Daley) #12

You’d have to HTML encode it (

This means that your corporate firewall intercepted the request and blocked it. This isn’t a page that we serve.

(Michael Holm) #13

well that’s a bummer… thanks for the help. guess i’ll get the zip with curl and put it in scm in case they move again.

here’s the encoded html btw:

<html> <head>

<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/>


<script type='text/javascript'>function setImageSize() {

var ele1 = document.getElementById('headerimage');

var ele2 = document.getElementById('footerimage');




function setHeightWidth(ele) {

var h = ele.offsetHeight;

var w = ele.offsetWidth;

if (ele.offsetWidth > 700) {

ele.width = 700;

} else {

ele.width = w;


if (ele.offsetHeight > 80) {

ele.height = 80;

} else {

ele.height = h;


}</script> </head> <body onload='setImageSize()' leftmargin='0' topmargin='0' marginheight='0' marginwidth='0'> <form name='previewform'>

<table border='0' cellpadding='0' cellspacing='0' width='100%'

style='font-family: Arial,Helvetica,sans-serif;font-size:12px;padding-left: 10px;'>


<td align='center'>&nbsp;<br/><img id='headerimage' name='headerimage'


onload='callToSetImageSize(this)' style='visibility:hidden'></img></td>



<td align='left'><br>

<div id='message'><font class=accessdeniedtextfont><b><BR>Dear </font><font

class=accessdeniedcategoryfont>{user},</font><BR><BR><font class=accessdeniedtextfont>This is a

message from the IT Department. <BR><BR>The web site you are trying to access: <BR></font><font

class=accessdeniedcategoryfont>{url}</font><BR><font class=accessdeniedtextfont>is listed as a

site within the category </font><font class=accessdeniedcategoryfont>{category}</font><BR><BR><font

class=accessdeniedtextfont> Current Internet Access Configuration does not allow you to visit

sites within this category at this time.<BR></font></div>




<td align='center'><img id='footerimage' name='footerimage'


onload='callToSetImageSize(this)' style='visibility:hidden'></img></td>


</table> </form> </body> <script language="JavaScript"> var heightVar, widthVar, timeoutInterval = 50; function setHeightWidth() {

var diff, reducePer, tempVar;

if (widthVar > 700) {

diff = widthVar - 700;

reducePer = 100 * diff / widthVar;

tempVar = reducePer * widthVar / 100;

widthVar = widthVar - tempVar;

tempVar = reducePer * heightVar / 100;

heightVar = heightVar - tempVar;


if (heightVar > 80) {

diff = heightVar - 80;

reducePer = 100 * diff / heightVar;

tempVar = reducePer * heightVar / 100;

heightVar = heightVar - tempVar;

tempVar = reducePer * widthVar / 100;

widthVar = widthVar - tempVar;

} } function setImageSize(imgName) {

if (document.getElementById(imgName) && document.getElementById(imgName).offsetWidth != 0 && document.getElementById(imgName).offsetHeight != 0) {

widthVar = document.getElementById(imgName).offsetWidth;

heightVar = document.getElementById(imgName).offsetHeight;


document.getElementById(imgName).width = widthVar;

document.getElementById(imgName).height = heightVar;

document.getElementById(imgName).style.visibility = '';

} else {

setTimeout('setImageSize()', timeoutInterval);

} } function callToSetImageSize(obj) {

if (navigator.appName.indexOf("Opera") != -1) {

timeoutInterval = 350;


setTimeout('setImageSize("' + + '")', timeoutInterval); } </script> </html>