Run Apache Felix 4.0.2 in IntelliJ IDEA 11

≡放荡痞女 提交于 2019-12-18 16:52:10

问题


According to this post, IDEA uses Osmorc to run OSGi frameworks. It, in turn, uses Pax Runner to launch different framework implementations.

The toolchain in IDEA 11 can only run Apache Felix up to 3.0.2, but I have to run version 4.0.2. Is it possible? Do other OSGi framework launchers exist for IDEA?


回答1:


You can configure the OSGI frameworks that Osmorc uses from the plugin+ project settings. I use IntelliJ IDEA 11.1.2 and Osmorc 1.4.2.

Here is a screenshot where I configure the OSGI container (at IDE Settings-->OSGi) to some local installation of Apache Felix 4.0.1.

You can also define your custom framework/container and then select the desired OSGI framework to use at Project Settings-->OSGI as seen below:

In order to create Run configurations, you first need to create some OSGi facets. Hopefully, you are also using maven and the maven-bundle-plugin which will greatly reduce the amount of configuration you need to do(since OSmorc automatically syncs with your pom.xml), but even if you do not, you can manually edit the information for creating the bundles.

So, what you need to do next is create some OSGi facets. Go to Project "Structure-->Facets" and add a new OSGi facet for each bundle you wish to create. It you have automatic detection turned on, then the facets maybe already there. If not, then add them manually and then configure them as you see appropriate, like in the following example.

Finally edit your "Run Configurations" and add a new OSGi run configuration. Select the framework you wish to use and the bundles you wish to start as well as other parameters, like in the following example:



来源:https://stackoverflow.com/questions/11018923/run-apache-felix-4-0-2-in-intellij-idea-11

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!