I’m feeling a bit lost with maven/bnd on eclipse/bndtools. The tutorial on https://bndtools.org/tutorial.html is unfortunately outdated.
I like to archive the following:
Having openhab-core in my eclipse workspace, as well as a maven/bnd project: Works
Start a bndrun file (for example the demo one), and add my maven/bnd project bundle or any other eclipse workspace maven/bnd project bundles to it: No idea
I know how to handle this with Gradle and eclipse/buildship, but in that case the bndrun file is generated. So how do I go forward with an existing bndrun file?
What I have done so far in eclipse
Right click on my maven/bnd project and add the bnd nature (in this case for demo purposes the astro binding)
I can probably just add the jar file to the runtime directory and karaf will resolve and load it. But that doesn’t help with debugging does it? And it doesn’t auto-reload the bundle on changes within eclipse without that additional copy file step.
No, this won’t help with debugging, but you hadn’t mentioned that was a requirement . The IDE is not using Karaf, so it will be slightly different than what you are used to. I’ve added bundles directly from the target directories… never copied to runtime.
Did you look at https://github.com/maggu2810/openhab-demo? This gives me at least a running OH in Eclipse, I didn’t manage to add my own bundles, but only looked at it for a minute or so. Maybe that is a point to start with.
Thanks for the link. The original openhab-core repo works since a few days though. You can start and debug core bundles from within the ide.
But I have not the slightest idea on how to add another bundle to the bnd workspace which to my understanding is a prerequisite to add it to the bndrun file. @maggu2810, do you have a helping link or a few minutes?
We are not using the Bnd workspace or Bnd natures.
We are using Maven + Bnd.
I assume the tutorial
So, do not add the the Bnd nature.
If you would like to learn more about it try to read the enRoute tutorials and documentation.
IIRC I read in this community that tests are not working inside the IDE or debugging is not working.
This is not correct!
Perhaps it does not that way the people think it should work.
So, let’s assume you are using openHAB Core and my openhab-demo branch (imported in the IDE) – what are you missing?
You can open the POM of my demo app (openhab-demo) and add further dependencies.
This dependencies should then be part of bundles you can add.
After all is done you need to resolve the app and you can start and debug it.
For new contributors it need to be easier or better documented of course.
But I guess as soon as we have converted all openhab2-addon projects and the distro, we have a demo bndrun file that can resolve all those addon bundles and the new contributor can basically drag&drop within the bnd UI eclipse interface.
I run openHAB on Raspberry PI, so I’d me happy to know more how to debug code on my Raspberry - develop on PC< then run on Raspberry and get breakpoints on PC (is this possible? )
I’ve cloned demo repo and opened it in eclipse. By that I mean:
I’ve started eclipse and imported maven project into package explorer. I’ve picked the directory where I cloned demo repo.
I’m new to Java so maybe I’m doing this step wrong. How should I open demo folder in eclipse?
Hi!
I see that the link you refers to is another one as I described, Please have a look in this one.
There are a lot of advises which helped me to get my system working.
//Basse
I do need some advice here too,
I read somewhere that you should not use(install) openhab2-addons, is this still true?
If it is possible might it be necessary to rewrite these steps.
Any way this is how I have done the installation, (about not to install openhab-2 addons is not described in the steps you follow, sorry for that).
So I have just let Step 3. Open the directory… and Step 4. Checkout… and Step 5. In Eclipse… be.
Then Step 6. ++
Regarding Step 7b are there some warnings during the installation but at the very end is it in my case as:
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:20 min
[INFO] Finished at: 2019-04-02T13:53:14+02:00
[INFO] ------------------------------------------------------------------------
I’ve opened Eclipse, created a new workspace, in package explorer I choose Import>Maven->Existing Maven Projects, then I selected folder to which I cloned https://github.com/maggu2810/openhab-demo.
According to instructions this project should build after a while, but in my case, all I got are these errors: