Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
JIRA Development Cookbook

You're reading from   JIRA Development Cookbook Third Edition

Arrow left icon
Product type Paperback
Published in Sep 2016
Publisher
ISBN-13 9781785885617
Length 598 pages
Edition 3rd Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (12) Chapters Close

Preface 1. Plugin Development Process FREE CHAPTER 2. Understanding the Plugin Framework 3. Working with Custom Fields 4. Programming Workflows 5. Gadgets and Reporting in JIRA 6. The Power of JIRA Searching 7. Programming Issues 8. Customizing the UI 9. Remote Access to JIRA 10. Dealing with the JIRA Database 11. Useful Recipes

Using FastDev for plugin development

We have seen how to use atlas-cli to reload a plugin without having to restart atlas-run. It is a pretty good way to save time, but Atlassian have walked the extra mile to develop a plugin named FastDev, which can be used to reload plugin changes, during development, to all Atlassian applications, including JIRA. And that from the browser itself!

Getting ready

Create a plugin and use atlas-run to run the plugin as in the aforementioned recipe. Let us assume we are doing it on the plugin we created in the previous recipe, the one with the sample web-item.

Make sure FastDev is enabled in the maven-jira-plugin configuration in the pom.xml, as shown here:

<plugin> 
    <groupId>com.atlassian.maven.plugins</groupId> 
    <artifactId>maven-jira-plugin</artifactId> 
    <version>${amps.version}</version> 
    <extensions>true</extensions> 
    <configuration> 
        <productVersion>${jira.version}</productVersion> 
        <productDataVersion>${jira.version}</productDataVersion> 
        <enableQuickReload>true</enableQuickReload> 
        <enableFastdev>true</enableFastdev> 
    </configuration> 
</plugin> 

Note

Enabling FastDev is an important step, as it might be disabled by default, depending on the version of Atlassian SDK.

If we run that sample web-item plugin, using atlas-run, we can access JIRA at port 2990 as mentioned before and the web-item will look as highlighted here:

Getting ready

As you can see, the My Web Item link appears along with Profile link, under the Personal section. What if you wanted the link at the jira-help section, along with Online Help, About JIRA, and so on?

How to do it...

The following are the simple steps to make the change to the plugin and reload it using FastDev:

  1. Access the FastDev servlet on the browser in the following path: http://localhost:2990/jira/plugins/servlet/fastdev. You will find the servlet as shown here:
    How to do it...
  2. Make the necessary changes to your plugin. In this example, the change is pretty small. All we do is modify the atlassian-plugin.xml to change the section in the web-item module from section="system.user.options/personal" to section="system.user.options/jira-help".
  3. Click on the Scan and Reload button on the servlet (see the preceding image). On clicking the button, FastDev will reload the plugin. You can track the progress and see the logs on the browser itself, as shown here:
    How to do it...
  4. Once the plugin is successfully reloaded, you will see the following screen with a success message:
    How to do it...
  5. Reload the JIRA page to see if the change is effective. In our example, the new menu item moved under the Help section, as shown here:
    How to do it...

Using FastDev is very effective while building a plugin from scratch and testing it, as the pieces gradually fall in to the right places.

How it works...

When the Scan and Reload button is pressed, FastDev looks for files that have changed since the last time plugin was installed. If it detects any changes, it starts a Maven process that re-installs the plugin.

More information on FastDev can be found at https://developer.atlassian.com/docs/developer-tools/automatic-plugin-reinstallation-with-fastdev.

There's more...

There is more to FastDev than the default configurations. They can be set in your plugin's pom.xml file by adding the required property to the systemPropertyVariables node, which in turn goes under the plugin configuration node.

You will find the details in the preceding Atlassian documentation, but the most useful ones are mentioned in the following section.

Adding ignored files

While looking for changes, it ignores certain files like .js or .css files that don't need a re-install of the plugin. Following is the full list of files/directories that are ignored:

Type

Property name

Default(s)

Directory

fastdev.no.reload.directories

.svn

Extension

fastdev.no.reload.extensions

.js, .vm, .vmd, .fm, .ftl, .html, .png, .jpeg, .gif, .css

File

fastdev.no.reload.files

If you want to ignore additional files or directories, you can add them using the preceding properties, as shown here:

<systemPropertyVariables> 
    ... 
    <fastdev.no.reload.directories>images</fastdev.no.reload.directories> 
    <fastdev.no.reload.extensions>classpath</fastdev.no.reload.extensions>
    <fastdev.no.reload.files>${basedir}/src/main/resources/LCIENSE.txt</fastdev.no.reload.files> 
</systemPropertyVariables> 

Changing admin credentials

FastDev uses the default admin/admin credential to reinstall the plugin. But if the username or password is different, use the fastdev.install.username and fastdev.install.password property, as shown here:

<systemPropertyVariables> 
    ... 
    <fastdev.install.username>myusername</fastdev.install.username> 
    <fastdev.install.password>mypassword</fastdev.install.password> 
</systemPropertyVariables> 

See also

  • Setting up the development environment
  • Creating a skeleton plugin
  • Making changes and redeploying a plugin
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
JIRA Development Cookbook
You have been reading a chapter from
JIRA Development Cookbook - Third Edition
Published in: Sep 2016
Publisher:
ISBN-13: 9781785885617
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Modal Close icon
Modal Close icon