When developing a plugin, sometimes one really needs to connect to an existing JIRA/Confluence – for instance, to test with real data. In the past that could be done with atlas-cli
thusly:
ATLAS_OPTS="-Dusername=jturner -Dpassword=$WIKIPASS" atlas-cli --server wiki.redradishtech.com -p 80 --context-path / --cli-port 4330
But nowadays atlas-cli
emits a scary warning:
[WARNING] >>> WARNING: atlas-cli and fastdev are DEPRECATED in favour of QuickReload <<< [WARNING] [WARNING] >>> WARNING: Support for atlas-cli and fastdev will be completely removed in the next AMPS version. <<<
This leads to my question: how does one get Quick Reload working in an existing instance? Brad's doc on QuickReload is fun but entirely unhelpful, as it assumes plugin development always takes place by running atlas-run
or atlas-debug
within the plugin root directory.
After a day's researching..
In your product, go to Manage add-ons, click 'All add-ons' and verify that the 'Confluence Quick Reload Plugin' (com.atlassian.confluence.plugins.quickreload) or 'JIRA Quick Reload Plugin' or equivalent is present. This plugin is pre-installed, product-specific, and not sufficient on its own.
Install the com.atlassian.labs.plugins.quickreload.reloader plugin manually:
First, find the correct version (the latest bleeding-edge didn't work for me). View the source for the latest AmpsDefaults.java, and note the QUICK_RELOAD version number:
public static final String DEFAULT_QUICK_RELOAD_VERSION = "1.24.1";
This tells you what quickreload version would be deployed by atlas-run
and friends.
Go to https://maven.atlassian.com/content/repositories/atlassian-public/com/atlassian/labs/plugins/quickreload/, click the right version ('1.24.1' in this example), and copy the jar URL.
Append /rest/qr/1.0/tracked
to your app URL, and verify you get JSON output starting with:
{"directories":[],"api":{"self":{"url":"https://www.redradishtech.com/rest/qr/1.0/tracked","method":"GET"},"api": ....
Tell the Quick Reload plugin to monitor a particular directory (note that "directories" in the JSON above is [] aka. empty). As per the docs, this can be done via quickreload.properties
file, or -Dquickreload.tracked=...
properties in your bin/setenv.sh
, but I find it easiest to do via a POST call to $BASEURL/rest/qr/1.0/tracked/$DIRECTORY. For instance:
curl -H 'X-Atlassian-Token: nocheck' -X POST 'http://wiki.redradishtech.com/rest/qr/1.0/tracked/home/jturner/src/bitbucket.org/redradishtech/testplugin/target'
To remove a path, change -X POST
to -X DELETE
.
By examining /rest/qr/1.0/api
, you'll note the plugin allows unauthenticated installing, enabling and disabling of plugins, so should only be installed in a trusted development environment.
Also, IMO atlas-cli
is fundamentally a different beast to Quick Reload, and should not be deprecated. I've filed this at https://ecosystem.atlassian.net/browse/AMPS-1350
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am under the impression that JAVA 8 has irreversibly broken fast dev and the other old tools. Attempts to fix them weren't promising so Quick Reload was developed to replace them.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jeff! Thanks you for this! I haven't switched to QuickReload up to now because I've always preferred to install my plugins on standalone systems. I have different CLI configurations configured as aliases for different servers. Can you tell me what the current status of your approach is? Is this answer still up-to-date? Felix
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jeff,
I've followed all the steps up to step 3 where I need to tell quickreload which directory to monitor. I was wondering where to put the quickreload.properties file? Is there anyway to hook quickreload up to an existing Jira instance without having to shut Jira down?
Thanks!
(If anybody else has a solution, the input would be greatly appreciated)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much
This is the only way to have quickreload working on a Windows system. On Linux there are no problems: it's enough to specify the -Dquickreload.tracked option but on Windows till now I wasn't able to have it working.
With the -Dquickreload.tracked option, the tracked directory is shown in the output of /rest/qr/1.0/tracked
but the path is modified and maybe it's the reason because it's not working.
I write -Dquickreload.tracked=D:\\my_devel_path\\my_plugin\\target
and in reply to the /rest/qr/1.0/tracked
I see \\\\my_devel_path\\my_plugin\\target
while, setting the path with the curl command, it appears unmodified, with the leading D:\\ drive notation, exactly as i sent it into the command i.e. /rest/qr/1.0/tracked/D:\\my_devel_path\\my_plugin\\target
Maybe should I write them differently after the -Dquickreload.tracked
option ?
I'm using quickreload 1.24.1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have a problem with resources loading on simple page refresh.
I have a standalone JIRA running and as @Jeff Turner suggests, I added target folder of my plugin to tracked folders using curl -H
'X-Atlassian-Token: nocheck'
-X POST
'http://localhost:2990/jira/rest/qr/1.0/tracked//home/martin/jira-project/target'.
It works fine, when I package the project using 'mvn package', new version of plugin is succesfully installed and can be used immediatelly. But how should I do it to use my CSS and JS resources from project's resources folder instead of using resources bundled to JAR file? Is it possible? Do you have any idea how to do it?
I already tried to do:
curl -H
'X-Atlassian-Token: nocheck'
-X POST
'http://localhost:2990/jira/rest/qr/1.0/tracked//home/martin/jira-project/src/main/resources/js'
but it didn't help
Thank you very much for any advice...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have the same question.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We have a separate community for questions related to developing for Atlassian products. I would recommend re-raising your question there:
Thank you!
Regards,
Shannon
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.