创建jira插件

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.

时间: 2024-08-04 04:00:24

创建jira插件的相关文章

jira插件破解

jira应用市场的插件破解步骤: 1.下载安装需要破解的插件 2.申请试用 3.下载解压破解文件压缩包https://drive.google.com/file/d/0B9BZ06InqZgJQUhVdVhkMEpFOTg/view?usp=sharing 4.在key模板内打开插件破解模板txt文件,此模板文件为jira插件模板文件 修改如下内容 com.intenso.jira.plugin.dynamic-forms.active=true 红色文字替换插件的Add-on key,如图一:

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

上一篇还是按照之前的教程流程,写了一篇WordPress插件制作教程概述,从这一篇开始就为大家具体讲解WordPress插件制作的内容.这一篇主要说一下插件的创建方法. 相信大家都知道插件的安装文件在什么地方吧,没错就在WP-Content->plugins里面,我们所安装的插件都存放在了这个文件夹里面.当我们刚开始搭建好WordPress网站的时候,里面会默认提供两个插件,一个是Akismet(过滤垃圾评论插件)和一个hello插件(显示歌词的插件).我们可以打开hello.php这个文件,这

创建jq插件步骤

无意看了这篇<jQuery插件开发精品教程,让你的jQuery提升一个台阶>文章,现在做一下总结. 一.jQuery插件的创建可以有三种方法 1.通过$.extend()来扩展jQuery 2.通过$.fn 向jQuery添加新的方法 3.通过$.widget()应用jQuery UI的部件工厂方式创建 方法1太简单,创建后通过$.myfunction()方式调用,不能对指定元素调用. 方法3相对于方法2太复杂. 方法2就是常用的创建jq插件的方法.可以对指定元素进行操作.例如$('#titl

使用Jmeter创建ActiveMQ JMS POINT TO POINT请求,环境搭建、请求创建、插件安装、监听服务器资源等

最近要做公司消息中间件的性能测试,第一个想到的工具就是Jmeter了,网上简单搜了一下,基本上都是WEB测试的居多,只好自己研究官方文档了. 其中涉及Jmeter基本的术语或者概念,请自行参考官方文档或者google,这里主要讲JMS PTP请求是如何建立的. 准备工作: 安装JDK,推荐使用1.7以上版本,并设置JAVA_HOME 下载Jmeter及相关插件:Jmeter下载地址点我,插件下载地址点我,ActiveMQ下载地址点我 Jmeter下载编译好的包解压就行了,为方便起见,解压目录我这

【转】JMeter学习(二十九)使用Jmeter创建ActiveMQ JMS POINT TO POINT请求,环境搭建、请求创建、插件安装、监听服务器资源等

最近要做公司消息中间件的性能测试,第一个想到的工具就是Jmeter了,网上简单搜了一下,基本上都是WEB测试的居多,只好自己研究官方文档了. 其中涉及Jmeter基本的术语或者概念,请自行参考官方文档或者google,这里主要讲JMS PTP请求是如何建立的. 准备工作: 安装JDK,推荐使用1.7以上版本,并设置JAVA_HOME 下载Jmeter及相关插件:Jmeter下载地址点我,插件下载地址点我,ActiveMQ下载地址点我 Jmeter下载编译好的包解压就行了,为方便起见,解压目录我这

maven配置_eclipse创建maven_maven插件配置

最近项目开发中需要使用maven.Maven这个东西是我2年前自学的.这2年之中基本没有使用过.现在项目需要,只有重新来一遍回锅肉.重新学习.经过一下午的斗争,一下午的各种问题各种解决,终于搭建好了,一路艰辛啊,这里要给大家说的是,我用的是eclipse3.7,Indigo.这个版本安装maven貌似会遇到其他版本安装mavan不会遇到的问题. 首先给大家说一下我用的工具及版本号: eclipse3.7,Indigo. Eclipse maven插件: Subclipse 1.6.x - htt

【python】jiraAPI使用教程 自动创建jira问题单并置状态为OPEN

环境依赖 : python库 redis jira  安装命令:pip install redis pip install jira redis服务安装命令: $sudo apt-get update $sudo apt-get install redis-server 启动 Redis $ redis-server 查看 redis 是否启动?                   $ redis-cli 以上命令将打开以下终端:                   redis 127.0.0.

Atlassian JIRA 插件开发之二 安装和创建项目

安装参考 https://developer.atlassian.com/server/framework/atlassian-sdk/install-the-atlassian-sdk-on-a-windows-system/ 说明 Windows 安装比较简单,安装完成后,命令行运行 atlas-version 验证是否安装成功 注意: 安装完成后,最好将Atlassian自带的Maven的本地仓库地址修改到本机的目录下,修改的文件在 Atlassian\atlassian-plugin-s

如何创建一个基本JQuery的插件

如何创建一个基本的插件 有时您希望在整个代码中提供一些功能.例如,也许你想要一个单一的方法,你可以调用一个jQuery选择,对选择执行一系列的操作.在这种情况下,您可能需要编写一个插件. 链接jQuery如何工作101:jQuery对象方法 在我们编写自己的插件之前,首先要了解一下jQuery如何工作.看看这段代码: 1 $( "a" ).css( "color", "red" ); 这是一些很基础的jQuery代码,但你知道幕后发生了什么吗?无