We are in the process of changing the build system. We are not accepting new pull requests that are still using the old way from here on.
For further information see: Migration to a Maven + Bnd based build system
The build system has been migrated to a Mave + Bnd based build system.
We are not accepting new pull requests that are still using the old way from here on.
openHAB is a java project that is build around the OSGi framework. openHAB add-ons are OSGi bundles.
Over the years the bnd software ("bnd is the engine behind a number of popular software development tools that support OSGi") has established itself as the defacto standard for creating OSGi bundles.
The openHAB maintainers have decided to move from the very Eclipse centric buildsystem to maven/bnd. A combination that not only allows to develop bindings seamlessly in other IDEs than Eclipse, but Java beginners and intermediates find a commonly known maven buildsystem.
The easiest way to migrate is to use the create_openhab_binding_skeleton script in the bundles folder and create the basis for your migrated binding and than copy your binding into the new generated folder:
create_openhab_binding_skeleton <binding name> "<your full name>" <your github name>. (This script also updates the CODEOWNERS and bom addons pom. So if you have already updated those files you need to clean that up).src/main to the new binding folder in binding in bundles. README.md to the new binding folder. If you have any non standard additional files. Move them also (like images used in your readme) pom.xml file if your add-on requires dependencies like so:xml
<dependencies>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient-osgi</artifactId>
<version>4.5.2</version>
<scope>provided</scope>
</dependency>
</dependencies>
lib/ directory.ESH-INF to src/main/resources/ESH-INF.test project into src/test.itests/ directory for examples.src/main/feature/feature.xml to add any external dependencies, you must list them here, too. An example:xml
<feature name="openhab-binding-lgwebos" description="LG webOS Binding" version="${project.version}">
...
<bundle dependency="true">mvn:org.apache.httpcomponents/httpclient-osgi/4.5.2</bundle>
<bundle start-level="80">mvn:org.openhab.binding/org.openhab.binding.lgwebos/${project.version}</bundle>
</feature>
xml
<feature prerequisite="true">wrap</feature>
<bundle dependency="true">wrap:mvn:io.netty/netty-common/4.1.34.Final$Bundle-Name=Netty%20Common&Bundle-SymbolicName=io.netty.netty-common&Bundle-Version=4.1.34</bundle>
Enter mvn clean install -DskipChecks in the project directory or itest project directory.
Subsequent calls can include the -o for offline.
For integration tests you might need to run: mvn clean install -DwithResolver.
Skip checks and tests if you just want to test the compilation process and perform the command from within the directory of the bundle that you want to build:
mvn clean install -DskipChecks -DskipTests -o
git clone --depth=1 https://github.com/maggu2810/openhab-demo.git clone --depth=1 https://github.com/openhab/openhab2-addonspom.xml in the demo-app project.
xml
<project ...>
...
<dependencies>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.astro</artifactId>
<version>${project.version}</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</project>
app.bndrun in the demo-app project. Double click (takes a few seconds).
git\openhab2-addons\bom\openhab-addonsmvn -DskipChecks -DskipTests clean installapp.bndrun file and now you should be able to find the binding in the listThe demo application runs a slim set of openHAB core bundles including automations (next gen rules) and PaperUI (http://127.0.0.1:8080/paperui/). The startup should only take about 5 seconds and you are greeted by the openHAB console where you can type in console commands.
But it should be simple for Bintray.
It's sure a lot easier to create your own Bintray repo compared to uploading to Maven Central. Isn't it also easier for them being removed one day causing builds to fail? As fallback we'll probably still have such JAR artifacts in stable/milestone/snapshot releases.
But IMHO this would be just as problematic as when someone decides to delete their GitHub repo containing all the source code of a library. Since we don't store such sources or source JARs.
To mitigate these issues we could also setup an openHAB repo proxy to such 3rd party repos.
why are we trying to use local JAR files at all
I'd like to manage them using dependencies in POMs as well. It would be a good improvement to be able to update libraries and all their dependencies by just updating a version number. :-)
So, my offer:
You (who) tells me an addon project name that also offers an OSGi based test project.
I assume it should be one with no -- in the best case -- PR opened.
Perhaps for the very beginning it should be one without a 3rd party JAR that is not available on a Maven repo.
I try to start the base work:
bundles)itests)That's just an offer to help. If another one volunteers to do that job, I am happy, too.
astro is a perfect match, isn't it?
I would then migrate MQTT as soon as the remaining PRs are in, to test how well the migration process works.
I'm OK with Astro as well. The binding itself doesn't really matter as long as it's a bit representative of most projects. If we run into issues while migrating other add-ons we can always ask for more help. :wink:
Thanks for adding a migration guide @davidgraeff !
Didn't notice the first post was updated. :-)
Can we add that to the developer documentation (esp. the Part about eclipse)?
One thing regarding the miration guide: "remove '/lib'" is a good idea but will not work out-of-the-box for all bindings, since not all libs are availabe on bintray. And not all of those that are available can easily be used. So this should be checked before migration.
@J-N-K There was a discussion about this between Markus and Wouter (I think?) and the agreement afaik is to move everything to (if necessary private) bintray/maven repos. For new contributions I also tend to say to either include the source code completely or only allow "established" libraries on maven central.
The end of this discussion was, that a decision by oh2-maintainers should be made about that. AFAIK this is still pending.
Including the source code maybe difficult. For example the Allplay binding includes a lib (Tchaikovsky) that is build with gradle and includes other libs that are not available on bintray (source is available on GitHub, though). Integrating that into our own build would greatly increase build time.
My long time dream for openHab is Gradle as well, but Markus will slowly poke me to death with a spoon if I suggest that :D (But the speed advantage is real)
What I was trying to say: other project might use other build systems and integrating those with our own is quite some effort and may not be worth the time (compared to building them and uploading a binary to our own 3rd-party-libs repo).
What I was trying to say: other project might use other build systems and integrating those with our own is quite some effort and may not be worth the time
The idea is to go to the maintainer of such a library and ask for a maven publish. There is even a maven plugin that uses github pages as a static repository site. We do not depend on their build system.
I am locked on the last step, that is launching the demo app. When I double-click on the file app.bndrun, it simply opens the file in the Eclipse editor. With what app should I open this file to start the demo app ?
it simply opens the file in the Eclipse editor
It's like with pom.xml files: You can edit the source file or have the eclipse UI. The same for bndrun files: The default view might be text for you, but there should be the tab to show the UI (you see the glimpse of this selection in the screenshot above).
If not, your eclipse installation is missing bndtools (which is fatal). Please either manually install them or use the eclipse installer for openhab-core development. Let it do whatever it does, remove everything from the workspace again and then perform the steps from above.
Bndtools is now (manually) installed and I can see the dialog box with run requirements.
But I can't add my binding from openhab2-addons. In the Browser repos at left, I see apparently only bundles from org.openhab.core.bom.openhab-core-index. No binding here, mainly core stuff.
If I click on the green +, it opens the "Add Bundle Requirement" dialog box but this is empty, I only see at left "Workspace default-ws" with nothing inside.
Same for Run Bundles. Project run path dialog box shows an empty workspace.
If I drag my project from the project explorer into the run requirements, I get this error:
Error adding one or more requirements
Error generating requirement
Unable to derive identity from an object of type Project
I can go one step later, that is I can now add my binding and start OH. The problem is that it fails to start.

