Handling Code Dependencies
Eclipse SmartHome Packages
When implementing a binding, you should make sure that you do not introduce too many dependencies on different parts of Eclipse SmartHome. The following list of Java packages should suffice (if you use create binding scripts to create a binding these packages will be automatically added as imports in the manifest):
Depending on the kind of communication that you need to implement, you can optionally also add any exported packages from these bundles:
You might also have the need to use other libraries for specific use cases like XML processing etc. In order to not have every binding use a different library, the following packages are available by default:
For XML processing
For JSON processing
For HTTP operations
3rd Party Libraries
If you want your binding to rely on a custom library that might not even be an OSGi bundle, you can embed it in your bundle as a jar file following these steps:
- Put your jar file in the file system of your project (e.g.
- Add the new library to the
bin.includessection of your build.properties file to make sure that the library will be included in the binary.
- To compile the binding in Eclipse, you have to add the library to your
.classpathas well. Do this by adding a new classpath entry:
<classpathentry kind="lib" path="lib/library.jar"/>
- Add the library project to the bundle classpath in MANIFEST.MF file
Bundle-ClassPath: ., lib/library.jar
Keep in mind that if you want to use third party libraries they have to be compatible with the list of licenses approved for use by third-party code redistributed by Eclipse projects.
Every bundle must contain an about.html file, listing the 3rd party libraries and their licenses. For additional information check the Guide to the Legal Documentation.