Using gradlew to build backend fails with exception

Hi there,

my name is Tobi, I’m new to OpenEMS, trying to get my first backend test build up and running. I’m building on a Devuan Chimaera (equiv. Debian Bullseye) machine, first using OpenJDK 11, but after reading Bug when launching openems installed OpenJDK 14. Still I get an exception when trying to build vanilla backend as pulled from develop branch. Running with --stacktrace is of no real help to me either. So as I’m also new to gradle, I could use some pointer on what I’m doing wrong. Please see build command output below…

~/git/github/openems$ ./gradlew buildBackend

> Task :io.openems.backend.application:export.BackendApp FAILED
error : Bundle file “/home/tobi/git/github/openems/io.openems.backend.b2brest/generated/io.openems.backend.b2brest.jar” does not exist, given error is null
error : Bundle file “/home/tobi/git/github/openems/io.openems.backend.b2bwebsocket/generated/io.openems.backend.b2bwebsocket.jar” does not exist, given error is null
error : Bundle file “/home/tobi/git/github/openems/io.openems.backend.core/generated/io.openems.backend.core.jar” does not exist, given error is null
error : Bundle file “/home/tobi/git/github/openems/io.openems.backend.edgewebsocket.impl/generated/io.openems.backend.edgewebsocket.impl.jar” does not exist, given error is null
error : Bundle file “/home/tobi/git/github/openems/io.openems.backend.metadata.dummy/generated/io.openems.backend.metadata.dummy.jar” does not exist, given error is null
error : Bundle file “/home/tobi/git/github/openems/io.openems.backend.metadata.file/generated/io.openems.backend.metadata.file.jar” does not exist, given error is null
error : Bundle file “/home/tobi/git/github/openems/io.openems.backend.metadata.odoo/generated/io.openems.backend.metadata.odoo.jar” does not exist, given error is null
error : Bundle file “/home/tobi/git/github/openems/io.openems.backend.timedata.dummy/generated/io.openems.backend.timedata.dummy.jar” does not exist, given error is null
error : Bundle file “/home/tobi/git/github/openems/io.openems.backend.timedata.influx/generated/io.openems.backend.timedata.influx.jar” does not exist, given error is null
error : Bundle file “/home/tobi/git/github/openems/io.openems.backend.uiwebsocket.impl/generated/io.openems.backend.uiwebsocket.impl.jar” does not exist, given error is null
error : Bundle file “/home/tobi/git/github/openems/io.openems.shared.influxdb/generated/io.openems.shared.influxdb.jar” does not exist, given error is null

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ‘:io.openems.backend.application:export.BackendApp’.
> /home/tobi/git/github/openems/io.openems.backend.application/BackendApp.bndrun export failure

Hi Tobi,

thanks for getting in touch. I am not an expert (or a fan…) of gradle, either. It just happens to be the default in a bndtools environment for OSGi. As a start I would always recommend using Eclipse IDE.

Regarding you question: we are still building on Java 8, as OpenEMS targets embedded devices and their software is often a little bit behind. That being said, I am sure we will have to discuss this in the community to target a newer versions soon. I quickly changed our travis build to use OpenJDK 11 and 14. Both failed indeed (OpenJDK 14: Travis CI - Test and Deploy with Confidence, OpenJDK 11: Travis CI - Test and Deploy with Confidence) - even if the errors seem to be mainly Javadoc related, so should be a rather easy fix.

Sorry for not being able to help directly with this problem. In my point of view, you could either:

Regards,
Stefan

Hi Stefan,

thanks for your help. Seems it could be more valuable than what you might have expected. As I am not (possibly yet) a fan of Eclipse, I’d choose to take route 2 (Fix the bugs in the build). I just ran ‘gradlew build -x test’ which yielded into a ‘BUILD SUCCESSFUL’. So as I did some more investigation before receiving your reply, I knew that the problem was that some subproject JARs didn’t get built. After that ‘BUILD SUCCESSFUL’ I just gave building backend another try (gradlew buildBackend), and guess… now it builds successfully :slight_smile: So I think there might be an error or compatibility issue of gradle/bnd build with OpenJDK 11+ which prevents some JARs from being built. If I find it I’d prepare a PR on Github, but first of all I’ll try to proceed with that backend build.

Thank you!

Best regards,
Tobi

1 Like