开发者

Launching OSGi from IDEA

开发者 https://www.devze.com 2023-02-01 11:21 出处:网络
I develop scala application using IntelliJ IDEA. I\'d like my application modules to be OSGi bundles.

I develop scala application using IntelliJ IDEA. I'd like my application modules to be OSGi bundles. In Eclipse it is possible to create a project which is both scala project and plug-in project. Eclipse also supports launching of Equinox platform and provides great configuration tool of which bundles to start and how. But I can't use Eclipse because of poor and slow scala plugin, so I need to use IntelliJ IDEA. In IDEA I tried Osmorc for running OSGi but this solution is very immature and doesn't work well. What are the other ways of launchin开发者_开发知识库g and configuring an OSGi application from IDEA?


Not an exact answer, but one possibility would be to:

  • set up a scala project with sbt and Intellij
  • use bnd4sbt (It enables you to create OSGi bundles for your SBT projects)
  • use scalamodules (a domain specific language for OSGi development)

(All thanks to the work of WeigleWilczek, including Heiko Seeberger who contributes here)


All the OSGi frameworks can be launched as standard Java processes. For example to launch Felix:

java -jar path/to/felix.jar

To launch Equinox:

java -jar path/to/org.eclipse.osgi_version.jar

And so on.

Unfortunately the initial configuration differs substantially between framework implementations. For Felix you need a config.properties file, which is typically in the conf directory of the Felix installation directory (or you can set the felix.config.properties system property to point it elsewhere).


I'm using PAX runner from inside Intellij IDEA to provision (deploy) OSGI bundles to Apache Felix and run the framework, but this is very annoying: I have to run "mvn install" first, then stop the running pax provisioning session, then restart it - for every change I make in the bundle. There got to be be a better way...

0

精彩评论

暂无评论...
验证码 换一张
取 消