# Cannot include web-resources in my jira-plugin

**URL:** <https://community.developer.atlassian.com/t/cannot-include-web-resources-in-my-jira-plugin/26197>\
**Category:** Everything Else\
**Tags:** plugin-sdk, webresource, jira-plugin\
**Created:** [January 8, 2019, 2:51pm UTC](https://community.developer.atlassian.com/t/cannot-include-web-resources-in-my-jira-plugin/26197 "2019-01-08T14:51:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fabio.gimmillaro](https://avatars.discourse-cdn.com/v4/letter/f/e19adc/32.png) [@fabio.gimmillaro](https://community.developer.atlassian.com/u/fabio.gimmillaro)\
**Post date:** [January 8, 2019, 2:51pm UTC](https://community.developer.atlassian.com/t/cannot-include-web-resources-in-my-jira-plugin/26197/1 "2019-01-08T14:51:13Z")

</div>

Hello guys,

I try to include a web-resource in my velocity template to style an input field. Unfortunately nothing happens. These are the methods I tried so far:

$webResourceManager.requireResource(“de.company.jira.test:my-resource”)  
This one does literally nothing

$webResourceManager.requireResourcesForContext(“de.company.jira.test”)  
Same. Nothing happens

#requireResource(de.company.jira.test:my-resource)  
This macro cannot be recognized and will be printed as a string in the html code

When I try to add a general context (atl.general or jira.general) to my web-resource everything breaks. A long javascript code will be printed on my jira site and the styling is completely broken.  
I also recreated the plugin to reproduce this issue and it happens everytime…

Here’s my web-resource:  
\</web-resource\>  
 \<web-resource name=“MyResource” i18n-name-key=“my-resource.name” key=“my-resource”\>  
 \<description key=“my-resource.description”\>The MyResource Plugin\</description\>  
 \<resource namePattern=“MyRes” type=“download” location="/css/test.css"/\>  
 \<context\>de.company.jira.test\</context\>  
\</web-resource\>

Thank you in advance for your answer.

---

<div class="post-metadata">

**Author:** ![Taylan](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@Taylan](https://community.developer.atlassian.com/u/Taylan)\
**Post date:** [September 11, 2020, 8:56am UTC](https://community.developer.atlassian.com/t/cannot-include-web-resources-in-my-jira-plugin/26197/2 "2020-09-11T08:56:58Z")

</div>

I don’t know if you still need this but this is what I use:

```auto
<web-resource key="my-resources" name="My Web Resources">
        <dependency>com.atlassian.auiplugin:ajs</dependency>
        <resource type="download" name="my.js" location="/js/my.js"/>
        <resource type="download" name="my.css" location="/css/my.css"/>
        <resource type="download" name="images/" location="/images"/>
        <context>mycontext</context>
    </web-resource>

```

in junction with this line on my template:

```auto
    $webResourceManager.requireResourcesForContext("mycontext")

```

I don’t know what namePattern exactly does, but I am using name to define the resource file with “.css” at the end of it where you just have this:

> [@fabio.gimmillaro](#):
>
> […] namePattern=“MyRes” […]
