今回は、コマンドプロンプトを使ってatlassian-plugin.xmlにモジュールを追加する方法を紹介します。
コマンドプロンプトを使ってモジュールを追加する手順は次のとおりです。
1.
コマンドプロンプトを立ち上げる。2.
モジュールを追加するプラグインのルートディレクトリ(pom.xmlが含まれているディレクトリ)に移動する。3.
次のコマンドを入力し、[Enter]キーを押す。
atlas-create-confluence-plugin-module
4.
追加するモジュールの選択肢が表示される。Atlassian SDK5.4.2の場合、選択肢として表示されるモジュールは次のとおり。- Blueprint
- Component Import
- Component
- Keyboard Shortcut
- Downloadable Plugin Resource
- Gadget Plugin Module
- Listening API Support
- Module Type
- REST Plugin Module
- Servlet Context Listener
- Servlet Context Parameter
- Servlet Filter
- Servlet
- Template Context Item
- Web Item
- Web Panel
- Web Panel Renderer
- Web Resource
- Web Resource Transformer
- Web Section
5.
表示される指示に従い、モジュール名などの詳細情報を入力・選択する。6.
他にもモジュールを追加するかどうか尋ねられる。追加する場合は[y]を、追加しない場合は[n]を入力して[Enter]キーを押す。[n]を押した場合、処理が終了する。例
上記の手順で、RESTモジュールを追加した場合、プラグインのatlassian-plugin.xmlに次のような要素が追加されます。
<rest name="My Rest Resource" i18n-name-key="my-rest-resource.name"
key="my-rest-resource" path="/myrestresource" version="1.0">
<description key="my-rest-resource.description">
The My Rest Resource Plugin
</description>
</rest>
また、次のjavaファイルが追加されます。
- rest/MyRestResource.java
- rest/MyREstResourceModel.java