Question

Since today, the builds of one of my projects fail on Travis CI, because of issues in unzipping gradle 1.11. This applies to newer builds as well as old builds that were executed fine days ago. gradlew assemble works fine on my local machine, it only fails on Travis CI. The output of the build is the following:

Using worker: worker-linux-6-2.bb.travis-ci.org:travis-linux-9

$ git clone --depth=50 --branch=master git://github.com/lenhard/pete.git lenhard/pete
Cloning into 'lenhard/pete'...
remote: Counting objects: 779, done.
remote: Compressing objects: 100% (567/567), done.
remote: Total 779 (delta 325), reused 571 (delta 134)
Receiving objects: 100% (779/779), 4.20 MiB | 0 bytes/s, done.
Resolving deltas: 100% (325/325), done.
Checking connectivity... done.
$ cd lenhard/pete
$ git checkout -qf 5bef29676d981c7de80517950cbb9b1bb85bba00
$ jdk_switcher use oraclejdk8
Switching to Oracle JDK8 (java-8-oracle), JAVA_HOME will be set to /usr/lib/jvm/java-8-oracle
update-alternatives: error: no alternatives for apt.
$ java -version
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b128)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b69, mixed mode)
$ javac -version
javac 1.8.0
before_install
$ chmod +x gradlew
$ ./gradlew assemble
Downloading http://services.gradle.org/distributions/gradle-1.11-bin.zip

Unzipping /home/travis/.gradle/wrapper/dists/gradle-1.11-bin/4h5v8877arc3jhuqbm3osbr7o7/gradle-1.11-bin.zip to /home/travis/.gradle/wrapper/dists/gradle-1.11-bin/4h5v8877arc3jhuqbm3osbr7o7
Exception in thread "main" java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:220)
at java.util.zip.ZipFile.<init>(ZipFile.java:150)
at java.util.zip.ZipFile.<init>(ZipFile.java:164)
at org.gradle.wrapper.Install.unzip(Install.java:148)
at org.gradle.wrapper.Install.createDist(Install.java:65)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:47)

Travis tries to repeat gradlew assemble two more times, but fails ultimately. My .travis.yml is really simple:

language: java
jdk:
  - oraclejdk8

before_install:
 - chmod a+x gradlew

Where could this issue come from? When accessing http://services.gradle.org/distributions/gradle-1.11-bin.zip from my machine, I get a proper distribution that can be unzipped and works. Could this be related to the fact that I use JDK 1.8?

Was it helpful?

Solution

The issue was neither caused by Travis CI, nor by the project configuration. Instead, it seems that the gradle wrapper had problems following redirects for a new host. This came from the enablement of https downloads for the wrapper at gradle.org. The problem was fixed on their side and everything is back to normal now.

More info on this problem can be found in the gradle forums.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top