Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
JIRA 5.x Development Cookbook

You're reading from   JIRA 5.x Development Cookbook This book is your one-stop resource for mastering JIRA extensions and customizations

Arrow left icon
Product type Paperback
Published in Apr 2013
Publisher Packt
ISBN-13 9781782169086
Length 512 pages
Edition 1st Edition
Tools
Arrow right icon
Toc

Table of Contents (19) Chapters Close

JIRA 5.x Development Cookbook
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
1. Plugin Development Process 2. Understanding the Plugin Framework FREE CHAPTER 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 Index

Adding plugin modules


In this recipe, we will look at adding plugin modules into an existing plugin project.

Getting ready

Make sure the plugin project already exists, or create a new skeleton project as explained in the previous recipe.

How to do it…

Following are the steps to add plugin modules into an existing plugin project:

  1. Open a command window and go to the plugin project folder where pom.xml resides.

  2. Type atlas-create-jira-plugin-module and press Enter. This will show all the available plugin modules as a numbered list, as shown in the following screenshot:

  3. Select the number against the module that you are planning to add. For example, type 25 and press Enter if you want to add a simple Web Item module to the plugin.

  4. Follow the instructions to provide details required for the selected module. Some of the options may have default values.

    Note

    Some modules might also have an advanced setup. Type Y and press Enter when prompted if you want to go to Advanced Setup. If not, type N and press Enter.

  5. Once the module is completed, type Y or N and press Enter when prompted, depending on whether you want to add another module or not.

  6. Repeat the steps for every module you want to add.

  7. Wait for the BUILD SUCCESSFUL message to appear when no more modules are there to be added.

How it works…

Similar to the skeleton plugin creation, a set of directories and subdirectories are created during the process of adding plugin modules, along with a number of Java files or Velocity templates required for the selected plugin module.

It also adds the plugin module definition in the atlassian-plugin.xml file based on our inputs in step 4. A sample plugin descriptor, after adding the Web Item module, is shown as follows:

<?xml version="1.0" encoding="UTF-8"?>
<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}"/>
  </plugin-info>
  <resource type="i18n" name="i18n" location="com.jtricks.demo.demoplugin"/>
  <web-item name="My Web Item" i18n-name-key="my-web-item.name" key="my-web-item" section="system.user.options/personal" weight="1000">
    <description key="my-web-item.description">The My Web Item Plugin</description>
    <label key="my-web-item.label"></label>
    <link linkId="my-web-item-link">http://www.j-tricks.com</link>
  </web-item>
</atlassian-plugin>

As you can see, a web-item module is added. You can also see a resource module, which is added automatically the first time a plugin module is created. This will be the i18n resource file for the plugin, and more key-value pairs will be added into this file when more modules are added. The file has the name {plugin-artifact-name}.properties and is created under the src/main/resources{plugin-group-folder} folder. In our example, a demo.properties file is created under the src/main/resources/com/jtricks/demo folder.

A sample property file is shown as follows:

my-web-item.label=J-Tricks
my-web-item.name=My Web Item
my-web-item.description=The My Web Item Plugin

See also

  • The Creating a skeleton plugin recipe

  • The Deploying a JIRA plugin recipe

  • The Making changes to and redeploying a plugin recipe

lock icon The rest of the chapter is locked
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
Banner background image