准备环境、安装SDK

https://developer.atlassian.com/docs/getting-started/set-up-the-atlassian-plugin-sdk-and-build-a-project/install-the-atlassian-sdk-on-a-linux-or-mac-system

编写插件

https://developer.atlassian.com/docs/getting-started/set-up-the-atlassian-plugin-sdk-and-build-a-project/create-a-helloworld-plugin-project

Create a HelloWorld Plugin Project

At this point, you have set up your environment and run a test with a standalone version of JIRA. In this section, you learn how to create a plugin module. For now, you are just going to use the command line tools. Later, you'll learn how to run the tools from an IDE. This page contains the following sections:

 

Step 1: Create your first project

If you haven't already done so, go ahead and open a terminal window and then do the following:

  1. Change directory to the atlastutorial folder you created earlier at the root of your home directory.
  2. Once you are in the folder, enter the atlas-create-jira-plugin command to create the plugin.

     
     
     
     
     
    1
    atlas-create-jira-plugin
     
     

    The command prompts you for the JIRA version.

  3. Enter 1 for JIRA 5 and press RETURN.
    The command prompts you for the basic information each plugin needs.
  4. Respond to the prompts using the information in the following table:

    Define value for groupId

    com.atlassian.tutorial

    Define value for artifactId

    helloworld

    Define value for version

    1.0-SNAPSHOT

    Define value for package

    com.atlassian.tutorial.helloworld

    The system prompts you to confirm the configuration you entered:

     
     
     
     
     
    1
    Confirm properties configuration:
    2
    groupId: com.atlassian.tutorial
    3
    artifactId: helloworld
    4
    version: 1.0-SNAPSHOT
    5
    package: com.atlassian.tutorial.helloworld
     
     
  5. Press y to continue.
    The system creates a helloworld project folder. This initial project folder contains the basic skeleton of a plugin.

Step 2: Examine the contents of the plugin skeleton

With a single command, you have a skeleton plugin project containing the following source:

Contents

Description

LICENSE

A placeholder for a license file.

README

Simple hints for running the atlas- commands.

pom.xml

Maven configuration file for your project.

src

The generated source for the plugin.

Take a closer look at the code created for you in the src directory. The src/test/java contains a generated class and some placeholders for testing your plugin. You'll learn more about this later. The src/main folder contains an initial/com/atlassian/tutorial/helloworld/MyPluginComponent.java file and a/com/atlassian/tutorial/helloworld/MyPluginComponentImpl.java.   The src/main/resources folder contains a singleatlassian-plugin.xml file — this file is the descriptor. It defines the plugin modules your plugin uses.

At this point, your descriptor file should not define any modules. Let's test this, by looking in the descriptor file:

  1. Open your favorite text editor.
  2. Browse to and open the atlastutorial/helloworld/src/main/resources/atlassian-plugin.xml file.
    At this point the contents of the file should look like this:

     
     
     
     
     
    1
    <atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins-version="2">
    2
        <plugin-info>
    3
            <description>${project.description}</description>
    4
            <version>${project.version}</version>
    5
            <vendor name="${project.organization.name}" url="${project.organization.url}" />
    6
            <param name="plugin-icon">images/pluginIcon.png</param>
    7
            <param name="plugin-logo">images/pluginLogo.png</param>
    8
        </plugin-info>
    9
        <!-- add our i18n resource -->
    10
        <resource type="i18n" name="i18n" location="helloworld"/>
    11
        
    12
        <!-- add our web resources -->
    13
        <web-resource key="helloworld-resources" name="helloworld Web Resources">
    14
            <dependency>com.atlassian.auiplugin:ajs</dependency>
    15
            
    16
            <resource type="download" name="helloworld.css" location="/css/helloworld.css"/>
    17
            <resource type="download" name="helloworld.js" location="/js/helloworld.js"/>
    18
            <resource type="download" name="images/" location="/images"/>
    19
            <context>helloworld</context>
    20
        </web-resource>
    21
        
    22
        <!-- publish our component -->
    23
        <component key="myPluginComponent" class="com.atlassian.tutorial.helloworld.MyPluginComponentImpl" public="true">
    24
            <interface>com.atlassian.tutorial.helloworld.MyPluginComponent</interface>
    25
        </component>
    26
        
    27
        <!-- import from the product container -->
    28
        <component-import key="applicationProperties" interface="com.atlassian.sal.api.ApplicationProperties" />
    29
        
    30
    </atlassian-plugin>
     
     

    Several of the entries in the <plugin-info> should look familiar. If you recall, the atlas-create-jira-plugin command asked you for agroupId and an artifactId. These values landed in another file all together.

    Your plugin includes resources that allow you to control look and feel. These appear under the web resources section. You'll learn more about these in another tutorial. For now, focus on the relatively simple <plugin-info> section.

  3. Close the atlassian-plugin.xml file.
  4. Open the atlastutorial/helloworld/pom.xml.
    This file is a Maven project object model file. This file contains project and dependency information that Maven uses to build your plugin. This tutorial isn't going into the finer points of Maven or its files.
  5. Search for the artifactId value.
    You should find the artifactId you entered when you created the skeleton. The project.artifactId you saw in the atlassian-plugin.xml file references this value.
  6. Familiarize yourself with the file a bit by looking for other values you entered through the command such as the groupId and version.
  7. Close the file when you are done.

Step 3: Load the helloworld plugin into JIRA

Even though you haven't written any code, you can still load the skeleton plugin into JIRA. When you load a plugin into JIRA, it is visible in the Universal Plugin Manager (UPM). The UPM is in every Atlassian application. It allows you to install, view, and update plugins in your host application. The host application in this case is JIRA. You load a plugin using the atlas-run command. Try this command and see what happens:

  1. Open a command line (DOS prompt for Windows users).
  2. Change directory to the root of your plugin project.

     
     
     
     
     
    1
    cd atlastutorial/helloworld
     
     
  3. Enter the atlas-run command.
    The command creates a target sub directory under your project root. You will examine this directory a bit more later. When the command completes successfully, you'll see some output that looks very similar to the output of the atlas-run-standalone command.

     
     
     
     
     
    1
    [WARNING] [talledLocalContainer] INFO: Deploying web application archive cargocpc.war
    2
    [WARNING] [talledLocalContainer] May 9, 2012 8:15:56 AM org.apache.coyote.http11.Http11Protocol star
    3
    t
    4
    [WARNING] [talledLocalContainer] INFO: Starting Coyote HTTP/1.1 on http-2990
    5
    [WARNING] [talledLocalContainer] May 9, 2012 8:15:56 AM org.apache.jk.common.ChannelSocket init
    6
    [WARNING] [talledLocalContainer] INFO: JK: ajp13 listening on /0.0.0.0:8009
    7
    [WARNING] [talledLocalContainer] May 9, 2012 8:15:56 AM org.apache.jk.server.JkMain start
    8
    [WARNING] [talledLocalContainer] INFO: Jk running ID=0 time=0/130  config=null
    9
    [WARNING] [talledLocalContainer] May 9, 2012 8:15:56 AM org.apache.catalina.startup.Catalina start
    10
    [WARNING] [talledLocalContainer] INFO: Server startup in 100008 ms
    11
    [INFO] [talledLocalContainer] 2012-05-09 08:15:59,176 QuartzWorker-0 INFO ServiceRunner    Backup Se
    12
    rvice [jira.bc.dataimport.DefaultExportService] Data export completed in 781ms. Wrote 622 entities t
    13
    o export in memory.
    14
    [INFO] [talledLocalContainer] 2012-05-09 08:15:59,186 QuartzWorker-0 INFO ServiceRunner    Backup Se
    15
    rvice [jira.bc.dataimport.DefaultExportService] Attempting to save the Active Objects Backup
    16
    [INFO] [talledLocalContainer] 2012-05-09 08:15:59,487 QuartzWorker-0 INFO ServiceRunner    Backup Se
    17
    rvice [jira.bc.dataimport.DefaultExportService] Finished saving the Active Objects Backup
    18
    [INFO] [talledLocalContainer] Tomcat 6.x started on port [2990]
    19
    [INFO] jira started successfully in 161s at http://manthony-PC:2990/jira
    20
    [INFO] Type Ctrl-D to shutdown gracefully
    21
    [INFO] Type Ctrl-C to exit
     
     
  4. Open your browser and log into the JIRA instance.
    (Remember, the username and password are both admin.)
  5. Select the  cog (Administration) icon in the right corner.
  6. Choose Add-ons from the menu.
    The system places you on the Administration page.
  7. Choose Manage Add-ons from the left-hand menu.
    The system opens the Manage Add-ons page.
  8. Locate the helloworld plugin listings in User-installed Add-ons category.
    You'll find two listings for your plugin. One for the plugin itself and one for the plugin tests.
  9. Expand each entry by click it.
    You should see the following for the plugin alone:

    The plugin has just the basic modules that you get for "free" when you create a plugin.  These modules don't do much yet.
  10. Close the JIRA browser window.
  11. Return to the terminal window where you started atlas-run and shutdown the process with CTRL-D.

