Jenkins build failing randomly

Hi.
I have this problem which drives me nuts. The jenkins builds of my binding fail at seemingly random. While my binding passes without problems, the errors occur much later on (which makes this thing even more frustrating). The first time it happened, the build failed on PaperUI (I made no changes there), The second time it was something else (don´t remember what, but it was shortly before the entire build would have passed and again no changes from me there). Is there a way in which I can build my binding only? I´d like to have a .jar already for the people interested to test and can´t get past this brick wall.

Thanks in advance.

There were some changes recently that caused temporary build problems. If you have updated or based your branch on it, it would explain the problems. Just an hour ago the ui’s have been removed from the addons2 repository.
If you pull --rebase your own branch and push --force-with-lease back it should build.
Locally you can always build with maven from your binding directory. But that is something you might not be looking for.

Thanks for the answer. The build magically passed now (without updates from upstream). Maybe the CI servers had high load earlier and the build timed out? The failing builds ran for around 1h 58m, but the passing one was done in around 1h 40m.

So after it magically worked, the build magically fails again with

[ERROR] Cannot resolve project dependencies:
[ERROR] Software being installed: org.openhab.io.rest.docs 2.5.0.qualifier
[ERROR] Missing requirement: org.openhab.io.rest.docs 2.5.0.qualifier requires ‘java.package; org.openhab.ui.dashboard 0.0.0’ but it could not be found
[ERROR]
[ERROR] See Tycho/Dependency Resolution Troubleshooting - Eclipsepedia for help.
[ERROR] Cannot resolve dependencies of MavenProject: org.openhab.io:org.openhab.io.rest.docs:2.5.0-SNAPSHOT @ /var/jenkins_home/workspace/PR-openHAB2-Addons/addons/io/org.openhab.io.rest.docs/pom.xml: See log for details → [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MavenExecutionException

I pulled and merged updates from upstream with no effect. What can I do?

This was caused by the move of the UIs and dashboard to a separate repo. You’ll need to wait, or don’t build the dashboard.

Actually, if you’re building addons, you should be OK if you pull down the changes. Why not just build your binding?

I´d really like to build just the binding, but I´m not a java expert to that level (PHP is - unfortunately - more my domain). What steps do I need to take to build just the binding?

In your file system, go to the project root directory which will have the pom.xml for the binding, probably in …/openhab-master/git/openhab-addons/<binding name>/, and run mvn clean install. You’ll find the jar in the target directory. Search the web for ‘mvn clean install’ for more details.

Don’t do this!

In eclipse right click on a project and “Run As…” → “Maven build…” → With goals: clean install. jar file will be in target directory, just like the command line build.

2 Likes

Thank you… but why?

Never mind… you answered here…

1 Like

I mean at least we get used to the pure maven system, that will come to openhab2 at some point anyway.

Considering the old build system is very much Eclipse technology bounded, Eclipse is very well able to generate a working jar file however. I have done that since two years in this fashion.

Edit: I just noticed it’s about “Export as Jar”. I’m using Export as Plugin (or similar).

I’m currently doing mvn clean install for the bundle locally for testing but I’m talking about the pull request build on jenkins. It’s far easier to just link the .jar from the build system in the forum (and eclipse marketplace) than build locally, upload to google drive, remember all places where you put the link and update it in all those places.

There is a jfrog repository with all latest PR jars. But I forgot the address :confused:

I know. I linked the jar from there in my thread in the bindings section and on the eclipse marketplace, but the jar won’t update until I get the jenkins build to either skip the faulty packages or build completely since the deploy to jfrog happens automatically after a successful build. I don’t think that I have the user rights to do anything with the build config, so what other possibilites are there?

Wait for the build to stabilize? The general build is broken atm as packages are moved around, because of the new -webui repository.

openHAB does not have a solution yet for offering developer released jars. My plan to solve this is to create a few more extension-services (the marketplace is an extension-service). One for npmjs (for UIs), one for jfrog and one for general maven repositories.

The first two (npmjs + jfrog) will have a fixed list of repositories/endpoints to watch. The third service would allow users to add a developer provided address. The developer would only need to build his jar and upload it to github pages into a “fake” maven repository for example. The extension-service will poll periodically and find out about new releases.

2 Likes