thingsboard icon indicating copy to clipboard operation
thingsboard copied to clipboard

Build fails for Thingsboard V3.7.0

Open fjpanag opened this issue 1 year ago • 1 comments

Describe the bug I just cloned this repo and tried a build:

mvn clean install -DskipTests 

The build fails for the HTTP transport service.

Here is the output: https://pastebin.com/aYfmyJ20

Development Environment The build is executed in a docker container.

It is a simple linux image with just Java installed.
Here is the Dockerfile:

FROM fedora:40

SHELL ["/bin/bash", "-c"]


# Install development tools.
RUN dnf -y groupinstall "Development Tools"

# Install OpenJDK 17.
RUN dnf -y install java-17-openjdk

# Install Maven.
RUN dnf -y install maven

# Install Python.
RUN dnf -y install python2

# Configure Git.
RUN git config --global url."https://".insteadOf git://


RUN mkdir -p /home/thingsboard
WORKDIR /home/thingsboard

To Reproduce Steps to reproduce the behavior:

  1. Build the above docker development environment.
  2. Start a container.
  3. Perform a build: mvn clean install -DskipTests
  4. The build fails in HTTP transport service.

Expected behavior A full build to succeed, as in previous versions.

Screenshots N/A

Additional context N/A


Disclaimer

We appreciate your contribution whether it is a bug report, feature request, or pull request with improvement (hopefully). Please comply with the Community ethics policy, and do not expect us to answer your requests immediately. Also, do not treat GitHub issues as a support channel.

fjpanag avatar Jun 27 '24 13:06 fjpanag

for anyone still encountering the same error, focus on the this line: Could not execute build using connection to Gradle distribution from 'https://services.gradle.org/distributions/gradle-7.3.3-bin.zip'. -> [Help 1]

Focus on the gradle version. The issue is most probably caused by this gradle release not supporting your JDK. For more info about gradle-jdk compatibility check this: https://docs.gradle.org/current/userguide/compatibility.html

The simple solution here is to downgrade your JDK (or update it if it's older than 8) for it to be compatible with that gradle release.

Georgio-Khoury avatar Jun 30 '24 09:06 Georgio-Khoury

Since Thingsboard V3.7.0 has upgraded to Java 17 old dependencies need to be updated. Try to update all dependencies, clear the cache and rerun the build.

pon0marev avatar Jul 04 '24 14:07 pon0marev

Focus on the gradle version. The issue is most probably caused by this gradle release not supporting your JDK. For more info about gradle-jdk compatibility check this: https://docs.gradle.org/current/userguide/compatibility.html

The simple solution here is to downgrade your JDK (or update it if it's older than 8) for it to be compatible with that gradle release.

@Georgio-Khoury The link that you provided indicates that I should use Java 17 (which is also a Thingsboard requirement). This is what I use. Do I understand something wrong?

Since Thingsboard V3.7.0 has upgraded to Java 17 old dependencies need to be updated. Try to update all dependencies, clear the cache and rerun the build.

@pon0marev As noted, this is a docker build, so the development environment is always fresh. There are no old dependencies, cache etc in the system.

fjpanag avatar Jul 09 '24 14:07 fjpanag

The issue was resolved by changing the maven package installed in the dockerfile:

FROM fedora:40

SHELL ["/bin/bash", "-c"]


# Install development tools.
RUN dnf -y groupinstall "Development Tools"

# Install OpenJDK 17.
RUN dnf -y install java-17-openjdk java-17-openjdk-devel

# Install Maven.
RUN dnf -y install maven-openjdk17

# Install Python.
RUN dnf -y install python2

# Configure Git.
RUN git config --global url."https://".insteadOf git://


RUN mkdir -p /home/thingsboard
WORKDIR /home/thingsboard

fjpanag avatar Jul 10 '24 09:07 fjpanag

You scroll up a bit inside the log, search "* What went wrong:", it will show you the actual error, for above download error, it is not the root cause if you have tried manually download the gradle and works.

Below is tb .9 + jdk 21 + gradle 8.12 scenario

If we use jdk 21 with gradle 8.12, we need to add below line into pom.xml under gradle-maven-plugin, gradleProjectDirectory because org.thingsboard's gradle-maven-plugin has set to default 7.3.3 <gradleVersion>8.12</gradleVersion>

It will then further error nebula.ospackage not match with latest gradle 8.12 inside packagin/java/build.gradle, change id "nebula.ospackage" version "8.6.3" to below id "com.netflix.nebula.ospackage" version "11.10.1"

kenx00 avatar Jan 14 '25 14:01 kenx00