Adding the Application Platform Shared Bundles Container
The Application Platform Shared Bundles container has a collection of libraries, which you can add to your project’s classpath. You can use this container for common bundle dependencies. Each project can define its own classpath container for the Application Platform shared bundles container. This classpath container allows you to specify the location of the common bundles in your file system. Make sure that you keep only valid OSGi bundles in this directory. Any non-OSGi jars that are contained in this directory will not be included as part of the library entry.
To add the Application Platform Shared Bundles container
1. In Designer, go to the Package Explorer view, right-click your project, and select Build Path.
2. Click Add Libraries....
3. In the Add Library dialog box, select Application Platform Shared Bundles, and then click Next.
4. In the Edit Variable Entry dialog box, specify the following:
In this field... | Specify... |
Name | The name of the classpath variable. Keep the default value. Default: BUILD_EXTERNAL_DIR Note: | The BUILD_EXTERNAL_DIR variable points to the folder location that contains your project’s external dependencies. |
|
Path | The file path to the shared bundles container in your local directory. To specify the path, click Folder, navigate to the directory that contains the bundles, and click OK. All bundles in the selected directory will be added to your project's classpath. When you specify a path here, the folder structure under that path is available for further selection for this project. Make sure that the selected directories contain valid third-party or external OSGi bundles that are added to the project as library dependencies for compilation purposes. Note that the jars in the selected directories are not included within the project bundle when it is built and deployed to the configured server runtime. |
The directories that you configure in this step are configured in the project assetBuild.properties file for the component.dependencies.external property. This value is used by the Asset Build Environment while building assets to resolve the external dependencies used by the project. The equivalent property in the Asset Build Environment that points to the global external build directory is called build.external.dir and is configured in the master build properties file of the Asset Build Environment.
5. In the Edit Variable Entry dialog box, click OK.
6. Click Finish.
After you complete this configuration, the bundles that are located in the selected directories relative to the BUILD_EXTERNAL_DIR folder value are shown as library dependencies for the project.
If you add, remove, or change bundles in your local directory, refresh your project and build it to ensure that your project’s classpath is updated.
Important: | If you update the BUILD_EXTERNAL_DIR classpath variable to a different location on the file system, update also the projects that use this shared classpath container functionality and select the correct folder(s) that contain the libraries to be added to the classpath. |
Related Topics