This page last changed on Jun 30, 2006 by cmiller.

Set up the Plugin Source Directory

First things first, I'm going to need somewhere to put all my source code.

The Confluence Plugin Development Kit contains a template directory that you can rename to use for your own plugin. Having a standard directory structure is useful, because it allows you to use maven (or the ant tasks packaged in the plugins directory of your Confluence installation) to build your plugin jar. If you use a different directory structure, you'll have to build the plugin yourself.

You'll have to think of a name for your plugin. There are probably better names than userinfo, but I started this late on a Thursday afternoon. Also, you'll need a package name for your Java code. The Java standard for package names is to reverse your company's domain-name, which is exactly what I've done here:

I'm going to be doing all my development for this tutorial in the plugins directory of a copy of Confluence 2.2.5 that I downloaded from the Atlassian website

The Unreliable Narrator

In fact, I'll be doing all of my development in the same development environment I use to develop Confluence itself. I will then be copying it into the aforementioned plugins directory and taking screenshots, and pretending that's how I developed it in the first place.

In cooking shows, this would be called "...and here's one I prepared earlier."

Make an Empty atlassian-plugin.xml file.

You'll need to choose a unique plugin key. I can use the confluence.extra prefix for my plugin keys because I work at Atlassian. You should make your plugin key the same as the Java package name you chose earlier. You should also fill in the plugin metadata.

<atlassian-plugin name='User Information' key='confluence.extra.userinfo'>
    <plugin-info>
        <description>Allows users to store personal data/contact details about themselves</description>
        <vendor name="Atlassian Software Systems" url="http://www.atlassian.com"/>
        <version>1.0</version>
    </plugin-info>
</atlassian-plugin>

Once again, there's a template file in the Plugin Development Kit.

Compile and Upload

The plugin can now be built and installed into Confluence. I have no idea why you'd want to do it, but it's sort of necessary to come away from each step in a tutorial with some tangible evidence you've accomplished something. So here's what my new plugin looks like when I upload it into Confluence's plugin manager:

That's it. A plugin with no plugin modules. Next, we write some code!

Downloads


starting-file-structure.png (image/png)
build-terminal.png (image/png)
upload-plugin.png (image/png)
empty-plugin-module.png (image/png)
userinfo-src-1.tgz (application/x-gzip)
plugins-userinfo-1.jar (application/java-archive)
Document generated by Confluence on Oct 10, 2007 18:49