I’m working on an OSGi/Equinox plugin and cannot seem to get the Hibernate dependencies working. I’ve added the Hibernate dependencies to my POM with Eclipse and it has successfully downloaded them.

However, I simply cannot use them in any project classes – as if they have not even been added as dependencies.

Why can I not simply add Hibernate as a dependency and then use it in my code? What’s missing?
I know this should be really straight forward and I assume I’m missing something somewhere. A little pointer would be greatly appreciated.
Cheers
I assume you are using Eclipse Plug-in Development Environment (PDE)? If so, you need to add the package
org.hibernate.cfg(and probably others) to the imported packages for your bundle (go to the Dependencies tab of the manifest editor).PDE’s approach is to only allow your code to see packages that you have explicitly imported first. Other tools such as Bndtools allow your code to see all packages on the build path, and subsequently generate the OSGi
Import-Packagestatement based on what you actually used.