- 이문서는 Atlassian SDK를 사용하여 Jira 플러그인 개발에 필요한 가이드라인을 제공합니다.
...
1.1. Architecture overview
Jira Server 용 플러그인을 구축하려면 Atlassian SDK를 통해 Atlassian 개발 플랫폼을 사용하게됩니다.
These are the major components in the Atlassian Plugin Development Platform:
- Shared Access Layer (SAL). The API for accessing common services, regardless of the underlying Atlassian application interfaces. More...
- Atlassian User Interface (AUI). A set of reusable, cross-browser tested JavaScript and CSS UI components. More...
- Atlassian Template Renderer (ATR). API for rendering your textual content. More...
- Atlassian Event. A library that allows plugins to send and consume internal messages. See the Javadoc.
- Activity Streams. API for sending and consuming activity streams. More...
- Gadgets. Framework for developing OpenSocial gadgets. More...
- Universal Plugin Manager (UPM). The tool for installing, managing, upgrading, and diagnosing Atlassian plugins. More...
- Atlassian REST Plugin Module. An Atlassian plugin module that you can use to create plugin points easily in Atlassian applications, by exposing services and data entities as REST APIs. More...
- Trusted Apps. Protocol for authenticating Atlassian applications.
- Application Links (AppLinks). API for interacting with AppLinks, an Atlassian plugin module that allows you to connect to external applications. More...
- OAuth. Our OAuth implementation for accepting and sending authenticated requests.
- Plugin Framework. The framework that executes the plugins and manages the available plugin modules. More...
- Active Objects. For plugin data storage. An ORM layer that enables easier, faster and more scalable data access and storage than our old Bandana and PluginSettings APIs. More...
- Speakeasy. A new, experimental extension mechanism for Atlassian's products. Useful for easy plugin prototyping. More...
- JIRA Issue Collector. Library for collecting user feedback from any page.
1.2. 시작하기 전에
- 환경 구성
- JDK (Java SE Development Kit) 8 또는 AdoptOpenJDK 8 설치합니다.
Download : Oracle JDK 8 Downloads
- 2990 포트 제거 (지라서버가 사용하는 포트는 2990 포트 입니다.)
...
Step 1. Atlassian SDK를 사용하여 플러그인 스켈레톤 구축
- 플러그인을 작성하려는 시스템의 디렉토리로 이동 합니다.
- 우리가 실행할 명령은 플러그인 디렉토리가 들어있는 폴더를 만듭니다.
- 명령 프롬프트 창에서 atlas-create-jira-plugin 명령을 사용하여 애드온 프로젝트 작성
...
Intellij IDEA에서 디버깅 호출 방법
- 터미널에서 아래 명령어 실행한다.
atlas-debug --jvmargs "-Xmx2048m -Datlassian.mail.senddisabled=false" - config 설정하기
- Run -Edit Configration 클릭한다
- Remote 선택한다
- port 5005 기본포트
- command line
- -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
- Use module classpath - 프로젝트 모듈 추가
- apply 적용 완료
- 프로젝트를 종료하고 다시 start 한다
- 디버깅 모드에서 추가하 프로젝트를 실행한다.
...
2.2.Active Objects plugin module(ORM) 객체-관계 매핑
- 자바 어플리케이션에서 관계형 데이터베이스를 사용하는 방식을 정의한 인터페이스이다.(JPA)
com.myapp.MyEntity 키를 가진 플러그인에 속하는 클래스 이름이 MyEntity 인 엔티티의 예를 보자.
...
2.3.atlassian-plugin.xml 구조
코드 블럭 터미널에서 atlas-create-jira-plugin-module
코드 블럭 bash bash <atlassian-plugin name="Hello World" key="example.plugin.helloworld<?xml version="1.0" encoding="UTF-8"?> <atlassian-plugin key="${atlassian.plugin.key}" name="${project.name}" plugins-version="2"> <plugin-info> <description>A basic Active Objects module test</description> <description>${project.description}</description> <version>${project.version}</version> <vendor name="Atlassian Software Systems${project.organization.name}" url="http://www.atlassian.com${project.organization.url}"/> <version>1.0</version> <param name="plugin-icon">images/pluginIcon.png</param> <param name="plugin-logo">images/pluginLogo.png</param> </plugin-info> <!-- <param name="plugin-banner">images/pluginLogo.jpg</param> add our i18n resource --> <resource <paramtype="i18n" name="vendor-icon">images/logo_osci_primary_eng.png</param> <param name="vendor-logo">images/logo_osci_primary_eng.png</param> i18n" location="sample"/> <!-- add our web resources --> <web-resource key="sample-resources" name="sample Web Resources"> <param name="post.install.url">/plugins/servlet/sec/license</param> </plugin-info><dependency>com.atlassian.auiplugin:ajs</dependency> <resource type="i18ndownload" name="i18nsample.css" location="/css/sample.css" /> <!-- add our web resources --> <web-resource key="sample-resources" name="sample Web Resources"<resource type="download" name="sample.js" location="/js/sample.js"/> <dependency>com.atlassian.auiplugin:ajs</dependency> <dependency>com.atlassian.auiplugin:message</dependency> <dependency>com.atlassian.auiplugin:aui-select2</dependency> <resource type="download" name="sample.css" location="/css/sample.css"/> <resource type="download" name="sample.js" location="/js/sample.js"/> <resource type="download" name="images/" location="/images"/> <context>sample</context> <context>atl.admin</context> </web-resource> <!-- var ctx = AJS.contextPath(); ctx/rest/custom/1.0/apiname --> <rest key="custom-group-rest" path="/custom" version="1.0"> <description>Provides REST custom service.</description> </rest> <servlet name="licenseServlet" class="kr.osci.luffy.servlets.LicenseServlet" key="license"> <url-pattern>/sec/license</url-pattern> </servlet> <ao key="ao-module"> <description>The module configuring the Active Objects service used by this plugin </description> <entity>kr.osci.luffy.entity.LicenseEntity</entity> </ao> <servlet-filter name="Auth Filter" key="authFilter"<resource type="download" name="images/" location="/images"/> <context>sample</context> <context>atl.admin</context> </web-resource> class<web-section name="kr.osci.luffy.filter.SecAuthFiltermySection" location key="before-dispatch" mySection" location="admin_plugins_menu" weight="1000"> <description>The mySection weight="200">Plugin</description> <label>plugin Section</label> <description>Check group</description></web-section> <web-item name="myItem" <url-pattern>/*</url-pattern>key="my-item" section="admin_plugins_menu/mySection" weight="1000"> <description>The myItem Plugin</description> <init-param> <label>plugin sample</label> <link>/plugins/servlet/myServlet</link> <param-name>defaultName</param-name></web-item> <rest name="my Rest Resource" key="my-rest-resource" path="/custom" <param-value>Australia</param-value>version="1.0"> <description>The my Rest Resource Plugin</description> </init-param>rest> <servlet name="my Servlet" <dispatcher>REQUEST</dispatcher> key="my-servlet" class="com.plugin.jira.servlet.myServlet"> <description>The my Servlet <dispatcher>FORWARD<Plugin</dispatcher>description> </servlet-filter> <url-pattern>/myServlet</url-pattern> </servlet> </atlassian-plugin>
참조:Customize Atlassian products with apps
...