Hello,
we've come across a seemingly weird error. We have three JIRA instances of which are two on different servers and one is the local plugin environment instance. My plugin works properly in the latter, but when I upload its jar to the other instances and access the plugin it says the following:
ReferenceError: DevReport is not defined
The method I wrote is undefined. It seems like my JavaScript resource wasn't included.
The plugin works properly in my local plugin development environment which is JIRA 6.0.6. The two JIRA instances on the different servers are 5.2 and 6.0.6, but both of them return the above error.
My atlassian-plugin.xml
<atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins-version="2"> <plugin-info> <description>${project.description}</description> <version>${project.version}</version> <vendor name="${project.organization.name}" url="${project.organization.url}"/> <param name="plugin-icon">images/pluginIcon.png</param> <param name="plugin-logo">images/pluginLogo.png</param> </plugin-info> <!-- add our i18n resource --> <resource type="i18n" name="i18n" location="devreport"/> <!-- add our web resources --> <web-resource name="Resources" key="resources"> <dependency>com.atlassian.auiplugin:ajs</dependency> <resource name="devreport.css" type="download" location="css/devreport.css"/> <resource name="jquery-1.10.2.min.js" type="download" location="js/jquery-1.10.2.min.js"/> <resource name="oj.min.js" type="download" location="js/oj.min.js"/> <resource name="devreport.js" type="download" location="js/devreport.js"/> <context>jira.browse.project</context> </web-resource> <!-- The class defined should implement com.atlassian.jira.plugin.projectpanel.ProjectTabPanel and it may be useful to use the functionality provided by com.atlassian.jira.plugin.projectpanel.impl.GenericProjectTabPanel. --> <project-tabpanel key="devreport-panel" name="Dev Report Panel" class="com.btcag.DevReportProjectTabPanel"> <description key="projectpanels.devreport.description"> A Development Report. </description> <label key="projectpanels.devreport.label"/> <!-- this is a number defining the order of all panels. The system panels are 10, 20, 30 and 40. --> <order>20</order> <!-- this template produces the HTML for the panel --> <resource type="velocity" name="view" location="/project.vm"/> <!-- this properties files contains i18n keys for the panel --> <resource type="i18n" name="i18n" location="devreport"/> <!-- this parameter prevents the heading from appearing at the top of the tab panel area --> <param name="noTitle">true</param> </project-tabpanel> <!-- import from the product container --> <component-import key="applicationProperties" interface="com.atlassian.sal.api.ApplicationProperties"/> </atlassian-plugin>
I don't know if it's related to the error with my plugin, but what's also interesting is, that with another plugin I got from the marketplace it's right the other way round. The plugin "Gantt Chart" doesn't work locally, but it does work on the other two JIRA instances. In my local environment it returns this error which is similar to the errors I get with my plugin on the two server instances:
ReferenceError: App is not defined
Thanks in advance for any help!
Community moderators have prevented the ability to post new answers.
Go the "Sources" tab if Chrome Developer Tools and check if the js file is included. Also - what is your development OS and your server OS - check out if you have some naming problems i.e. if the js file is using both upper case and lower case letters and you've declared it using lower case in atlassian-plugin.xml it will work on Windows but probably not on Linux, so that's another thing to check.
I figured something out. As opposed to my local isntance, the other instances include my resources in batched mode. And my JavaScript resources are indeed included in a minified version and put into a batch.js file. First of all why and can I avoid that? Because that batched mode doesn't seem to work for me, because one of my JavaScript resources (a library) errors ansd stops further exercution. It doesn't error locally in non batched mode.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you want to skip compressing resources add the following under configuration of your maven-jira-plugin in your pom.xml
<compressResources>false</compressResources>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
your posted images are not visible to me?
you check the jira version in your pom.xml when uploading to 5.0.6 version instance.
you remove the target files and freshly build your plugin and check.
if any doubt, you can revert back.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.