Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bnd-run target #1707

Merged
merged 1 commit into from
Dec 24, 2024
Merged

Add bnd-run target #1707

merged 1 commit into from
Dec 24, 2024

Conversation

dalgwen
Copy link
Contributor

@dalgwen dalgwen commented Dec 18, 2024

This allows running the demo project from the command line, using the bnd maven plugin.

mvn bnd-run:run

You can also add an agent to remote debug openHAB, and even hotswap with your IDE :

mvn -D-runjdb=10001 package bnd-run:run

I'm no expert, and unless I missed something obvious, this seems the best (essential) way to develop/run/debug with Intellij IDEA or IDEs other than Eclipse. If accepted, I think I should also update the Intellij IDEA page from documentation to include this.

@dalgwen dalgwen requested a review from a team as a code owner December 18, 2024 08:10
This allows running the demo project from the command line, using the bnd maven plugin.

mvn bnd-run:run

You can also add an agent to remote debug openHAB, and even hotswap :

mvn -D-runjdb=10001 package bnd-run:run

This is very useful when using Intellij IDEA or IDEs other than Eclipse.

Signed-off-by: Gwendal Roulleau <[email protected]>
Copy link
Member

@wborn wborn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be useful when it works!

Though it doesn't start at all for me when running mvn bnd-run:run

Lot's of bundles cannot be resolved:

! could not resolve the bundles: [org.openhab.core-5.0.0.202412241339 org.osgi.framework.BundleException: Could not resolve module: org.openhab.core [120]
  Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=21))"

, org.openhab.core.addon-5.0.0.202412241339 org.osgi.framework.BundleException: Could not resolve module: org.openhab.core.addon [121]
  Unresolved requirement: Import-Package: org.openhab.core.common; version="[5.0.0,6.0.0)"
    -> Export-Package: org.openhab.core.common; bundle-symbolic-name="org.openhab.core"; bundle-version="5.0.0.202412241339"; version="5.0.0"
       org.openhab.core [120]
         Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=21))"
  Unresolved requirement: Import-Package: org.openhab.core; version="[5.0.0,6.0.0)"
    -> Export-Package: org.openhab.core; bundle-symbolic-name="org.openhab.core"; bundle-version="5.0.0.202412241339"; version="5.0.0"; uses:="org.osgi.framework"

It starts without any issues in Eclipse.

@wborn
Copy link
Member

wborn commented Dec 24, 2024

After making some changes to my .bashrc file it now does properly find Java 21 and it is able to start the bundles. 🙂

Copy link
Member

@wborn wborn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Would be nice if you can add some docs for this so devs can discover and use it.

@wborn wborn merged commit bb1def0 into openhab:main Dec 24, 2024
3 checks passed
@wborn wborn added this to the 5.0 milestone Dec 24, 2024
dalgwen added a commit to dalgwen/openhab-docs that referenced this pull request Dec 27, 2024
dalgwen added a commit to dalgwen/openhab-docs that referenced this pull request Dec 27, 2024
dalgwen added a commit to dalgwen/openhab-docs that referenced this pull request Dec 27, 2024
dalgwen added a commit to dalgwen/openhab-docs that referenced this pull request Dec 27, 2024
dalgwen added a commit to dalgwen/openhab-docs that referenced this pull request Dec 27, 2024
dalgwen added a commit to dalgwen/openhab-docs that referenced this pull request Dec 27, 2024
stefan-hoehn pushed a commit to openhab/openhab-docs that referenced this pull request Dec 30, 2024
* [development] Adding generic, maven based run and debug.

Also see openhab/openhab-distro#1707

Signed-off-by: Gwendal Roulleau <[email protected]>

* [development] Adding generic, maven based run and debug.

Apply MR comments

Signed-off-by: Gwendal Roulleau <[email protected]>

* [development] Adding generic, maven based run and debug.

Apply MR comments

Signed-off-by: Gwendal Roulleau <[email protected]>

---------

Signed-off-by: Gwendal Roulleau <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants