A new OSGi tool… kindof…

After watching the #osgitool session the other day which covered some pretty advanced OSGi tooling, it occurred to me that given the learning and migration curve to use OSGi, there are people a long way from using it, but who could benefit from the OSGi metadata everyone is spending time on.

How so? Well, Eclipse supports ‘Access Rules’ on dependency libraries which essentially mimic the Export-Package property in OSGi. A tool which allows you to easily set up this configuration based on the manifest would allow you to respect the (normally carefully crafted) Export-Package restrictions without going all the way to OSGi. Hopefully this means that you’re less likely to use APIs which are considered internal, and so when you’re upgrading the version of your dependency, there’s less likelihood of accidental incompatibilities.

The source to this (very simple) plugin is on github, and along with a built jar which you can drop in the dropins folder.

Then, to use it, simply right-click on a Java project and select “Refresh OSGi export restrictions”. This will then scan the dependent jars and their manifests, and for OSGi bundles, update the Access Rules to explicitly allow use of exported packages, and forbid use of all other packages (this is visible in the Java Build Path/Libraries tab).

If it’s useful and you have feedback, please use the tracker on github.

About these ads
Tagged ,

One thought on “A new OSGi tool… kindof…

  1. test says:

    Completely I share your opinion. It seems to me it is excellent idea. Completely with you I will agree….

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: