Adding external libraries

You can add a JAR as an external library to your plug-in. The assumption is that you worked from the template plug-in as described.

About this task

To add external libraries, do the following steps:


  1. Copy the external JAR to the root of the "build" folder.
  2. Edit MANIFEST.MF in the "build" folder and locate the line that starts with Bundle-ClassPath.
  3. Add the JAR to the classpath after the dot.

    It must be comma-separated and can be on the same line or on a separate line. If the JAR is on a separate line, ensure that you add a space at the beginning of the line.

    Bundle-ClassPath: .,
  4. Run the jar command from the "build" folder (as described in the previous topic) to create a JAR that includes everything in the build folder, making sure to include your external JAR.

    c:\customFunction\build jar cvfm custom-function-plug-in_1.0.0.jar MANIFEST.MF com plug-in.xml external-library.jar