Web resources

Fisheye/Crucible plugins may define downloadable resources.If your plugin requires Fisheye/Crucible to include additional static Javascript or CSS files, you will need to use downloadable web resources to make them available. Web resources are included for download, at the top of the page in the HTML's header.

Web resources can also take advantage of caching (i.e. only download a resource if it has changed) and batching (i.e. serve multiple files in one request). If you would like to include other static files for download, such as images, please see Downloadable Plugin Resources.

Defining a Single Web Resource

Downloadable resources are configured to map a name of some downloadable file to its location within the plugin jar-file.

<web-resource key="autofavourite-resources" name="Auto-Favourite Resources">
    <resource type="download" name="autofavourite.css" location="autofavourite.css"/>
  • Resources must be contained within a webresource tag.
  • The key of the webresource is how it will be referenced from within the application
  • Each resource must be of type="download"
  • The name of the resource will be suffixed to the URL
  • The location of the resource is where it appears within the plugin itself

Referring to Web Resources

In your plugin's Velocity template, you need to refer to a WebResourceManager, and call the requireResource() method:


Because Fisheye/Crucible does not transparently support template engines like Velocity of Freemarker, you will need to register the WebResourceManager in the page context yourself, before passing control to your template engine of choice.

For instance, to use a web-resource in a velocity template, let Fisheye/Crucible inject both the VelocityHelper and the WebResourceManager into your servlet and then register the WebResourceManager in the velocity context before invoking the template engine:

public class MyServlet extends HttpServlet {

    private final WebResourceManager webResourceManager;
    private VelocityHelper velocityHelper;

    public MyServlet(WebResourceManager webResourceManager, VelocityHelper velocityHelper) {
        this.webResourceManager = webResourceManager;
        this.velocityHelper = velocityHelper;

    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {

        final Map<String, Object> context = new HashMap<String, Object>();
        context.put("webResourceManager", webResourceManager);

                context, response.getWriter());

You can then use the web-resource in the template /templates/myPageTemplate.vm

    <title>My Plugin</title>


To be able to use the WebResourceManager, make sure you include com.atlassian.plugins:atlassian-plugins-webresource to your project's dependencies:



Rate this page: