Include plugin descriptor with the correct name and location
Include compiled classes for the plugin API interfaces and any supporting classes
Optional: Include any dependency JARs and files in the correct location
A plugin is packaged up as a JAR file and follows many of the typical JAR file patterns.
The following properties are specific to a packaged RHQ plugin.
A plugin descriptor must be provided in a plugin. Without this descriptor, the plugin container will be unable to determine the functionality (resource types and their associated metadata) introduced by the plugin. The plugin descriptor must be located at the following location within the JAR:
For more information on how to write a plugin descriptor, see the plugin descriptor documentation page.
As mentioned in "What are the pieces that make up a plugin?", a plugin is made up of the descriptor and the code implementations of the plugin API interfaces. These implementations, along with any other classes that are written to support them, are located at the root level of the packaged plugin JAR (obviously keeping the package structure in tact). For instance, the following is a snippet of the files found in the platform plugin:
The above snippet shows both the plugin descriptor file as well as a number of component implementations. Each of those classes implements one of the plugin API interfaces, however as previously stated other support classes may be included as well.
Optionally, plugins can include dependency libraries that are not already provided by the RHQ agent. Each plugin is loaded into its own class loader, so there is no risk of a plugin providing a dependency that will conflict with ones from a different plugin.
Dependencies are placed in a lib directory inside of the packaged plugin JAR, located at the root of the file. Any JAR files not placed in this directory will not be loaded into the class loader.
Additionally, resource files may be placed in this directory as well and will be accessible in the plugin's classpath.