Compile fails on Gitlab/Ubuntu (only)

When I do a gradle clean install it succeeds on windows, however on Gitlab (Ubuntu) the same clean install fails with a compilation error (using gradlew, gradle version 4.3.1, jdk 1.8).

After some research I found out the following: when I clear the cuba libraries in the gradle cache folder, and do a clean install, I see that on windows it downloads the cuba repo libraries of version 6.10.8 (which is the configured cuba platform version in build.gradle: ext.cubaVersion = ‘6.10.8’).
On Ubuntu I see that it correctly downloads cuba-gui 6.10.8, but for some other libraries (e.g. cuba-global and cuba-core) it downloads the incorrect version 7.0.4 !!
It seems that this inconsistency causes the compilation problems.

Why does this happen?

Hi,
You can invoke this command:

$ ./gradlew dependencies

to investigate where incorrect 7.0.4 version comes from.

Yes! I should have done that by myself (gradle dependencies). My bad.
I didn’t expect it, but it appears that an addon pulls a dependency to Cuba 7.0.4 into the project.

And the reason for the difference between the two environments was that I did not clear the whole gradle cache (I forgot to clear com.haulmont.addon), which I should have done.

Thanks!