Hi
I know this category is for developers only, not sure I would call myself that after only one binding and Iām pretty green.
I have run into a problem trying to build a binding specifically against openHAB5.0.0. in order to support another user and this thread/topic seemed relevant.
I read the guidance here Developers Guide and have forked in Github and cloned to my local machine and branched.
My OS is Win 11 and I can build against the 5.1.0-SNAPSHOT using the VSCode tasks on the Command pallet and through the terminal no problem and the JAR executes/debugs fine, but now I want to build for 5.0.0.
I note from the Developers Guide the -Dohc.5.0.0 option for Maven and have tried
mvn -Dohc.version=5.0.0 clean install -pl :org.openhab.binding.sunsynk -am
This fails
PS C:\Users\leech\Development\openhab-addons\bundles\org.openhab.binding.sunsynk> mvn -Dohc.version=5.0.0 clean install -pl :org.openhab.binding.sunsynk -am
[INFO] Scanning for projects...
[INFO]
[INFO] -------< org.openhab.addons.bundles:org.openhab.binding.sunsynk >-------
[INFO] Building openHAB Add-ons :: Bundles :: SunSynk Binding 5.1.0-SNAPSHOT
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.311 s
[INFO] Finished at: 2025-09-05T16:12:15+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Unknown lifecycle phase ".version=5.0.0". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: pre-clean, clean, post-clean, validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy. -> [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/LifecyclePhaseNotFoundException
PS C:\Users\leech\Development\openhab-addons\bundles\org.openhab.binding.sunsynk> mvn -Dohc.version=5.0.0 clean install -pl :org.openhab.binding.sunsynk -am
[INFO] Scanning for projects...
[INFO]
[INFO] -------< org.openhab.addons.bundles:org.openhab.binding.sunsynk >-------
[INFO] Building openHAB Add-ons :: Bundles :: SunSynk Binding 5.1.0-SNAPSHOT
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.360 s
[INFO] Finished at: 2025-09-05T16:13:59+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Unknown lifecycle phase ".version=5.0.0". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: pre-clean, clean, post-clean, validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy. -> [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/LifecyclePhaseNotFoundException
I have tied the -X option for mvn but there appeared to be nothing pertinent there nor at the [Help 1] URL. Iāve tried to find info about the -D but google has little to say on the subject other than it can be use to set a system property like a key value pair for reference from pom.xml, so Iām guessing this āohc.versionā key is specific to openhab.
Interestingly, and this could be a red herring, when I added a space after the -D like this
mvn -D ohc.version=5.0.0 clean install -pl :org.openhab.binding.sunsynk -am
the build appears to progress further not throwing the confusing āunknown lifecycle phaseā problem above and references some articles labelled with 5.0.0 e.g.
mvn:org.openhab.core.bundles/org.openhab.core.model.rule.runtime/5.0.0
but ultimately fails with
[ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.4.8:verify (karaf-feature-verification) on project org.openhab.binding.sunsynk ...
I found this thread [SOLVED] Maven build fails at 'verify' task - #3 by QNimbus ,but my features.xml looks fine to my novice eye.
<?xml version="1.0" encoding="UTF-8"?>
<features name="org.openhab.binding.sunsynk-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository>
<feature name="openhab-binding-sunsynk" description="SunSynk Binding" version="${project.version}">
<feature>openhab-runtime-base</feature>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.sunsynk/${project.version}</bundle>
</feature>
</features>
Not sure where to go, am I doing something wrong, is this the correct thread.
Help appreciated.