Unable to load image in plugin VM file.

I am writing a plugin . In that plugin i have a image folder src/main/resources/images

I have defined web resource

<web-resource key="calendar-resources" name="calendar Web Resources">
    <resource type="download" name="images/" location="images/"/>

In my velocity file i m referring an image

<img src="images/blank.gif" width="16" height="16" />

Image is not loading.


1 answer

0 votes

Use this in the velocity template.


Change the plugin key as appropriate ;)

Hi Jobin,

Above solution work perfect for JIRA Plugin but I am trying same thing on Confluence Plugin, it shows broken image.

atlassian-plugin.xml - 

<web-resource key="MSSsoConfluencePlugin-resources" name="MSSsoConfluencePlugin Web Resources">
<resource type="download" name="ConfluenceSSOAdminConfiguration.css" location="/css/ConfluenceSSOAdminConfiguration.css"/>
<resource type="download" name="ConfluenceSSOAdminConfiguration.js" location="/js/ConfluenceSSOAdminConfiguration.js"/>
<resource type="download" name="images/" location="images/"/>


on .vm file - 

<img src="$urlPrefix${req.serverName}:${req.serverPort}/download/resources/com.microsoft.MSSsoConfluencePlugin:MSSsoConfluencePlugin-resources/images/copyIcon.png" alt="CopyIcon"/>

plugin key - com.microsoft.MSSsoConfluencePlugin

Only missing thing I can see is 

What shoul be dependancy for Confluence plugin ? Can you please help me on this ? Really appreciate your quick help.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,156 views 13 19
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot