Building a multi-module gradle project in Travis CI

I am trying to create a project with several Gradle modules to create in Travis CI and run all tests from all subprojects. By default, executing the build from the top level build.gradle file seems to create all the submodules and run all the tests, but Travis sees this as a failure. Ideally, I would also like to combine Jacoco test coverage reports from all subprojects.

The project I'm trying to work on is open source and can be seen here: https://github.com/Tenkiv/Physikal

+4
source share
1 answer

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

./gradlew build

And I got the same error message:

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

This is really strange, and I have never seen him before. So I asked myself: where is gradle looking for this class? Right, in the wrapper container file. And it seems 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 happens, your loaded gradle wrapper is empty. You need to load the shell again, on Linux you can use this command (if you have gradle installed):

gradle wrapper

If your local gradle distribution is out of date and you want to keep the version used in your repo, do:

gradle wrapper --gradle-version=4.1
+2
source

Source: https://habr.com/ru/post/1685784/


All Articles