Step 4: Make a change and see it reflected in the application

In this step, you'll make a small change in your plugin's pom.xml file. Then, you'll rebuild your plugin with the atlas-run command.

  1. Open the pom.xml file in your favorite editor.
  2. Locate the <organization>element.

  3. Update the element to look like the following:

     
     
     
     
     
    1
    <organization>
    2
        <name>HelloGoodby Inc.</name>
    3
        <url>http://www.helloworldgoodbye.com/</url>
    4
    </organization>
     
     
  4. Save and close the file.
  5. Run the atlas-run command in the terminal window.
  6. Open the plugins page in your browser using the following path http://localhost:2990/jira/plugins/servlet/upm#manage.
    JIRA still prompts you for the username/password.
  7. Expand the helloworld plugin to see your changes.

The Next Steps

So far, you've used the SDK from a command line. However, most programmers working in complex code prefer the help of an integrated development environment (IDE). One of the most popular IDE is Eclipse. In the next section, you install and configure the Eclipse IDE on Windows orfor Linux/Mac. If you are using IntelliJ, please see this page.

创建jira插件的更多相关文章

  1. 【转】Jira插件安装

    一.Jira插件列表(可以将下面免费插件直接下载,然后登陆jira,在"插件管理"->"上传插件",将下载后的免费插件直接进行上传安装即可) 序号 插件名 ...

  2. jira 插件介绍地址

    1. 官方的 介绍地址 http://confluence.gjingao.com/pages/viewpage.action?pageId=328170 序号 插件名称 功能概要 供应商 资源 10 ...

  3. 使用Autodesk Vault插件向导轻松创建Vault插件

    Vault SDK帮助文档中已经详细描述了怎么创建Vault插件,不过还是太麻烦了,首先要添加必要的引用,修改程序集属性,添加vcet.config文件,实现必要的接口,最后还要手动把生成的文件拷贝到 ...

  4. jira插件带ui界面和几种方式

    http://localhost:2990/jira/plugins/servlet/issuecrud jira插件带ui界面和几种方式 https://developer.atlassian.co ...

  5. jQuery 如何创建基本插件(翻译)

    有时候,你希望有一块功能在整个代码当中都可以使用.例如,你可能想要有一个单一的方法可以在jQuery选择器上进行调用,用于处理该选择器上的一系列操作.又或许你编写了一个十分有用的工具函数,并希望能够简 ...

  6. WordPress插件制作教程(一): 如何创建一个插件

    上一篇还是按照之前的教程流程,写了一篇WordPress插件制作教程概述,从这一篇开始就为大家具体讲解WordPress插件制作的内容.这一篇主要说一下插件的创建方法. 相信大家都知道插件的安装文件在 ...

  7. Docker 创建 Jira Core(Jira SoftWare) 7.12.3 中文版

    目录 目录 1.介绍 1.1.什么是 JIRA Core? 1.2.什么是 JIRA SoftWare 2.JIRA 的官网在哪里? 3.如何下载安装? 4.对 JIRA 进行配置 4.1.JIRA ...

  8. Docker创建JIRA 7.2.4中文破解版

    目录 目录 1.介绍 1.1.什么是JIRA? 2.JIRA的官网在哪里? 3.如何下载安装? 4.对JIRA进行配置 4.1.打开浏览器:http://localhost:20012 4.2.JIR ...

  9. ArcGIS Desktop python Add-in 创建一个插件

    1)创建一个项目 首先创建一个插件项目,本节介绍如何利用向导创建一个插件项目. 创建任何一个ArcGIS插件产品的过程都是一样的. 创建一个Python插件项目包括2个步骤: a) 选择一个插件项目文 ...

随机推荐

  1. ASP.NET MVC4 学习系统三(控制器Controller)

    控制器(Controllers)    在MVC架构模式的上下文里,控制器响应用户的输入(比如,用户点击“保存”按钮),并协调模型.视图以及(经常)数据访问层.在ASP.NET MVC程序里,控制器就 ...

  2. WPF学习系列之七 (样式与行为)

    样式(Styles)是组织和重用格式化选项的重要工具.不是使用重复的标记填充XAML,以设置诸如边距.颜色及字体等细节,而可以创建一系列封装所有这些细节的样式.然后可以在需要之处通过一个属性应用样式. ...

  3. C++断言与静态断言

    断言是很早之前就有的东西了,只需要引入cassert头文件即可使用.往往assert被用于检查不可能发生的行为,来确保开发者在调试阶段尽早发现“不可能”事件真的发生了,如果真的发生了,那么就表示代码的 ...

  4. SVN更新、清理乱码解决

    我的电脑信息 win7 64bit svn版本: 先介绍一种最简单的方法,一般都会有效,疑难杂症请用第二种 方法一: 将前面6项全部选上--> [确定] 无效请仔细看下面方法二方法详解 方法二: ...

  5. Android IOS WebRTC 音视频开发总结(六三)-- 2016国内IM云服务行业分析

    本文主要国内IM云服务行业分析,文章最早发表在我们的微信公众号上,详见这里,欢迎关注微信公众号blackerteam,更多详见www.blackerteam.com 谈到IM我们最先想到的是qq和微信 ...

  6. Android IOS WebRTC 音视频开发总结(十九)-- kurento

    折腾了一个多星期终于将kurento的环境搭建好(开发阶段的产品,有些BUG要自己解决),所以单独写篇文件来介绍. 下面开始介绍kurento,文章来自博客园RTC.Blacker,转载请说明出处. ...

  7. THINKPHP 清除HTML注释、换行符、空格、制表符等

    thinkphp3.2 3.2中取消了配置文件中的 'TMPL_STRIP_SPACE' 属性,所以我们先来修改:\ThinkPHP\Library\Think\Template.class.php ...

  8. 必须会的SQL语句(六)查询

    1.基础的查询     1)重命名列     select name as '姓名' from 表名       2)定义常量列     select 是否 ='是' from 表名       3) ...

  9. 软件工程 speedsnail 冲刺5

    2015-5-9 完成任务:学习了黑马android教学视频10\11\12集,填写游戏人的姓名功能为明天的记分板准备: 遇到问题: 问题1 Suspicious method call; shoul ...

  10. JSON,JSONP

    http://blog.csdn.net/huaishuming/article/details/40046729 说明: 在做2个系统间传值时出现: 已阻止交叉源请求:同源策略不允许读取 http: ...