This page last changed on Sep 26, 2006 by jnolen.
There are many ways to set up a plugin project. This guide uses a trimmed-down version of the Confluence Plugin Development Kit. You are welcome to use the PDK, but you will have to adapt these instructions yourself.
Creating the base plugin
- Download the template plugin archive.
- Expand it into your plugin development directory and rename the directory to your new plugin name (eg. 'my-plugin')
You should now have directory which contains several files and directories. Here's a quick breakdown:
Item |
Description |
build.properties |
This file contains properties which are specific to your build environment, such as the JDK version, source code locations and other details. You will need to rename it to build.properties for it to work |
confluence-X.X.X.xml |
These are project files for the different versions of Confluence. When you are ready to distribute your plugin, you'll need to compile it against one (or more) of these versions. There are other versions available here. |
project.properties |
This file contains properties which will be the same no matter the environment the project is being built in. |
project.xml |
This is the main file used by Maven when building and deploying the project. It is also used by the 'atlassian-idea' Maven plugin which builds the IDEA project files. |
src |
This directory contains the source code for the project. It contains two main sub-directories:
- src/etc - This is where non-Java resources go, such as the atlassian-plugin.xml file (described later), Velocity templates, JavaScript and image files.
- src/java - This is where Java source files go.
|
test |
This directory contains files specific to unit and functional testing. It also has etc and java directories, which serve the same purpose as those in the src directory, except for testing only. |
atlassian-plugin.xml |
This file, which is contained in src/etc, tells Confluence what to plugin in when the jar is loaded. |
Now we need to set up the project's properties.
Setting the project properties
First, we'll set up the basic details for the project. These may change as you progress with your development, but the core details should stay the same.
- Edit project.xml to match your plugin details.
- Edit project.properties for the same. You probably won't have to change it at this time, unless you need to change the maven.compile.target.
- Edit build.properties. Set the properties which are specific to your environment (eg. JDK version, Confluence source code location, proxy servers, etc) go.
- Edit src/etc/atlassian-plugin.xml. At this point, the only things you'll want to change are the plugin name, key and version number.
Now what?
Next, we have to add your new project to the Confluence project you set up earlier.
|