Changes between Version 2 and Version 3 of BuildASimplePlugin
- Timestamp:
- 24.07.2011 02:17:48 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BuildASimplePlugin
v2 v3 1 [[PageOutline]] 2 1 3 = Build a simple plugin = 2 4 3 5 This page describes how you can build a very simple DeepaMehta plugin. This demo plugin just creates a new topic type. 4 6 5 Once installed in DeepaMehta the topic type will appear in the createmenu, so you can create instances.7 Once the plugin runs the topic type will appear in DeepaMehta's ''create'' menu, so you can create instances. 6 8 And you will be able to fulltext search for the instances. 7 9 … … 9 11 10 12 Of course the topic type could be created interactively as well, by using DeepaMehta's type editor. 11 However, being packaged as a plugin your type definitions become deployable by other DeepaMehta users. 13 However, being packaged as a plugin you can publish it. 14 When other DeepaMehta users install your plugin they can use your type definitions. 12 15 13 16 == Preparation == … … 15 18 All you need is **Java 1.6** and **Maven** (version 3 is recommended) installed. 16 19 17 You don't need a DeepaMehta installation. The DeepaMehta build system will provision a DeepaMehta installation just for your plugin.20 You don't need a DeepaMehta installation. The DeepaMehta build system will provision a DeepaMehta installation (including a test database) for your plugin on-the-fly. 18 21 19 == Setup the directory structure==22 == Create the plugin == 20 23 24 You create the plugin just creating directories and text files. 21 25 A DeepaMehta plugin project adheres to a certain directory structure and file name conventions. 22 26 … … 34 38 }}} 35 39 36 Create the file `pom.xml`with this content:40 Create the file **`pom.xml`** with this content: 37 41 38 42 {{{ … … 61 65 }}} 62 66 63 Create the file `migration1.json`:67 Create the file **`migration1.json`**: 64 68 65 69 {{{ … … 84 88 }}} 85 89 86 Create the file `plugin.properties`:90 Create the file **`plugin.properties`**: 87 91 88 92 {{{ … … 91 95 }}} 92 96 97 == Install the plugin == 98 99 {{{ 100 cd demo-plugin-1 101 mvn install 102 }}} 103 104 This builds the plugin and installs it in your local Maven repository. 105 106 == Run the plugin == 107 108 {{{ 109 mvn pax:run 110 }}} 111 112 This provisions a DeepaMehta installation with your plugin installed, and runs it. 113 The usual DeepaMehta web client will show up in a new browser window. 114 You'll find the new topic type in DeepaMehta's ''create'' menu.