Adding resources into plugins
It is often required to add static resources such as JavaScript files, CSS files, and so on in to our plugins. To enable JIRA to serve these additional static files, they should be defined as downloadable resources.
Getting ready
A resource can be of different types. It is normally defined as a non-Java file that the plugin requires to operate.
Examples of resources that you will come across during JIRA plugin development include, but are not restricted to, the following:
Velocity (
*.vm
) files required to render a viewJavaScript files
CSS files
Property files for localization
How to do it…
To include a resource, add the resource
module to the atlassian-plugin.xml
file. The resource
module can be added as part of the entire plugin or can be included within another module, restricting it just for that module.
The following are the attributes and elements available for the resource
module and their uses:
Name |
Description |
---|---|
|
The name of the resource. This is used... |