Jenkins build failing randomly


(Robert Kaczmarczyk) #1

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.


(Hilbrand Bouwkamp) #2

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.


(Robert Kaczmarczyk) #3

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.


(Robert Kaczmarczyk) #4

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 http://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting 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?


(Scott Rushworth) #5

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?


(Robert Kaczmarczyk) #6

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?


(Scott Rushworth) #7

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.


(Hilbrand Bouwkamp) #8

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.


(Scott Rushworth) #9

Thank you… but why?

Never mind… you answered here…


(David Graeff) #10

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).


(Robert Kaczmarczyk) #11

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.


(David Graeff) #12

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


(Robert Kaczmarczyk) #13

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?


(David Graeff) #14

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.