plugin.resource.directories system property does not work for scripts, only for classes loaded through PackageScanner

Description

*This issue has moved*

This issue has been moved permanently to Adaptavist's Product Support JIRA instance.

All existing users of this instance should have the same username on our Product Support instance. However, you will very likely need to click on the
Can't access your account link in order to reset to a new password.

I've added the Dplugin.resource.directories property to the java options in the service configuration to point to "C:\Program Files\Atlassian\Application Data\JIRA\scripts". Configuration screenshot attached.

I restarted the Jira service

The scripts folder exists and contains a file called "generic_getroleusers.groovy" as shown in the screenshot

Then using script runner I enter "generic_getroleusers.groovy" as the script file and I get a file not found error, as shown in the screenshot. Entering "\generic_getroleusers.groovy" doesn't work either.

Am I doing something wrong? The notes on the wiki about this feature don't go into much detail.

Environment

Windows 2008 R2 server, Jira 5.0.3

Activity

Show:
Jamie Echlin
May 15, 2012, 3:36 AM

Sorry, this only works for proper classes, like the built-in scripts. I should make this clear, but yes, this should work for scripts as well, I will change the summary and leave this open.

Your best option is to use a relative path, in your case it should be ../scripts/generic_getroleusers.groovy

DavidP
May 15, 2012, 3:53 PM

Thanks for clearing that up, but I'm still having some trouble getting it to work with classes.

I'm guessing that apart from the configuration above, if I put a file called "CustomClass.groovy" into JIRA\scripts\com\custom where the file contents are:

and then in Script Runner use "import com.custom.CustomClass" it should work?

I can't get it to work - I get an "unable to resolve class" error.

DavidP
May 23, 2012, 5:08 PM

Hi Jamie,

Any chance you could respond to the above comment? I still haven't figured out how to get it to work.

Jamie Echlin
May 24, 2012, 8:40 AM

It's not going to work like that at the moment. Your CustomClass needs to be in the right place on the regular classpath. You can add to the classpath using catalina.properties if you like.

DavidP
May 27, 2012, 3:09 PM

Ok no worries. Thanks Jamie.

Assignee

Jamie Echlin

Reporter

DavidP

Labels

None

Internal Complexity

Unknown

Internal Value

Unknown

Affects versions

Priority

Major
Configure