4

I am trying to get a multi-module Gradle project to build in Travis CI and run all tests from all sub projects. By default running build from the top level build.gradle file seems to build all submodules and run all tests but Travis sees it as a failure. Ideally I'd also like to combine the Jacoco test coverage reports from all sub projects.

The project I am trying to get this working on is open source and can be seen here: https://github.com/Tenkiv/Physikal

zjuhasz
  • 1,489
  • 12
  • 30

1 Answers1

2

Trying to understand your problem, I cloned the repository and tried to run gradle on my local machine (ArchLinux) the same way Travis tries:

./gradlew build

And I got the exact same error message:

Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain

This is really strange and I have never seen it before. So I asked myself: Where does gradle search for that class? Right, in the wrapper's jar file. And that seems to be empty:

$ ls -lh gradle/wrapper/
total 4.0K
-rw-r--r-- 1 msrd0 users   0 Sep 16 23:51 gradle-wrapper.jar
-rw-r--r-- 1 msrd0 users 230 Sep 16 23:51 gradle-wrapper.properties

TL;DR

Whatever happened, your downloaded gradle wrapper is empty. You need to download the wrapper again, on Linux you can use this command (assuming you have gradle installed):

gradle wrapper

If your local gradle distribution is old and you want to keep the version that's currently used in your repo, run:

gradle wrapper --gradle-version=4.1
msrd0
  • 7,816
  • 9
  • 47
  • 82