Maven build in pull request not working

Hello everyone,

I just submitted my first pull request: Blink Binding by moesterheld · Pull Request #11735 · openhab/openhab-addons · GitHub

My build works fine on my local machine (with mvn clean install -pl :org.openhab.binding.blink ), however the one at GitHub fails with the error below. Do you have any hints?

Thanks a lot
Matthias

Building add-on: org.openhab.binding.blink

+ mvn clean verify -B -T 1.5C -U -am -amd -pl :org.openhab.binding.blink,:org.openhab.addons.bom.openhab-core-index,:org.openhab.addons.bom.runtime-index,:org.openhab.addons.bom.test-index,-:org.openhab.addons.reactor.features.karaf,-:org.openhab.addons.features.karaf.openhab-addons,-:org.openhab.addons.features.karaf.openhab-addons-external

[INFO] Scanning for projects...
Error: ] Could not find the selected project in the reactor: :org.openhab.addons.reactor.features.karaf @ 
Error:  Could not find the selected project in the reactor: :org.openhab.addons.reactor.features.karaf -> [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
Error: Process completed with exit code 1.

If you haven’t modified parent (reactor) pom for karaf features it shouldn’t be necessary. Error you have indicates that your project structure miss pom.xml with <artifactId>org.openhab.addons.reactor.features.karaf</artifactId>. Even if such file exists it might be commented in parent (double check pom.xml in project root directory).

Now, few notes about options you pass, cause they seem to me conflicting with your intention. You try to build your binding, but you end up building pretty much everything.
If you place -am switch to the command it will build dependencies of blink binding, runtime-index and so on. If you place such switch combined with karaf features it will force rebuilding of all bindings.
To make fast build of your binding it should be sufficient to rely on -amd which means build modules depending on binding, which in result will include also features.

Try with below command (not sure if you need boms):

mvn clean verify -B -T 1.5C -U -am -amd \
   -pl :org.openhab.binding.blink \
   -pl :org.openhab.addons.bom.openhab-core-index \
   -pl :org.openhab.addons.bom.runtime-index \
   -pl :org.openhab.addons.bom.test-index \

Also note that adding -U forces downloading of latest snapshots which can consume significant amount of time. Fastest builds are with -o -nsu, making -U makes sense if you hit a compile issue which comes from recent core snapshot.

Best,
Łukasz

Looks like you still need to add your add-on to bom/openhab-addons/pom.xml which should fix the build.

Hi Łukasz,

thanks for your reply.
Unfortunately, the error occurs in the GitHub build action so I have no control of the parameters. I have checked with working pull requests, it’s always the same command.

I have a very simple pom.xml in my binding and have never changed the one generated by the skeleton builder. There’s also no difference between mine and poms in working addons.

The strange thing is that everything is working fine on my local machine and I don’t really have a clue why the error occurs in the build pipeline.

Cheers,
Matthias

Hi Wouter,

do you mean openhab-addons/bundles/pom.xml? I have already added it there.
image

All the best,
Matthias

No it also needs to be added to another POM file located at: bom/openhab-addons/pom.xml

I missed that. Thank you very very much!

Do you think it’s a good idea to add this to the documentation?
Maybe here: Developer Guide | openHAB ?
This page only mentions the bundles/pom.xml and I tried searching for the bom one but couldn’t find it.

If you agree that’s a good idea, I’ll add it.

It might help some when it is added. :+1:

If you nowadays create a binding using the skeleton it should already be added automatically to all POM files including this BOM which is done by archetype-post-generate.groovy in the archetype used by the skeleton scripts.

Hmm… I used the skeleton script about two weeks ago and had to add it to both poms manually.
I’ll try again tomorrow and I’ll add it to the docs.

Thank you again for your help!

Matthias

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.