Great tutorial. This will help others a lot. I walked through it step by step and want to add the following things:
- Remove
META-INFandOSGI-INF
We have to remove the build.properties file too.
- Move unit tests from a potential separate
.testproject intosrc/main/test.
Move unit tests from a potential separate .testproject into src/test.
Additional changes need to be done in the files CODEOWNERS, the BOM (bom/openhab-addons/pom.xml, groupId) and features/karaf/openhab-addons/src/main/feature/feature.xml (bundle).
But I get a 404 error if I try to open the dashboard or Basic UI !
Is the demo app fully prepared/packaged to run UIs with the demo sitemap ?
The demo only runs paperUI. You see that in the "Run requirements" section. There is only paperUI referenced. Add whatever you need there (you don't need to adapt pom.xml, because bnd knowns about all openhab-core and openhab-webui bundles)
Btw paperUI can be reached directly via http://openhab-ip/paperui without the dashboard (which is deprecated... next to PaperUI but that's another story.)

I have added some UI bundles. I don't see traces for Paper UI.
Now when I try to access UI, I am requested a login/password for OSGi Management console ! I never had to enter that before. What has to be entered ?
Just to be clear, here is what I get by default (that is if I change nothing):

No trace of Paper UI.
I tried admin / admin but then I still get 404 errors for any UI including Paper UI.
Drag paperui over then from the "Browse Repos" window. It is called "org.openhab.ui.paper".
No idea why credentials are required.
But I don't have org.openhab.ui.paper !

Are there several demo app ? I am using the one from openhab-core.
Yes there are multiple one, that's why I added a screenshot to the list. There is only one org.openhab.demo.app bundle. The core has its own, but that one can only reference to core bundles and not to uis and is not really of any use. Markus wanted to remove it actually, but Kai not.
Ok I am not using the right one ! It looks like a new repo is requireed, openhab-demo.
Shall we still clone https://github.com/maggu2810/openhab-demo or is there now a openhab-demo repo ?
That's the correct repo. Check your pom.xml of your demo app if it includes paperui:
<dependency>
<groupId>org.openhab.ui</groupId>
<artifactId>org.openhab.ui.paper</artifactId>
<version>${project.version}</version>
<scope>runtime</scope>
</dependency>
And what you can also do is to open the bndrun file and click the "Resolve" button, it will print some errors if something is not found etc.

It looks like the server is started.
But still no WEB access.
Doing a netstat command, I even have the feeling that there is no ports 8080 and 8443 opened !
I give up...
The rest interface on /rest should work, it works for me. But yeah would be helpful if the others can comment on this, so that we get a better migration guide.
Like before, we should have a setup that by default allows starting and running the openHAB demo, including of course dashboard, Paper UI and Basic UI.
The constraint to update now a POM to add a particular binding is not as cool and easy as before (simply select your binding in Eclipse UI).
Making this easy and working again should be a priority IMHO. Without the ability to test your code in Eclipse, a lot of contributors will probably give up.
@lolodomo The day is unfortunately only that long and almost everybody here does it in his freetime and the one guy that does it for a living (Markus) is in holiday.
The entire documentation for binding development need to be changed. And yes, changing a pom is not nice, there is a UI for this in eclipse as well though. I guess you can also drag&drop the project into that UI. We just need to find out what the easiest way is.
CODEOWENERS will almost always give us merge conflicts.
We should probably script migrate all extensions without tests and jars in one go?
So do we stop migrating our bindings individually ?
@lolodomo No. The problem with the script migration is that some bindings should not yet be ported (those with open PRs). So please keep porting your bindings.
The RFXCOM binding is using an external lib, jd2xx. Source code is in sourceforge: https://sourceforge.net/projects/d2xx/files/ Last update is dated 2011 !
How do you want to handle such a dependency ? Can you accept keeping libraries in such a case ?
This is discussed e.g. in #5117 but not yet decided.
I'd say we include the source files of that library (dual licensed and we pick the bsd one).
I discovered that the old way to start openHAB in Eclipse is still working well (and with all UIs available). The only problem is that the migrated bindings are no more presented. Don't know if this can be fixed.
For the developers that need running and testing their bindings from inside Eclipse, until a clear and working guide is provided with the demo app, I would suggest to not migrate immediately.
@lolodomo You are in the wrong topic for this suggestion. Here it is all about migrating all bindings as fast and clean as possible, because the core is currently "broken" until all bindings have been migrated.
After the migration and after the core has been fixed, we will think about how to develop bindings under these new conditions.
It may not even be Eclipse anymore, but Visual Studio Code as it is super easy to write addons for it. With an addon we can add "Run" and "Debug" buttons that do all the fancy OSGi container starting and maven dependency manipulation in the background.
We should probably script migrate all extensions without tests and jars in one go?
I'd prefer one PR per binding. Else, you will have one humongous PR blocking everything else, and if it part of it needs to be reverted (e.g. some binding does not work even if it technically "migrated" as in "compiles"), you would break the complete master. Faced that pain too many times myself.
jd2xx nowadays cause more issues than it gains. Windows, linux and osx have native FTDI drivers, so binding is able to discover rfxcom bridge, but connection doesn’t work properly because of native driver. Additionally, most of the beginners try to introduce jd2xx bridge rather than direct serial port bridge, so I propose to remove whole bridge auto discovery and jd2xx staff from rfxcom binding.
@paulianttila this is a good solution to solve the problem :-)
If we do that, this will break things at least for some users ?
If we do that, this will break things at least for some users ?
Already configured things should not be influenced I guess? As far as I understood, jd2xx is only used for auto discovery. The readme should be amended to reflect that there is no discovery anymore.
No, my understanding of the code is that if a bridge was discovered with JD2xx then the connection to the serial port is done using JD2xx library. To avoid that, we will need at least the port name in the configuration but we don't have it.
@clinique : the netatmo binding could be a very difficult challenge with its 9 external libraries. You are probably the only one to understand/know how some of them were produced. What could be the solution for this binding ?
@lolodomo : my plan is to start by some simple bindings (Synop, OpenUV) to understand the move, and then go to Netatmo :)
I did no see this thread before you pinged me, but I think it may answer question I raised on the forum right this morning !
It looks like the server is started.
But still no WEB access.
Doing a netstat command, I even have the feeling that there is no ports 8080 and 8443 opened !
I give up...
Hello @lolodomo , I'm stuck at the very same step. Did you find a solution ?
@clinique Is the rest interface working? (/rest) You may need to add the "org.openhab.ui.dashboard" bundle to the xml and to the run requirements as well. This demo app just has never been really tested with uis.
Only in addons/binding, I can count 92 external lib used, by 34 bindings.
org.openhab.binding.allplay/lib/tchaikovsky.jar
org.openhab.binding.allplay/lib/tchaikovsky-sources.jar
org.openhab.binding.amazondashbutton/lib/jna-4.2.1.jar
org.openhab.binding.amazondashbutton/lib/pcap4j-core-1.6.6.jar
org.openhab.binding.amazondashbutton/lib/pcap4j-packetfactory-static-1.6.6.jar
org.openhab.binding.bluetooth.bluez/lib/tinyb-0.5.1.jar
org.openhab.binding.bluetooth.ruuvitag/lib/ruuvitag-common-1.0.0.jar
org.openhab.binding.boschindego/lib/bosch-indego-controller-lib-0.8.jar
org.openhab.binding.boschindego/lib/httpclient-4.5.2.jar
org.openhab.binding.boschindego/lib/httpcore-4.4.4.jar
org.openhab.binding.boschindego/lib/jackson-annotations-2.8.6.jar
org.openhab.binding.boschindego/lib/jackson-core-2.8.6.jar
org.openhab.binding.boschindego/lib/jackson-databind-2.8.6.jar
org.openhab.binding.chromecast/lib/api-v2-0.10.6.jar
org.openhab.binding.chromecast/lib/jackson-core-asl-1.9.2.jar
org.openhab.binding.chromecast/lib/jackson-mapper-asl-1.9.2.jar
org.openhab.binding.chromecast/lib/protobuf-java-2.6.0.jar
org.openhab.binding.ftpupload/lib/ftplet-api-1.1.0.jar
org.openhab.binding.ftpupload/lib/ftpserver-core-1.1.0.jar
org.openhab.binding.ftpupload/lib/mina-core-2.0.16.jar
org.openhab.binding.groheondus/lib/ondus-api-0.0.7.jar
org.openhab.binding.harmonyhub/lib/harmony-client-1.1.2.jar
org.openhab.binding.hdpowerview/lib/jcifs-1.3.18.jar
org.openhab.binding.helios/lib/cxf-core-3.1.0-SNAPSHOT.jar
org.openhab.binding.helios/lib/cxf-services-wsn-api-3.1.0-SNAPSHOT.jar
org.openhab.binding.helios/lib/cxf-services-wsn-core-3.1.0-SNAPSHOT.jar
org.openhab.binding.ihc/lib/commons-logging-1.2.jar
org.openhab.binding.ihc/lib/httpclient-4.5.6.jar
org.openhab.binding.ihc/lib/httpcore-4.4.10.jar
org.openhab.binding.innogysmarthome/lib/google-http-client-1.22.0.jar
org.openhab.binding.innogysmarthome/lib/google-http-client-jackson2-1.22.0.jar
org.openhab.binding.innogysmarthome/lib/google-oauth-client-1.22.0.jar
org.openhab.binding.innogysmarthome/lib/httpclient-4.0.1.jar
org.openhab.binding.innogysmarthome/lib/httpcore-4.0.1.jar
org.openhab.binding.innogysmarthome/lib/jackson-core-2.1.3.jar
org.openhab.binding.ipp/lib/cups4j-0.6.4.jar
org.openhab.binding.knx/lib/calimero-core-2.4-e9975c01.jar
org.openhab.binding.knx/lib/calimero-device-2.4-a03cd243.jar
org.openhab.binding.knx/lib/calimero-rxtx-2.4-883497d1.jar
org.openhab.binding.kostalinverter/lib/jsoup-1.8.3.jar
org.openhab.binding.lametrictime/lib/lametrictime-api.jar
org.openhab.binding.lametrictime/lib/provider-gson.jar
org.openhab.binding.leapmotion/lib/LeapJava.jar
org.openhab.binding.lgwebos/lib/Connect-SDK-Java-Core-1.0.jar
org.openhab.binding.lgwebos/lib/java-websocket-1.3.2.jar
org.openhab.binding.lgwebos/lib/json-20140107.jar
org.openhab.binding.lgwebos/lib/xpp3-1.1.4c.jar
org.openhab.binding.logreader/lib/commons-io-2.7-20180506.jar
org.openhab.binding.mcp23017/lib/pi4j-core-1.2.jar
org.openhab.binding.mcp23017/lib/pi4j-gpio-extension-1.2.jar
org.openhab.binding.minecraft/lib/rxjava-1.1.7.jar
org.openhab.binding.minecraft/lib/tubesock-0.0.1.jar
org.openhab.binding.netatmo/lib/commons-codec-1.8.jar
org.openhab.binding.netatmo/lib/gson-2.3.1.jar
org.openhab.binding.netatmo/lib/json-20131018.jar
org.openhab.binding.netatmo/lib/netatmo-java-retrofit-1.1.3.jar
org.openhab.binding.netatmo/lib/okhttp-2.3.0.jar
org.openhab.binding.netatmo/lib/okio-1.3.0.jar
org.openhab.binding.netatmo/lib/org.apache.oltu.oauth2.client-1.0.0.jar
org.openhab.binding.netatmo/lib/org.apache.oltu.oauth2.common-1.0.0.jar
org.openhab.binding.netatmo/lib/retrofit-1.9.0.jar
org.openhab.binding.opensprinkler/lib/pi4j-core.jar
org.openhab.binding.orvibo/lib/s20-sdk-0.0.6-SNAPSHOT.jar
org.openhab.binding.plclogo/lib/Moka7-1.0.2_io_patch.jar
org.openhab.binding.sleepiq/lib/provider-gson.jar
org.openhab.binding.sleepiq/lib/sleepiq-api.jar
org.openhab.binding.smartmeter/lib/j62056.jar
org.openhab.binding.smartmeter/lib/jsml.jar
org.openhab.binding.smartmeter/lib/reactive-streams-1.0.2.jar
org.openhab.binding.smartmeter/lib/rxjava-2.2.3.jar
org.openhab.binding.synopanalyzer/lib/SynopAnalizer.jar
org.openhab.binding.systeminfo/lib/jna-5.2.0.jar
org.openhab.binding.systeminfo/lib/jna-platform-5.2.0.jar
org.openhab.binding.systeminfo/lib/oshi-core-3.13.0.jar
org.openhab.binding.tado/lib/tado-api-client-1.1.jar
org.openhab.binding.tellstick/lib/async-http-client-2.0.19.jar
org.openhab.binding.tellstick/lib/async-http-client-netty-utils-2.0.19.jar
org.openhab.binding.tellstick/lib/javatellstick-1.1.jar
org.openhab.binding.tellstick/lib/netty-all-4.0.42.Final.jar
org.openhab.binding.tellstick/lib/netty-reactive-streams-1.0.8.jar
org.openhab.binding.tellstick/lib/netty-resolver-2.0.19.jar
org.openhab.binding.tellstick/lib/netty-resolver-dns-2.0.19.jar
org.openhab.binding.tellstick/lib/reactive-streams-1.0.0.jar
org.openhab.binding.zoneminder/lib/gson-2.7.jar
org.openhab.binding.zoneminder/lib/guava-17.0.jar
org.openhab.binding.zoneminder/lib/javax.ws.rs-api-2.0.1.jar
org.openhab.binding.zoneminder/lib/jersey-common-2.4.1.jar
org.openhab.binding.zoneminder/lib/jsoup-1.10.1.jar
org.openhab.binding.zoneminder/lib/zoneminder4j-0.9.7.jar
org.openhab.binding.zway/lib/commons-lang3-3.4.jar
org.openhab.binding.zway/lib/zway-lib-0.2.9-SNAPSHOT.jar
It looks like an enormous challenge to suppress all these libs and it could take ages.
@clinique : The only solution I found was to give up :) For not yet migrated bindings, you can still use the old method with the Eclipse run configuration.
Those bindings take a bit longer to migrate. But a lot of those jar-libraries are in maven central and just need to be referenced in the pom.xml.
Netatmo is the winner with 9 libs, followed by tellstick with 8 libs and then boschindego / innogysmarthome / zoneminder with 6.
@clinique Is the rest interface working? (/rest) You may need to add the "org.openhab.ui.dashboard" bundle to the xml and to the run requirements as well. This demo app just has never been really tested with uis.
Done, nothing much better. Is web server supposed to work on :80 or :8080 ?
But a simple solution has to be imagined for those that are not in maven central.
At least, I am no more alone with a not usable demo app ;)
@clinique : The only solution I found was to give up :) For not yet migrated bindings, you can still use the old method with the Eclipse run configuration.
Sure, but my point was to test on some way the migrated OpenUV binding :(
Sure, but my point was to test on some way the migrated OpenUV binding :(
Via command line ^^. I have updated the readme as well on what to type in. You can do that from within the bundle directory to only build that one.
--Edit: You mean a funtional test not unit tests. Ok the UI would be helpful then, true.
@clinique : I tested some of the bindings I migrated directly in my production environment !
As the process is always the same, if you do it correctly for one binding, you will do it correctly for the others. What is the most important, I think, is to check the success of the maven+bnd compilation.
@davidgraeff : Could you please comment in the "guide" that using -DskipTests allows ignoring tests and boost seriously the compilation.
What will become the 89 existing PRs with the tag "new binding" ?
They are of course based on the old build system.
@clinique : I tested some of the bindings I migrated directly in my production environment !
As the process is always the same, if you do it correctly for one binding, you will do it correctly for the others. What is the most important, I think, is to check the success of the maven+bnd compilation.
Yes, this is what I'm going to do.
What will become the 89 existing PRs with the tag "new binding" ?
They are of course based on the old build system.
For the 2 or 3 open PR I have (VolvoOnCall, Xmltv...) should I directly migrate to bnd and close opened PR ?
I think you can just migrate and keep the PR.
What will become the 89 existing PRs with the tag "new binding" ?
I have closed two very old ones from 2016 with no progress. But also found one from 2016 that had a recent push 7 days ago. We just need to inform people in those PR to migrate. But I wouldn't do that before we have a working IDE situation for maven/bnd with a good documentation and a working archetype.
But a simple solution has to be imagined for those that are not in maven central.
We could also use bnd includeresource for adding such libraries.
I tested this with the HarmonyHub Binding in https://github.com/openhab/openhab2-addons/pull/5190.
Hi!
I am in the very same position as clinicue, and as your question "Is the rest interface working? (/rest)"
In my case is it not working, I can connect to rest in my 'old openhab', but not in this one.
So to my question, When I do Perform Setup Task, I got errors like below for Launch PaperUI Setup and Launch BasicUI Setup.
Could this maybe be regarded to our problems?
Performing Launch PaperUI Setup
java.lang.Exception: No launcher found for PaperUI Setup
at org.eclipse.oomph.setup.launching.impl.LaunchTaskImpl.perform(LaunchTaskImpl.java:262)
at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer.doPerformNeededSetupTasks(SetupTaskPerformer.java:3335)
at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer.access$1(SetupTaskPerformer.java:3278)
at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer$WorkspaceUtil$1.run(SetupTaskPerformer.java:4514)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2289)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2316)
at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer$WorkspaceUtil.performNeededSetupTasks(SetupTaskPerformer.java:4508)
at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer$WorkspaceUtil.access$0(SetupTaskPerformer.java:4506)
at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer.performNeededSetupTasks(SetupTaskPerformer.java:3269)
at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer.performTriggeredSetupTasks(SetupTaskPerformer.java:3244)
at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer.perform(SetupTaskPerformer.java:3144)
at org.eclipse.oomph.setup.ui.wizards.ProgressPage$9.run(ProgressPage.java:575)
at org.eclipse.oomph.setup.ui.wizards.ProgressPage$11$1.run(ProgressPage.java:701)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:60)
Best Regards Basse
@basse04 Do not use the eclipse setup installer with the option "openhab2 addons" for the new build system. That will totally mess up your eclipse. You can use that with the "openhab core" option, remove everything and go from there.
In general just use a fresh eclipse installation and do what is described above.
The problem is: Not all bundles are loaded for the rest interface and I do not have time to fix Markus demo app repository. They need to be listed in the pom.xml and in the bndrun file.
Question:
I'd like to migrate the Tankerkoenig binding.
Should I start now or wait for "we have a working IDE situation for maven/bnd with a good documentation and a working archetype."
Looking into my Eclipse IDE (setup for openHAB addons development) I do not see any /bundles/ , am I missing something?
The build systems are not working at the same time within eclipse.
setup for openHAB addons development
You will not see the migrated addons anymore.
I'd like to migrate the Tankerkoenig binding.
That would be awesome. The migration itself can be performed via any text editor and file manager. And at the end you can use the command line to build your binding. At the moment you need to drop it in your test or productive openHAB environment though if you don't want to tinker with the IDE setup.
I created a PR https://github.com/openhab/openhab2-addons/pull/5237, we can merge it if you're happy with it @JueBag .
@davidgraeff, this info may be useful in the instructions for accessing the Dashboard and Paper UI.
If you go directly to http://localhost:8080, you will get the OSGI Management Console, which has a default account/password of admin/admin. But authentication is not required if you go to http://localhost:8080/start/index.
I've update the issue with a link to the migration script I wrote. (And removed the copying of the .settings directory from the manual instructions).
@Hilbrand Thanks. Your script works like a charm (see #5254).
As far as I understand the script from @Hilbrand doesn't work on windows, so I'm stuck to working manually using an editor.
I'm offering help by migrating bindings (on which I did not work before) following the manual instructions.
Please advise me.
@JueBag Ideally you pick bindings that have a ".test" project. That's what the script can't do anyway.
A discord channel would be cool for evening hours when multiple people are working on the repo
State in here which binding I'm picking?
Never worked with a "test" project, as far as I understand that would be a binding which also has a "test" "variant" (for example "bluegiga")?
And what is the difference/ How to determine the difference between "unit tests" and "integration tests"?
Please, I do need some advice.
It's possible to start both org.openhab.core.demo.app and org.openhab.demo.app inside IDE
I see the " Welcome to Apache Felix Gogo and I can run some commands with answers in both demo's
When I do http://'ip':8080/rest can I see answers from org.openhab.core.demo.app but not from org.openhab.demo.app
I have installed IDE due to earlier advice's and README.md
I have done Resolve for both demo's
I had to do Perform Setup Tasks....(without P2 Director...) to make org.openhab.core.demo.app work, but org.openhab.demo.app will still not work with rest.
BR Basse
Just compare the pom.xml and bndrun files and "Pimp" the org.openhab.core.demo.app with the missing dependencies.
Thank's a lot. I found the differences and I can now see the PaperUI working and also /rest and g! prompt
There are some Errors but they will be taken care of another day, so far so good.
Thank's a lot. I found the differences and I can now see the PaperUI working and also /rest and g! prompt
Can you post them here to enlighten others that have the same problem? :)
I also need some help, sorry 👼
Install Bndtools in your Eclipse IDE. (Is automatically installed if you have used the Eclipse Installer for openHAB development.)
From which openHAB development installation do I need to start? Here two installation options are described: "Add-on Development" and "Core Development". Does it matter?
I have followed the second installation method, but after waiting for the "Perform Setup Tasks..." to finish, I have errors in the "Bundles", "BOM" and "Integration Tests" packages.
I have also tried with a new and empty Workspace ("File" -> "Switch Workspace"), downloaded maggu's "openhab-demo" repo and imported it to the Workspace. After some minutes, the "Build" process ends, but the pom.xml file complains about the following missing artifacts: allplay-tchaikovsky.jar, allplay-tchaikovsky-sources.jar, harmonyhub-harmony-client-1.1.2.jar, leapmotion-LeapJava.jar and plclogo-Moka7-1.0.2_io_patch.jar.
I feel really stupid 😢
allplay-tchaikovsky.jar, allplay-tchaikovsky-sources.jar, harmonyhub-harmony-client-1.1.2.jar, leapmotion-LeapJava.jar and plclogo-Moka7-
I didn't had those problems a week ago. But now there are so many more extensions ported. Did you try to right lick on the pom, and click on Maven->Update Project?
You can also add those projects (allplay and harmonyhub etc) from openhab2-addons to the workspace. They probably include those dependencies as "libs". You probably have found a problem in our current build system (we are not exposing those "libs" via the bom [bill of material]).
I wanted to get an IDE setup for working on Core and some addons, so I made a setup file and included Markus' Demo app. To build my current IDE, I selected Development (bnd), Demo (test), OH2 Addons, and WebUI. With the OH2 Addons, I make a WorkingSet for the addons that are not yet migrated, so these have errors, but after closing them the only error that showed up was for org.openhab.binding.mqtt.homeassistant.tests/src/main/java/org/openhab/binding/mqtt. Remove the .txt and put this somewhere that will stay accessible by the IDE. Just start the installer, and add this as a user setup in the Github Project catalog. I think I had to run the setup tasks twice. And Resolve the requirements before running Demo (test).
After the home for the Demo app is finalized, and addons migrated, we might be able to use this with some mods for updating the current setup file.

pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.openhab.demo</groupId>
<artifactId>org.openhab.demo.reactor</artifactId>
<version>2.5.0-SNAPSHOT</version>
</parent>
<artifactId>org.openhab.demo.app</artifactId>
<name>openHAB Demo :: App</name>
<dependencies>
<dependency>
<groupId>org.openhab.core.bom</groupId>
<artifactId>org.openhab.core.bom.runtime</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.openhab.core.bom</groupId>
<artifactId>org.openhab.core.bom.openhab-core</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>runtime</scope>
</dependency>
<!-- TODO: Create a BOM for Web UIs in the Web UI repo and use it here -->
<dependency>
<groupId>org.openhab.ui</groupId>
<artifactId>org.openhab.ui.paper</artifactId>
<version>${project.version}</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-indexer-maven-plugin</artifactId>
<configuration>
<includeJar>true</includeJar>
</configuration>
</plugin>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-export-maven-plugin</artifactId>
<configuration>
<failOnChanges>false</failOnChanges>
<bndruns>
<bndrun>app.bndrun</bndrun>
</bndruns>
</configuration>
</plugin>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-resolver-maven-plugin</artifactId>
<configuration>
<bndruns>
<bndrun>app.bndrun</bndrun>
</bndruns>
</configuration>
</plugin>
</plugins>
</build>
</project>
Thanks , and then app.bndrun
-standalone: \
target/index.xml;name="org.openhab.demo.app"
../../bom/runtime-index/target/index.xml;name="org.openhab.core.bom.runtime-index",\
../../bom/openhab-core-index/target/local-index.xml;name="org.openhab.core.bom.openhab-core-index"
-resolve.effective: active
feature.logging: \
bnd.identity;id='org.apache.felix.log',\
bnd.identity;id='org.apache.felix.logback'
feature.debug: \
osgi.identity;filter:='(osgi.identity=org.apache.felix.webconsole)',\
osgi.identity;filter:='(osgi.identity=org.apache.felix.webconsole.plugins.ds)',\
osgi.identity;filter:='(osgi.identity=org.apache.felix.gogo.shell)',\
osgi.identity;filter:='(osgi.identity=org.apache.felix.gogo.runtime)',\
osgi.identity;filter:='(osgi.identity=org.apache.felix.gogo.command)'
feature.openhab-base: \
bnd.identity;id='org.openhab.core.config.core',\
bnd.identity;id='org.openhab.core.config.discovery',\
bnd.identity;id='org.openhab.core.config.dispatch',\
bnd.identity;id='org.openhab.core.config.xml',\
bnd.identity;id='org.openhab.core',\
bnd.identity;id='org.openhab.core.storage.mapdb',\
bnd.identity;id='org.openhab.core.binding.xml',\
bnd.identity;id='org.openhab.core.id',\
bnd.identity;id='org.openhab.core.semantics',\
bnd.identity;id='org.openhab.core.scheduler',\
bnd.identity;id='org.openhab.core.thing',\
bnd.identity;id='org.openhab.core.thing.xml',\
bnd.identity;id='org.openhab.core.transform',\
bnd.identity;id='org.openhab.core.audio',\
bnd.identity;id='org.openhab.core.voice',\
bnd.identity;id='org.openhab.core.io.console',\
bnd.identity;id='org.openhab.core.io.monitor',\
bnd.identity;id='org.openhab.core.io.net',\
bnd.identity;id='org.openhab.core.io.http',\
bnd.identity;id='org.openhab.core.io.rest',\
bnd.identity;id='org.openhab.core.io.rest.optimize',\
bnd.identity;id='org.openhab.core.io.rest.core',\
bnd.identity;id='org.openhab.core.io.rest.sse'
feature.openhab-model-runtime-all: \
bnd.identity;id='org.openhab.core.model.item.runtime',\
bnd.identity;id='org.openhab.core.model.persistence.runtime',\
bnd.identity;id='org.openhab.core.model.rule.runtime',\
bnd.identity;id='org.openhab.core.model.script.runtime',\
bnd.identity;id='org.openhab.core.model.sitemap.runtime',\
bnd.identity;id='org.openhab.core.model.thing.runtime'
-runrequires: \
bnd.identity;id='org.eclipse.equinox.metatype',\
${feature.logging},\
${feature.debug},\
${feature.openhab-base},\
${feature.openhab-model-runtime-all},\
bnd.identity;id='org.openhab.core.io.console.rfc147',\
bnd.identity;id='org.openhab.core.automation',\
bnd.identity;id='org.openhab.core.automation.module.media',\
bnd.identity;id='org.openhab.core.automation.module.script',\
bnd.identity;id='org.openhab.core.automation.module.script.rulesupport',\
bnd.identity;id='org.openhab.core.automation.rest',\
bnd.identity;id='org.openhab.core.compat1x',\
bnd.identity;id='org.openhab.ui.paper',\
osgi.identity;filter:='(&(osgi.identity=javax.annotation-api)(version>=1.2.0))',\
osgi.identity;filter:='(&(osgi.identity=javax.jmdns)(version>=3.5.5))',\
osgi.identity;filter:='(&(osgi.identity=javax.servlet-api)(version>=3.1.0))',\
osgi.identity;filter:='(&(osgi.identity=org.apache.servicemix.specs.annotation-api-1.3)(version>=1.3.0))',\
osgi.identity;filter:='(&(osgi.identity=org.eclipse.jetty.jmx)(version>=9.4.11))',\
osgi.identity;filter:='(&(osgi.identity=org.jupnp)(version>=2.5.2))',\
osgi.identity;filter:='(&(osgi.identity=tx-control-provider-jdbc-xa)(version>=1.0.0))',\
osgi.identity;filter:='(&(osgi.identity=tx-control-provider-jpa-xa)(version>=1.0.0))'
-runfw: org.eclipse.osgi
-runee: JavaSE-1.8
-runproperties: \
osgi.console=,\
osgi.console.enable.builtin=false,\
logback.configurationFile=file:${.}/runtime/logback.xml,\
smarthome.configdir=${.}/runtime/conf,\
smarthome.userdata=${.}/runtime/userdata
-runblacklist: bnd.identity;id='org.apache.aries.javax.jax.rs-api'
#
# done
#
-runbundles: \
com.eclipsesource.jaxrs.jersey-all;version='[2.22.2,2.22.3)',\
com.eclipsesource.jaxrs.publisher;version='[5.3.1,5.3.2)',\
com.google.inject;version='[3.0.0,3.0.1)',\
javax.measure.unit-api;version='[1.0.0,1.0.1)',\
joda-time;version='[2.9.2,2.9.3)',\
log4j;version='[1.2.17,1.2.18)',\
org.antlr.runtime;version='[3.2.0,3.2.1)',\
org.apache.commons.collections;version='[3.2.1,3.2.2)',\
org.apache.commons.exec;version='[1.1.0,1.1.1)',\
org.apache.commons.fileupload;version='[1.3.3,1.3.4)',\
org.apache.commons.io;version='[2.2.0,2.2.1)',\
org.apache.commons.lang;version='[2.6.0,2.6.1)',\
org.apache.felix.configadmin;version='[1.9.8,1.9.9)',\
org.apache.felix.gogo.command;version='[1.0.2,1.0.3)',\
org.apache.felix.gogo.runtime;version='[1.0.10,1.0.11)',\
org.apache.felix.gogo.shell;version='[1.0.0,1.0.1)',\
org.apache.felix.http.servlet-api;version='[1.1.2,1.1.3)',\
org.apache.felix.inventory;version='[1.0.4,1.0.5)',\
org.apache.felix.log;version='[1.2.0,1.2.1)',\
org.apache.felix.logback;version='[1.0.0,1.0.1)',\
org.apache.felix.scr;version='[2.1.10,2.1.11)',\
org.apache.felix.webconsole;version='[4.3.4,4.3.5)',\
org.apache.felix.webconsole.plugins.ds;version='[2.0.8,2.0.9)',\
org.apache.servicemix.bundles.xstream;version='[1.4.7,1.4.8)',\
org.eclipse.emf.common;version='[2.12.0,2.12.1)',\
org.eclipse.emf.ecore;version='[2.12.0,2.12.1)',\
org.eclipse.emf.ecore.xmi;version='[2.12.0,2.12.1)',\
org.eclipse.equinox.metatype;version='[1.4.500,1.4.501)',\
org.eclipse.jetty.client;version='[9.4.11,9.4.12)',\
org.eclipse.jetty.http;version='[9.4.11,9.4.12)',\
org.eclipse.jetty.io;version='[9.4.11,9.4.12)',\
org.eclipse.jetty.security;version='[9.4.11,9.4.12)',\
org.eclipse.jetty.server;version='[9.4.11,9.4.12)',\
org.eclipse.jetty.servlet;version='[9.4.11,9.4.12)',\
org.eclipse.jetty.util;version='[9.4.11,9.4.12)',\
org.eclipse.jetty.websocket.api;version='[9.4.11,9.4.12)',\
org.eclipse.jetty.websocket.client;version='[9.4.11,9.4.12)',\
org.eclipse.jetty.websocket.common;version='[9.4.11,9.4.12)',\
org.eclipse.jetty.xml;version='[9.4.11,9.4.12)',\
org.glassfish.hk2.external.aopalliance-repackaged;version='[2.4.0,2.4.1)',\
org.mapdb.mapdb;version='[1.0.9,1.0.10)',\
org.ops4j.pax.web.pax-web-api;version='[7.2.3,7.2.4)',\
org.osgi.service.event;version='[1.4.0,1.4.1)',\
org.osgi.service.metatype;version='[1.4.0,1.4.1)',\
tec.uom.lib.uom-lib-common;version='[1.0.2,1.0.3)',\
tec.uom.se;version='[1.0.8,1.0.9)',\
org.openhab.core;version='[2.5.0,2.5.1)',\
org.openhab.core.audio;version='[2.5.0,2.5.1)',\
org.openhab.core.binding.xml;version='[2.5.0,2.5.1)',\
org.openhab.core.config.core;version='[2.5.0,2.5.1)',\
org.openhab.core.config.discovery;version='[2.5.0,2.5.1)',\
org.openhab.core.config.dispatch;version='[2.5.0,2.5.1)',\
org.openhab.core.config.xml;version='[2.5.0,2.5.1)',\
org.openhab.core.id;version='[2.5.0,2.5.1)',\
org.openhab.core.io.console;version='[2.5.0,2.5.1)',\
org.openhab.core.io.console.rfc147;version='[2.5.0,2.5.1)',\
org.openhab.core.io.http;version='[2.5.0,2.5.1)',\
org.openhab.core.io.monitor;version='[2.5.0,2.5.1)',\
org.openhab.core.io.net;version='[2.5.0,2.5.1)',\
org.openhab.core.io.rest;version='[2.5.0,2.5.1)',\
org.openhab.core.io.rest.core;version='[2.5.0,2.5.1)',\
org.openhab.core.io.rest.optimize;version='[2.5.0,2.5.1)',\
org.openhab.core.io.rest.sse;version='[2.5.0,2.5.1)',\
org.openhab.core.model.core;version='[2.5.0,2.5.1)',\
org.openhab.core.model.item;version='[2.5.0,2.5.1)',\
org.openhab.core.model.item.runtime;version='[2.5.0,2.5.1)',\
org.openhab.core.model.persistence;version='[2.5.0,2.5.1)',\
org.openhab.core.model.persistence.runtime;version='[2.5.0,2.5.1)',\
org.openhab.core.model.rule;version='[2.5.0,2.5.1)',\
org.openhab.core.model.rule.runtime;version='[2.5.0,2.5.1)',\
org.openhab.core.model.script;version='[2.5.0,2.5.1)',\
org.openhab.core.model.script.runtime;version='[2.5.0,2.5.1)',\
org.openhab.core.model.sitemap;version='[2.5.0,2.5.1)',\
org.openhab.core.model.sitemap.runtime;version='[2.5.0,2.5.1)',\
org.openhab.core.model.thing;version='[2.5.0,2.5.1)',\
org.openhab.core.model.thing.runtime;version='[2.5.0,2.5.1)',\
org.openhab.core.persistence;version='[2.5.0,2.5.1)',\
org.openhab.core.scheduler;version='[2.5.0,2.5.1)',\
org.openhab.core.semantics;version='[2.5.0,2.5.1)',\
org.openhab.core.storage.mapdb;version='[2.5.0,2.5.1)',\
org.openhab.core.thing;version='[2.5.0,2.5.1)',\
org.openhab.core.thing.xml;version='[2.5.0,2.5.1)',\
org.openhab.core.transform;version='[2.5.0,2.5.1)',\
org.openhab.core.voice;version='[2.5.0,2.5.1)',\
org.ops4j.pax.swissbox.optional.jcl;version='[1.8.2,1.8.3)',\
org.ops4j.pax.web.pax-web-jetty;version='[7.2.3,7.2.4)',\
org.ops4j.pax.web.pax-web-runtime;version='[7.2.3,7.2.4)',\
org.ops4j.pax.web.pax-web-spi;version='[7.2.3,7.2.4)',\
ch.qos.logback.classic;version='[1.2.3,1.2.4)',\
ch.qos.logback.core;version='[1.2.3,1.2.4)',\
slf4j.api;version='[1.7.25,1.7.26)',\
org.openhab.core.automation;version='[2.5.0,2.5.1)',\
org.openhab.core.automation.module.media;version='[2.5.0,2.5.1)',\
org.openhab.core.automation.module.script;version='[2.5.0,2.5.1)',\
org.openhab.core.automation.module.script.rulesupport;version='[2.5.0,2.5.1)',\
org.openhab.core.automation.rest;version='[2.5.0,2.5.1)',\
org.openhab.core.boot;version='[2.5.0,2.5.1)',\
org.openhab.ui.dashboard;version='[2.5.0,2.5.1)',\
org.openhab.ui.paper;version='[2.5.0,2.5.1)',\
org.apache.servicemix.bundles.commons-codec;version='[1.3.0,1.3.1)',\
org.apache.servicemix.bundles.commons-httpclient;version='[3.1.0,3.1.1)',\
org.eclipse.jetty.proxy;version='[9.4.11,9.4.12)',\
org.openhab.core.compat1x;version='[2.5.0,2.5.1)',\
org.openhab.core.ui;version='[2.5.0,2.5.1)',\
com.google.gson;version='[2.8.2,2.8.3)',\
com.google.guava;version='[21.0.0,21.0.1)',\
javax.annotation-api;version='[1.2.0,1.2.1)',\
javax.jmdns;version='[3.5.5,3.5.6)',\
javax.servlet-api;version='[3.1.0,3.1.1)',\
org.apache.aries.jpa.javax.persistence_2.1;version='[2.7.0,2.7.1)',\
org.apache.servicemix.specs.annotation-api-1.3;version='[1.3.0,1.3.1)',\
org.apache.xbean.bundleutils;version='[4.12.0,4.12.1)',\
org.apache.xbean.finder;version='[4.12.0,4.12.1)',\
org.eclipse.equinox.common;version='[3.10.200,3.10.201)',\
org.eclipse.equinox.event;version='[1.4.300,1.4.301)',\
org.eclipse.jetty.jmx;version='[9.4.11,9.4.12)',\
org.eclipse.xtend.lib;version='[2.17.0,2.17.1)',\
org.eclipse.xtend.lib.macro;version='[2.17.0,2.17.1)',\
org.eclipse.xtext;version='[2.17.0,2.17.1)',\
org.eclipse.xtext.common.types;version='[2.17.0,2.17.1)',\
org.eclipse.xtext.util;version='[2.17.0,2.17.1)',\
org.eclipse.xtext.xbase;version='[2.17.0,2.17.1)',\
org.eclipse.xtext.xbase.lib;version='[2.17.0,2.17.1)',\
org.jupnp;version='[2.5.2,2.5.3)',\
org.objectweb.asm;version='[7.0.0,7.0.1)',\
org.objectweb.asm.commons;version='[7.0.0,7.0.1)',\
org.objectweb.asm.tree;version='[7.0.0,7.0.1)',\
tx-control-provider-jdbc-xa;version='[1.0.0,1.0.1)',\
tx-control-provider-jpa-xa;version='[1.0.0,1.0.1)',\
tx-control-service-xa;version='[1.0.0,1.0.1)'
This is how I have done to make it work. There are still Errors but at least is the system started.
I have used the original README.md and fulfilled it with advice from David and some more things I have found out. Hope it will be useful.
How to develop in the Eclipse IDE
6a. Delete as: //If there is errors regarding pom.xml for openhab-demo
Regarding openhab2-addons
In Eclipse Package Explorer: Search for app.bndrun in the demo-app project. Double click (takes a few seconds).
7a. Open file app.bndrun for actual bundle
Resolve / Select All / Update and Resolve / Finish
7b. Eclipse Help / Perform Setup Task... / Uncheck P2 Director(...... / Next / Finish
Add your project to "Run requirements" via drag&drop from the package explorer.
Execute with "Run OSGi"
The demo application runs a slim set of openHAB core bundles including automations (next gen rules) and PaperUI. The startup should only take about 5 seconds and you are greeted by the openHAB console where you can type in console commands.
Use the pom.xml and app.bndrun files from earlier Comments in this thread.
//Basse
I'm trying to understand What to do, but I'm still hitting a brickwall. As stated earlier:
Never worked with a "test" project, as far as I understand that would be a binding which also has a "test" "variant" (for example "bluegiga")?
And what is the difference/ How to determine the difference between "unit tests" and "integration tests"?
Without this knowledge I'm bound to do things wrong. Looking at examples of earlier migrated bundles didn't give me a clue!
Sorry for that!
You need to check every class in a ".test" project if that class "extends" anything with "*OSGiTest" in the name. If it does then it is for sure an OSGi integration test. If none of the test classes "extends" then the binding is save to be ported by you according to the guide.
Did one with dsmr binding #5272
Just found out, regarding to Warning-message at startup.
Delete the 2 lines in the beginning of app.bndrun as:
../../bom/runtime-index/target/index.xml;name="org.openhab.core.bom.runtime-index",\ ../../bom/openhab-core-index/target/local-index.xml;name="org.openhab.core.bom.openhab-core-index"
Out of my humble experience the manual guide has some "problems" concerning the migration of the addons/bindings/pom.xml.
Point 1
IMHO not the addons/pom.xml needs to adapted but the addons/bindings/pom.xml.
Point 4 suggests to copy over the pom.xml of an already migrated bundle. IMHO this refers to the same file as above, so this part of point 1 is obsolete. Doing it as suggested the old pom.xml is now overwritten.
In Point 5 the required dependencies should be added, without the original pom.xml that might be difficult.
addons/bindings/pom.xml
Depends. You might migrate a translation or "io" bundle and then it's another pom.xml.
IMHO this refers to the same file as above
Wrong. In each directory is a pom.xml. And you copy one from a migrated bundles directory
Wrong. In each directory is a pom.xml. And you copy one from a migrated bundles directory
My failure, got lost in all those poms!
I've added a migration status list. If something is missing either comment here (or for maintainers update the list).
Made a PR for the Feed Binding #5322
Made a PR for the Robonect Binding#5325.
Keeping my fingers crossed for this one.
@JueBag could You please migrate binding.mcp23017??
I want to create a binding for PCF8574 expander base on mcp23017.
I've noticed that it is based on pi4j which has PCF8574 support buildin
with migrated binding I will by able to copy it and apply all the necessary changes.
P.S. I'm aware that this isn't a good time to develop new bindings, but I want to join the development of OH and this might be a good start
Wouldn't it make sense to enable the Wiki for that repository and migrate the first comment to the wiki?
and the one guy that does it for a living (Markus) is in holiday.
That's not completely correct.
We are using ESH (and will move to OHC) in our products. The same is true for DT (but I don't think they will move to OHC).
My work on openHAB itself is mostly done in spare time / freetime.
allplay-tchaikovsky.jar, allplay-tchaikovsky-sources.jar, harmonyhub-harmony-client-1.1.2.jar, leapmotion-LeapJava.jar and plclogo-Moka7-
I didn't had those problems a week ago. But now there are so many more extensions ported. Did you try to right lick on the pom, and click on Maven->Update Project?
You can also add those projects (allplay and harmonyhub etc) from openhab2-addons to the workspace. They probably include those dependencies as "libs". You probably have found a problem in our current build system (we are not exposing those "libs" via the bom [bill of material]).
Run into the same problem, maybe this should be addressed (in a spearate issue?) somewhere, so it can be discussed how we plan to fix this :)
However, even after importing the already migrated addons (like allplay and so on), most of the errors disappear, but not this one (after building the workspace and also updating all maven projects including updating of snapshot and releases):
Missing artifact org.openhab.bundles:org.openhab.binding.synopanalyzer:jar:2.5.0-SNAPSHOT
Btw.: I nevertheless tried to migrate the groheondus binding and the mvn build for this module only, worked well, see #5350
See #5342
See #5342
I've already the latest version of master, including the changes of this PR :/
Thank you all for your efforts in the BND migration! I'm curious developing openHAB without Eclipse/Tycho 👍 @maggu2810 @wborn Please ping me as soon as tycho is completely wiped out and the final bnd POM structure is established. I have to get the releasebuild running then with this new structure :)
I'm not quite familiar with bnd, so I'd also be happy if you could give me a hint regarding versioning update. Do I just have to update versions within the pom.xml files or are there other places as well? Maybe you have also other hints about things that could raise problems within the release process.
When adding jars in the pom via dependencies what is the guideline for adding <scope>provided</scope>. Am I correct this should always be added? (The example above it missing it)
Yup I think we should always add a scope (most of the time "provided" or "test")
Hi all sorry newbie here...
there's an example/boilerplate of a binding developed in a repository external to this that uses the new bnd approach?
(an hello-world binding with the new packaging)
My problem is that I'm using the old way to develop binding and currently to build an extension with maven I have to:
Can I using the new method avoid to have to rebuild smarthome and use the dependencies from the maven repo?
When the migration has been finished the binding development documentation will be rewritten.
I also favor the idea of having a bnd example repo sitting somewhere, with the same directory layout as with this repo so that a merge pull is possible. But that's not yet the case.
@nicola-lunghi There is no example or binding generator yet for the new bnd approach. But it should be fairly easy to start. A good starting point is to look at a recent merged pull request of a binding that was merged to the bnd build. All diffs are files needed for a bnd build.
@Hilbrand as @davidgraeff mentioned earlier it would be awesome if we could use other IDE to build new bindings. VS Code is very light so maybe consider it? Ideally bindings should be independent of IDE.
Also when working on documentation please include instructions on how to debug binding on an external device. I have openHAB on Raspberry PI and I use Windows to develop. Is it possible to debug binding in such configuration?
Hi all,
I'm working on an example "hello world" module and I want to add some unit test.
is normal that all the test classes needs components from org.eclipse.smarthome?
The final class would be org.openhab.core?
Those packages will be integrated/moved into openhab and disappear after the merge?
examples:
import org.eclipse.smarthome.core.thing.Bridge;
import org.eclipse.smarthome.core.thing.ThingStatus;
import org.eclipse.smarthome.core.thing.ThingStatusDetail;
import org.eclipse.smarthome.core.thing.ThingTypeUID;
import org.openhab.binding.dmx.internal.DmxBridgeHandler;
import org.openhab.binding.dmx.internal.multiverse.BaseDmxChannel;
import org.openhab.binding.dmx.internal.multiverse.Universe;
package org.eclipse.smarthome.core.audio.internal;
import org.eclipse.smarthome.test.TestPortUtil;
import org.eclipse.smarthome.test.TestServer;
import org.eclipse.smarthome.test.java.JavaTest;
is normal that all the test classes needs components from org.eclipse.smarthome?
Yes that's normal, until those packages can be renamed with OH3
Hi again guys!
I have followed the first 4 steps of the "How to develop in the Eclipse IDE" section and I'm able to launch the demo app through the "Run OSGI" button in the "app.bndrun" file. Paper UI also loads fine, great. But, after importing the 4 MQTT related projects to the Eclipse IDE, and adding the relevant dependencies to the pom.xml, this is what I get when I try to "Resolve" the "Run requirements":
Resolution failed. Capabilities satisfying the following requirements could not be found:
[<<INITIAL>>]
⇒ osgi.identity: (osgi.identity=org.openhab.core.io.transport.mqtt)
⇒ [org.openhab.core.io.transport.mqtt version=2.5.0.201904040325]
⇒ osgi.wiring.package: (&(osgi.wiring.package=org.eclipse.paho.client.mqttv3)(&(version>=1.2.0)(!(version>=2.0.0))))
[org.apache.aries.jpa.container version=2.7.0]
⇒ osgi.service: (objectClass=javax.persistence.spi.PersistenceProvider)
It seems that the system is unable to download the paho MQTT client library file. Do I need to import the library manually (I don't know how) or can I make the IDE download it for me through Maven?
Thank you!
That part is the exact part that is not yet working :D Markus decided to use Apache Felix as OSGi container without karaf (like openHAB uses it).
That means we have no runtime that downloads dependencies for us. You need to add those dependencies into the pom, that might be enough.
Well, at least it's good to know that I'm not doing anything wrong! 🤣 Thanks for your help David!
Hallo,
I am about to move my WIP binding to the new build. I want to use Eclipse as dev+test env.
I decided to start from scratch with a new Eclipse IDE.
First I installed Eclipse IDE for Java Developers + openHAB Core Development, but it runs forever the startup tasks (I left it running more than 45min and was still looping on some startup tasks...)
So I decided to start with a simple classical Eclipse IDE for Java Developers (Photon), then followed steps at the beginning of this issue:
openhab2-addons\bundles\org.openhab.binding.astro.Maven Project Builder on org.openhab.binding.astroPlatform: Win10.
Any hint?
As anyone tested the instructions at pinned at the top of this issue on Windows?
Eclipse has a bug currently with maven and bnd that ends up in an endless re-build. That was discussed in multiple places so it's not part of the above list (but probably should be). You need to disable automatic rebuild in Eclipse for the moment.
Hi @mvalla!
Yeah, I can confirm that the bug exists on Windows, but I have no problem on Linux (Ubuntu 16.04).
Did you try to build once with maven on the command line? That solved it for me.
Has anyone tried to create a Thing or an Item using the demo.app provided by @maggu2810? After pressing the "Run OSGi" button, openHAB starts fine and Paper UI loads correctly, but I'm not able to create an Astro binding Thing. I have imported the astro binding project and updated the demo.app's pom and app.bndrun files. The binding appears correctly in Paper UI, but I get a "ERROR 503 - Service unavailable" message everytime I enter the Things menu. Chrome reports that it cannot access the ":8080/rest/things" endpoint, so it seems that the error is related to the REST API. Some other tests I've made:
But:
Am I the only one seeing this behaviour? :confused: How are you guys testing your bindings?
The openhab core integration tests are not yet enabled (see https://github.com/openhab/openhab-core/issues/698).
And I'm pretty sure that with updating all the dependency libraries that the openHAB core is currently in a broken state that is only fully resolved when all tests run through again. See also: https://github.com/openhab/openhab-core/issues/699 where I find that metadata cannot be used in the current core, and I guess that also applies for Things.
It seems that the system is unable to download the paho MQTT client library file. Do I need to import the library manually (I don't know how) or can I make the IDE download it for me through Maven?
Will be solved by openhab/openhab-core#702
* "http://localhost:8080/rest/things" doesn'tAm I the only one seeing this behaviour? confused How are you guys testing your bindings?
It works for me.
Using the current demo app, there is no thing shown but an empty thing list is returned.
I added the magic bundle (as the demo.things uses it), resolved the app and started it. Three things are shown (defined in the demo.things) in the Paper UI.
Are you aware that "resolv" does not work as long as DS requirements are disabled in openHAB Core?
My openHAB Core always contains this change: https://github.com/maggu2810/openhab-core/commit/3a2f2ca13c63eea827190df0819fa71907fa4d6a
You need to disable automatic rebuild in Eclipse for the moment.
yes, I disabled automatic rebuild in Eclipse.
Then continued to steps 5-6-7-8 of How to develop in the Eclipse IDE list.
But at step 9. Execute with "Run OSGi" i get many errors listed in a Launch Problem window, like these 2:
Status ERROR: bndtools.core code=0 Cannot find /error/org.openhab.ui.dashboard;version=[2.5.0,2.5.1) Not found in [bndtools.m2e.MavenImplicitProjectRepository@3af1e8ac, bnd-cache [C:/Users/xxxxx/.bnd/default-ws/cnf/cache/4.2.0/bnd-cache r/w=false], org.openhab.demo.app [C:\Users\xxxxx\openhab2\git\openhab-demo\app\target\tmp\resolve\app\cnf\cache\4.2.0\org.openhab.demo.app r/w=false]] null
Status ERROR: bndtools.core code=0 Cannot find /error/com.google.gson;version=[2.8.2,2.8.3) Not found in [bndtools.m2e.MavenImplicitProjectRepository@3af1e8ac, bnd-cache [C:/Users/xxxxx/.bnd/default-ws/cnf/cache/4.2.0/bnd-cache r/w=false], org.openhab.demo.app [C:\Users\xxxxx\openhab2\git\openhab-demo\app\target\tmp\resolve\app\cnf\cache\4.2.0\org.openhab.demo.app r/w=false]] null
...
Did you try to build once with maven on the command line? That solved it for me.
I also did a mvn clean install -DskipChecks from the astro project folder.
It did compile successfully but still cannot start OH2 within Eclipse from the Run OSGi button of the bndtools app window.
has the demo.app + binding (astro) debug worked for anyone with Eclipse +Win10?
(in my git folder I only have checked out openhab2-addons and openhab-demo projects)
help is appreciated!
Ok now I am at the point that:
openhab2-addons and openhab-demo repos are updated from upstreamapp.bndrun and pom.xml in project openhab-demo to include astro bindingmvn clean install -U both the openhab-demo and the astro projectsastro binding does not show up under paperui/configuration/bindings pageso it looks like the astro binding is not loaded even if I added the dependency to it in the openhab-demo project, as instructed in the guide
What could I check to understand why astro binding is not loaded?
- I have modified
app.bndrunandpom.xmlin projectopenhab-demoto includeastrobinding
You don't need to modify the pom.xml of the app. It already contains the addons BOM:
https://github.com/maggu2810/openhab-demo/blob/8dd5982/app/pom.xml#L41-L47
Can you point me to your modification of the app.bndrun?
Normally you add the requirement to runrequires and start the Bnd resolver.
The resolver will add the bundles that fulfil the requirements to runbundles.
I'm afraid to repeat myself: The resolving does not work correctly if you use openHAB Core with disabled DS requirements.
See above:
Are you aware that "resolv" does not work as long as DS requirements are disabled in openHAB Core?
My openHAB Core always contains this change: https://github.com/maggu2810/openhab-core/commit/3a2f2ca13c63eea827190df0819fa71907fa4d6a
If the astro bundle does not need any other currently missing bundle you can modify the `runbundles´ yourself.
Ok since resolve does not work I added manually to Run Bundles:
org.openhab.binding.astro;version='[2.5.0,2.5.1)'
and now the Astro binding is loaded.
New problem: if I modify the code in Astro (added some logs) > added breakpoints > compile > Deubg OSGi
the execution actually stops at the breakpoint, but no source code is open for the breakpoint (Surce not found).
How can I connect source code to the bundle being run ?
Add the source code location "workspace".
ok it works well now, thanks.
the most annoying thing right now is that "Build automatically" cannot be used...
If you are using a window machine it would be great if you could dig into.
If you cannot fix it yourself it would be already a step forward if it is reported to the correct upstream project.
The problems you have had and are now solved by my answered should be perhaps added to the first comment. If you are willing to "create a diff", I am sure some maintainer (or me) will edit the first comment and add what you suggest.
yes I took notes of the followed steps so far and can provide an updated guide for Win.
Now run in a new issue:
tried to run rfxcom binding, added transport.serial.* to RunRequirements/RunBundles but bundle cannot be started:
! Failed to start bundle org.openhab.core.io.transport.serial.rxtx.rfc2217-2.5.0.201904100325, exception Could not resolve module: org.openhab.core.io.transport.serial.rxtx.rfc2217 [128]
Unresolved requirement: Import-Package: gnu.io; version="[3.14.0,4.0.0)"
I read same thing in previous comments for MQTT / Paho by @bodiroga , but honestly I did not understand how to resolve manually the un-resolved lib dependencies (sorry I am definitely not an expert of OSGi).
How gnu.io and javax.comm can be loaded for the demo.app ?
Hi!
I followed the steps indicated in the first post and managed to run the demo app, but there still are some issues that I cannot solve.
1) The logger doesn't work: I get 3 red warnings about the lack of an appender and that log4j is not properly configured (same as in the picture in one of lolodomo's posts). I spent some hours trying to figure out how to configure it with no results. I need to use the logger for debugging, how do I fix the problem?
2) After running OSGi I can load the Paper UI page, but it's empty. There are no bindings or things listed. I used one of the ported bindings to make sure that the environment was properly setup before starting to work on a small project.
Thanks!
I do have some Warnings at startup, are they something to be worried about or will they hopefully disappear when the system-change is finished, if someone has it likely or know about what to do it will be great
BR Basse
"
Welcome to Apache Felix Gogo
g! 15:28:59.928 [nfig-1-thread-1] WARN o.o.p.w.u.ServletContainerInitializerScanner:136 - failed to parse and instantiate of javax.servlet.ServletContainerInitializer in classpath
15:28:59.929 [nfig-1-thread-1] WARN o.o.p.w.u.ServletContainerInitializerScanner:136 - failed to parse and instantiate of javax.servlet.ServletContainerInitializer in classpath
15:28:59.979 [main] WARN o.o.p.w.u.ServletContainerInitializerScanner:136 - failed to parse and instantiate of javax.servlet.ServletContainerInitializer in classpath
15:28:59.979 [main] WARN o.o.p.w.u.ServletContainerInitializerScanner:136 - failed to parse and instantiate of javax.servlet.ServletContainerInitializer in classpath
15:29:00.077 [main] WARN o.o.p.w.u.ServletContainerInitializerScanner:136 - failed to parse and instantiate of javax.servlet.ServletContainerInitializer in classpath
15:29:00.078 [main] WARN o.o.p.w.u.ServletContainerInitializerScanner:136 - failed to parse and instantiate of javax.servlet.ServletContainerInitializer in classpath
log4j:WARN No appenders could be found for logger (org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
15:29:04.307 [main] WARN o.o.p.w.u.ServletContainerInitializerScanner:136 - failed to parse and instantiate of javax.servlet.ServletContainerInitializer in classpath
15:29:04.307 [main] WARN o.o.p.w.u.ServletContainerInitializerScanner:136 - failed to parse and instantiate of javax.servlet.ServletContainerInitializer in classpath
15:29:04.334 [main] WARN o.o.p.w.u.ServletContainerInitializerScanner:136 - failed to parse and instantiate of javax.servlet.ServletContainerInitializer in classpath
15:29:04.334 [main] WARN o.o.p.w.u.ServletContainerInitializerScanner:136 - failed to parse and instantiate of javax.servlet.ServletContainerInitializer in classpath
15:29:04.357 [main] WARN o.o.p.w.u.ServletContainerInitializerScanner:136 - failed to parse and instantiate of javax.servlet.ServletContainerInitializer in classpath
15:29:04.358 [main] WARN o.o.p.w.u.ServletContainerInitializerScanner:136 - failed to parse and instantiate of javax.servlet.ServletContainerInitializer in classpath
15:29:04.388 [main] WARN o.o.p.w.u.ServletContainerInitializerScanner:136 - failed to parse and instantiate of javax.servlet.ServletContainerInitializer in classpath
15:29:04.388 [main] WARN o.o.p.w.u.ServletContainerInitializerScanner:136 - failed to parse and instantiate of javax.servlet.ServletContainerInitializer in classpath
15:29:04.415 [main] WARN o.o.p.w.u.ServletContainerInitializerScanner:136 - failed to parse and instantiate of javax.servlet.ServletContainerInitializer in classpath
15:29:04.415 [main] WARN o.o.p.w.u.ServletContainerInitializerScanner:136 - failed to parse and instantiate of javax.servlet.ServletContainerInitializer in classpath
15:29:04.469 [main] WARN o.e.j.util.thread.ThreadPoolBudget:156 - Low configured threads: (max=12 - required=7)=5 < warnAt=8 for QueuedThreadPool[ServletModel-25]@746da54f{STARTED,8<=8<=12,i=8,q=0}[ReservedThreadExecutor@77978658{s=0/1,p=0}]
"
@mvalla Would be great if you can enhance the documentation and create a PR for https://github.com/maggu2810/openhab-dev-doc/blob/master/maven-bnd.md
@mvalla Would be great if you can enhance the documentation and create a PR for https://github.com/maggu2810/openhab-dev-doc/blob/master/maven-bnd.md
ok will do.
Any hint about resolving lib dependencies like in the case of gnu.io and javax.comm for the org.openhab.core.io.transport.serial.* bundles ?
I am stuck there, see previous comment
An implementation needs to be present at runtime.
Show in the long run they needs to be added to the runtime BOM, for the time being you could add it with scope runtime to the app's POM.
I will do it some time, but no time ATM.
Show in the long run they needs to be added to the runtime BOM, for the time being you could add it with scope runtime to the app's POM.
@maggu2810 I do not understand: since it's needed by org.openhab.core.io.transport.serial.* (which is needed in turn by the rfxcom add-on) why gnu.io is not already part of the tree of dependencies ?
In any case I added the dependency to demo.app pom.xml:
<dependency>
<groupId>com.neuronrobotics</groupId>
<artifactId>nrjavaserial</artifactId>
<version>3.14.0</version>
<scope>runtime</scope>
</dependency>
but nothing has changed, error:
! could not resolve the bundles: [org.openhab.core.io.transport.serial.javacomm-2.5.0.201904100325 org.osgi.framework.BundleException: Could not resolve module: org.openhab.core.io.transport.serial.javacomm [126]
Unresolved requirement: Import-Package: javax.comm
, org.openhab.core.io.transport.serial.rxtx-2.5.0.201904100325 org.osgi.framework.BundleException: Could not resolve module: org.openhab.core.io.transport.serial.rxtx [127]
Unresolved requirement: Import-Package: gnu.io; version="[3.14.0,4.0.0)"
, org.openhab.core.io.transport.serial.rxtx.rfc2217-2.5.0.201904100325 org.osgi.framework.BundleException: Could not resolve module: org.openhab.core.io.transport.serial.rxtx.rfc2217 [128]
Unresolved requirement: Import-Package: gnu.io; version="[3.14.0,4.0.0)"
]
Markus is talking about a commit similar to this one:
https://github.com/openhab/openhab-core/commit/9630a7eb1a8b51c0bd5995164c03efb11db136df
Every dependency like gnu.io need to be added to this bom file. Because openhab core is not yet in a state to ship, a lot of those dependencies are not yet in there.
I have created a PR: https://github.com/openhab/openhab-core/pull/714
Ok but since in my dev env I am not using openhab-core source checkout , and since Markus suggestion to include the lib to demo.app pom did not work, is anything I can do meantime ?
or I must now wait for gnu.io to be added to the BOM of openHAB-core ?
Try to use scope provided as suggested by Markus.
The core bom file is included in your demo pom.xml file if you look closely. So yes the error will go away a few days after the merge and when your local cache has refreshed.
neither scope provided or runtime work if added to demo.app ...
So I checked out openhab-core, added nrjavaserial and javax.comm (which needs to be installed manually from Oracle, is not available in public repos) to openhab-core\bom\runtime\pom.xml, just below where Paho MQTT was added.
then did mvn clean install openhab-core --> OK
then did mvn clean install demo.app ---> still ERROR:
[ERROR] Failed to execute goal biz.aQute.bnd:bnd-export-maven-plugin:4.2.0:export (default) on project org.openhab.demo.app: Unable to resolve <<INITIAL>>: missing requirement osgi.identity;filter:='(osgi.identity=org.openhab.core.io.transport.serial.javacomm)' [caused by: Unable to resolve org.openhab.core.io.transport.serial.javacomm version=2.5.0.201904130905: missing requirement osgi.wiring.package;filter:='(&(osgi.wiring.package=javax.comm))'] -> [Help 1]
I do not understand why even if javax.comm has been manually installed on my local repo, and openhab-core has been built + installed, demo.app won't' build.
Ready to give up.... and wait for the openhab-core release.....
Every dependency like gnu.io need to be added to this bom file. Because openhab core is not yet in a state to ship, a lot of those dependencies are not yet in there.
I don't understand your statement.
Where do you want to ship the framework?
The openHAB Distribution (that's the one that is shipped AFAIK) is using Karaf and does not use the runtime POM at all.
Try to use scope provided as suggested by Markus.
Did I? The scope depends on what you want to do. For runtime support only, provided is not the correct one.
So yes the error will go away a few days after the merge and when your local cache has refreshed.
You do not need to wait, you can all the time add the runtime stuff you need yourself in your app.
What I have done:
app.bndrun of org.openhab.demo.apporg.openhab.core.io.transport.serial.rxtx to the run requirementsgnu.iopom.xml file of org.openhab.demo.app to add the runtime support<dependency>
<groupId>com.neuronrobotics</groupId>
<artifactId>nrjavaserial</artifactId>
<version>3.15.0</version>
<scope>runtime</scope>
</dependency>
app.bndrun of org.openhab.demo.appI (re)started with a clean situation (Eclipse fresh install) and now I am stuck at a point already seen by @bodiroga where:
http://localhost:8080/rest/things returns HTTP ERROR 503 Service Unavailable. This problem was not present in my previous IDE test.I have checked out openhab2-addons and openhab-demo from GIT, built both from command line, but have not checked out openhab-core.
Any idea what now causes /rest/things not to load ?
Any idea what now causes
/rest/thingsnot to load ?
I resolved this by
thanks but did not work for me. what i did:
mvn clean install -DskipChecks -DskipTests -Umvn clean install -DskipChecks -DskipTests -Ustill.... /rest/things gives HTTP ERROR 503
thanks all for the help and suggestions, but after several hours I give up (I was almost there!): bindings development is a mess at the moment.
Will wait until maintainers give a "go" on continuing development, and a list of proven steps to setup the dev env for OH2 with this new build system,
Once things are decently stable and clear, I am ready to help to write a good Dev guide for beginners.
I have found that when I add a binding to demo.app then do "Resolve" the produced Run Bundles list (-runbundles) does not contain this entry:
org.eclipse.equinox.event;version='[1.4.300,1.4.301)',\
and this causes /rest/things not to load anymore.
If I add that line manually to the app.bndrun source, /rest/things in the demo app works again.
Note sure what's the best place to mention it: The Zigbee and Z-Wave bindings also require a migration, but they are both located in separate repositories (and not here).
I don't know how easy/hard their migration might be - but we will need to liaise with @cdjackson on the timing and structure.
Thanks Kai - I’m happy if someone wants to migrate things. If someone can create the PR for the two repos, then I’d like to test and merge myself so I’m happy it’s working :)
Since I’m not really familiar with this, I can’t answer your question, but am happy to try and help if someone has any questions etc...
On 28 Apr 2019, at 21:43, Kai Kreuzer notifications@github.com wrote:
Note sure what's the best place to mention it: The Zigbee and Z-Wave bindings also require a migration, but they are both located in separate repositories (and not here).
I don't know how easy/hard their migration might be - but we will need to liaise with @cdjackson https://github.com/cdjackson on the timing and structure.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/openhab/openhab2-addons/issues/5005#issuecomment-487413719, or mute the thread https://github.com/notifications/unsubscribe-auth/AAH6IQ46Q6WTVHKHJJVVTIDPSYD6BANCNFSM4G2UUP7A.
I‘ll raise PR for that in the next days.
Both Zigbee and Z-Wave also have the epl1.0 license and smarthome schema locations in xmls. Should that also be changed?
Sure - although I wouldn’t bother trying to change the thing XML defs in ZWave. If you can tell me what it needs to change to, I’ll do this - there are around 1000 files and they are auto-generated from a database so I can update it there.
On 28 Apr 2019, at 22:05, Hilbrand Bouwkamp notifications@github.com wrote:
Both Zigbee and Z-Wave also have the epl1.0 license and smarthome schame locations in xmls. Should that also be changed?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/openhab/openhab2-addons/issues/5005#issuecomment-487415312, or mute the thread https://github.com/notifications/unsubscribe-auth/AAH6IQ7DCXH35HCDCWL5UGLPSYGRNANCNFSM4G2UUP7A.
This needs to be changed in the xml:
https://github.com/openhab/openhab2-addons/pull/5026#issuecomment-476709809
We might want to wait with closing this issue until the zigbee+zwave binding migrations are done as well (although they are not in this repo, I know).
Also, I think the parent pom should now be changed as well, see https://github.com/openhab/openhab2-addons/blob/master/pom.xml#L10-L17.
Yes I'm on it.
Those locations need to be adapted: https://github.com/openhab/openhab2-addons/search?q=poms%2Fbnd&unscoped_q=poms%2Fbnd I guess?
I also wanted to move the features/karaf to features/ while moving infrastructure files around.
Is there anything to be done in order to get to another Milestone release (beside zigbee, zwave)?
We might want to wait with closing this issue until the zigbee+zwave binding migrations are done as well (although they are not in this repo, I know).
Also, I think the parent pom should now be changed as well, see https://github.com/openhab/openhab2-addons/blob/master/pom.xml#L10-L17.
I assume all is done now and this issue can be closed.
Hello, folks,
somehow I'm totally lost. Since I urgently needed a binding for the PCA9685 16 channel PWM module, I wrote a binding. I need the PCA9685 module for my aquarium computer based on OpenHAB. Everything I found didn't work, or uses scripting languages as workarounds. I'm not very happy with a scripting workaround. I preferred to use the I2C library from pi4j, because I think this is the most basic solution. But anyhow.
The first version of the binding is nealy finished. But - it was running only on my build system. I not able to create a JAR file. As development base I use the instructions from Kai's old instruction videos. Now I've been desperately trying to get my development environment to work for days. None of the web instructions worked for me. Now I also read about this migration. And also the manual here all run into emptiness.
Should I better wait at the moment, until the migration is finished? Is there a particularly current manual for beginners who lose themselves in the gigantic size of the directories?
Cheers Gabriel
hi guys.
any plan to update the various examples? could be useful to have an example
binding project for example.
cheers
Nick
On Sun 5 May 2019, 13:28 Gabriel Sieben, notifications@github.com wrote:
Hello, folks,
somehow I'm totally lost. Since I urgently needed a binding for the
PCA9685 16 channel PWM module, I wrote a binding. I need the PCA9685 module
for my aquarium computer based on OpenHAB. Everything I found didn't work,
or uses scripting languages as workarounds. I'm not very happy with a
scripting workaround. I preferred to use the I2C library from pi4j, because
I think this is the most basic solution. But anyhow.The first version of the binding is nealy finished. But - it was running
only on my build system. I not able to create a JAR file. As development
base I use the instructions from Kai's old instruction videos. Now I've
been desperately trying to get my development environment to work for days.
None of the web instructions worked for me. Now I also read about this
migration. And also the manual here all run into emptiness.Should I better wait at the moment, until the migration is finished? Is
there a particularly current manual for beginners who lose themselves in
the gigantic size of the directories?Cheers Gabriel
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/openhab/openhab2-addons/issues/5005#issuecomment-489421924,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGB6YTANPQCVIM65OS7RUIDPT3HGRANCNFSM4G2UUP7A
.
The remaining roadmap looks like this:
The binding skeleton (via maven archetype) is already working, but it need to be shown on how to use maven archetypes from different IDEs.
any plan to update the various examples?
I only know of the archetype as example. Are there more that need to be adapted?
. As development base I use the instructions from Kai's old instruction videos.
That surely doesn't work. @kaikreuzer can you please remove that video for now
- Write a new developer setup section for openHAB docs for different IDEs on how to set them up. I'm thinking of Eclipse, Intellij IDEA and VS Code.
I'm looking forward VS Code.
Current development setup is user unfriendly. This must be as easy as possible to help users with development.
@davidgraeff is there an option do debug binding on Raspberry Pi? Develop in on PC and debug on external device? If this is possible then please add it to docs. If it isn't possible is there an option to add such an enhancement? It would help with developing and testing bindings like my PCF8574
openHAB uses Karaf and you can enable Java Remote debugging for Karaf: https://karaf.apache.org/manual/latest-2.x/developers-guide/debugging.html. I did not have the time to test it, yet. As soon as it is easier to get a running development environment in Eclipse I will test it myself.
@kaikreuzer can you please remove that video for now
Ok, I have unlisted them.
you can enable Java Remote debugging for Karaf
This is automatically done if you launch openHAB with start_debug.sh instead of start.sh.
With PDE, all you needed to do is to create a launch config of type "Remote Java Application" and connect to it - pretty easy.
In the bnd IDE, I don't see this type anymore, though, but I am sure that there's some other similar mechanism.
I think this guide is quite universal: http://www.joern-karthaus.de/blog/karaf.html
I can no more compile a binding in development.
[INFO] Resolving dependencies of MavenProject: org.openhab.binding:org.openhab.binding.rotel:2.5.0-SNAPSHOT @ D:\dev\openhab2\git\openhab2-addons\addons\binding\org.openhab.binding.rotel\pom.xml
[INFO] {osgi.os=linux, osgi.ws=gtk, org.eclipse.update.install.features=true, osgi.arch=x86}
[ERROR] Cannot resolve project dependencies:
[ERROR] Software being installed: org.openhab.binding.rotel 2.5.0.qualifier
[ERROR] Missing requirement: org.openhab.core 2.5.0.201905060301 requires 'osgi.service; (objectClass=org.osgi.service.event.EventAdmin)' but it could not be found
[ERROR] Cannot satisfy dependency: org.openhab.binding.rotel 2.5.0.qualifier depends on: java.package; org.eclipse.smarthome.core.library.types 0.0.0
[ERROR]
[ERROR] See http://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting for help.
[ERROR] Cannot resolve dependencies of MavenProject: org.openhab.binding:org.openhab.binding.rotel:2.5.0-SNAPSHOT @ D:\dev\openhab2\git\openhab2-addons\addons\binding\org.openhab.binding.rotel\pom.xml: See log for details -> [Help 1]
Is it now impossible to compile with the old mechanism ?
If I move my binding to the new build system, I assume I will not be able to run it in Eclipse ?
It will be harder and harder to use the old development workflow as we more and more change all bits to the new system. At the moment for your particular problem you only need to edit your launch configuration and add whatever appears when you enter "EventAdmin" (or "events" not sure).
I am moving the binding to the new build system !
But now that the old build system is broken, it is more than urgent to have a clear and easy way to develop with the new build system. I need a way to load my binding in Eclipse and run OH with my binding in Eclipse to test it.
I am also now trying to build my Smartthings binding since I am done making the code review changes but I am getting the same error as @lolodomo is getting:
[ERROR] Cannot resolve project dependencies:
[ERROR] Software being installed: org.openhab.binding.smartthings 2.5.0.qualifier
[ERROR] Missing requirement: org.openhab.core 2.5.0.201905060301 requires 'osgi.service; (objectClass=org.osgi.service.event.EventAdmin)' but it could not be found
[ERROR] Cannot satisfy dependency: org.openhab.binding.smartthings 2.5.0.qualifier depends on: java.package; org.eclipse.smarthome.core.events 0.0.0
It seems like the path forward is to convert my binding to use the new build system. Is that the advised solution? If so, do I follow the Setup the Development Environment instructions at https://www.openhab.org/docs/developer/. Or, the instructions above. I'm confused because this issue is closed and the instructions at https://www.openhab.org/docs/developer/ say the instructions will be updated when the the migration is complete.
Questions about Eclipse setup
Do I need to do anything special to be openhab-core included in the Eclipse setup. Under the old smarthome instruction it talked about including the Smarthome Runtime. Is that still necessary.
How do I get the Infrastructure project?
The migration is not yet complete, it is only finished for this repository, not for the openhab-distro one.
I've merged https://github.com/openhab/openhab-distro/pull/905 now, so we should be getting closer again to a working IDE - would be great if everyone could test and provide feedback, which issues are still left (NOTE: It might take a few hours before the Eclipse Installer picks up the new setup file).
@openhab/2-x-add-ons-maintainers For all bundles with a lib folder, I am seeing errors like

in the official IDE setup and in consequence, they fail to compile. What's wrong here?
Hm. Could be related to my move of the pom.xml file from poms/bndrun/poms.xml to root. I needed to adapt relative paths. Travis and Jenkins were happy though. Try to build with maven on your Mac (which might behave different to Linux?)
Try to build with maven on your Mac
I am trying to get our IDE setup working again for our developers, so the goal here is to have no errors in the IDE. Yes, Maven headless seems to work as Jenkins confirms.
@kaikreuzer, please Check l. 704 in the base pom. I assume that will fix your problem. Could you also check if l. 662 needs to be adapted, too?
@davidgraeff Having moved the pom sounds like a plausible explanation, though. And it seems to hint that using lib folders isn't a good idea anymore...
@J-N-K Thanks, changing l-704 indeed does the trick!
It would be cool if all of you could also try out the new IDE setup as I am really struggling with it a bit... If we want to have it ready for the community again, we should make sure that it works reliable - I think I have now created PRs to have at least all compilation and buildpath errors resolved, so that's a start.
I agree we should get rid of the lib folders as soon as possible. We could simply upload all those files to bintray and add them as dependencies.
Most of need wrapping, though. And I didn‘t manage to wrap libs that are used in itests because bnd can‘t do that.
For new bindings with external libs we should push contributors to ask upstream for OSGi bundled variants.
I think I have now created PRs to have at least all compilation and buildpath errors resolved
All, but marytts as it required a Maven build to be executed. We might be able to add that as a setup task in the Oomph file...
Could you create an openhab team on jcenter
You cannot directly upload stuff to jcenter, you upload it to Bintray and we have a Maven repo there: https://bintray.com/openhab/mvn
I can provide access to the addon maintainers, if you provide me your Bintray account name - but let's first clarify on #5503, where to upload it to exactly.
I have now changed my development environment to the new build system followed the instructions from here https://www.openhab.org/docs/developer/
Everything works so far, but I can not export the binding as plugin.
The dialog is empty:

Any ideas?
That dialog is for PDE stuff.
Just use the JAR file in your target directory.
Looking for guidance from the OH core devs before making an IDE setup guide PR.
As of 15May19 bndtools does not support latest Eclipse available to download (2019-06) in the Eclipse installer. Latest support is 2019-03. See "Additional Details" in https://marketplace.eclipse.org/content/bndtools
Eclipse version compatibility has been a sore point for new devs for a while.
I recommend changing https://www.openhab.org/docs/developer/#eclipse-ide-setup step #2 to be more specific, be that a specific Eclipse version or specify downloading the latest 'released' version. Knowing that both ways have their drawbacks, what are your thoughts?
As of 15May19 bndtools does not support latest Eclipse available to download (2019-06) in the Eclipse installer. Latest support is 2019-03. See "Additional Details" in https://marketplace.eclipse.org/content/bndtools
Is 2019-06 already released? It is not listed in https://projects.eclipse.org/releases
I assume it is not stated on that page because it is not released yet.
I did not realize problems using 2019-06.
I've updated the migration steps in the second comment to use the skeleton script.
Most helpful comment
@lolodomo You are in the wrong topic for this suggestion. Here it is all about migrating all bindings as fast and clean as possible, because the core is currently "broken" until all bindings have been migrated.
After the migration and after the core has been fixed, we will think about how to develop bindings under these new conditions.
It may not even be Eclipse anymore, but Visual Studio Code as it is super easy to write addons for it. With an addon we can add "Run" and "Debug" buttons that do all the fancy OSGi container starting and maven dependency manipulation in the background.