Confluence Plugin Development – Getting Started

Posted by admin on April 5th, 2014 filed in Development, Java, Wiki

Atlassian Confluence is a wiki server that we use at work. We stage and review documentation in private wiki spaces, and we then “publish” it to public wiki spaces. Confluence doesn’t provide this workflow out of the box, but you can buy a plugin (we use K15t Scroll Versions) that handles versioning and publishing on that level.

Since we also create custom plugins for our technical writers, I downloaded the Confluence SDK and started experimenting with blueprint plugins. (More about how to develop Confluence Blueprint Plugins in my next blog.)

How to Install the Atlassian Plugin SDK:

  1. Check the prerequisites (supported platforms, Windows preqreqs / Linux/Mac preqreqs).
  2. Install the latest Java JDK.
  3. Install the IDE of your choice, e.g. NetBeans for Java SE.
  4. Get a (free) Atlassian Developer account so you can ask and answer questions on their forum.
    Note: If you later decide to download and install a Confluence Trial server, the installer asks you for this account when it generates a license.
  5. Install the Atlassian Plugin SDK (Windows, Linux/Mac)
    Tip: Run atlas-update on the commandline after the installation.
    Now you have installed the Atlassian Maven Plugin Suite (short: AMPS).
  6. Optionally, update Maven, because the SDK’s commands link to an included outdated Maven version by default.
    1. Download Maven 3.0.x. (The newer versions don’t seem compatible at the time of writing)
    2. Change the default Maven version used by the SDK by modifying the ATLAS_MVN environment variable.
  7. Open a new command line window and verify that your Atlas home variable points to where you installed the SDK:
    echo %ATLAS_HOME%  
      C:\Users\yourname\atlassian-plugin-sdk

    
  8. Verify that the SDK commands work by running atlas-version on the command line.
    This command prints info about the SDK and also shows which version of Maven you are using.

Now browse the SDK directory and familiarize yourself with it:

  • apache-maven contains the (slightly outdated) default Maven2 installation.
  • bin contains Atlassian SDK commands. These are preconfigured wrapper files for commands that use the Maven version that you set under ATLAS_MVN.
  • repository is where Maven downloads required libraries while you work.

As a general aside about Maven: The Confluence SDK relies on Apache Maven. Maven automates downloading all dependent libraries from one central repository. This way every developer starts out the project with 100% the same “initial checkout”, which saves time. On the other hand, the repository download still takes time, so the “long wait” simply happens at a different stage.

Without Maven, you spend a long while hunting down external libraries; but after you have the JARs, you can start working at your own pace. With a Maven-based project, the project downloads quickly at first; but every time you touch something during the first few days, it starts downloading missing dependencies, and you have no way of telling how long that will actually take.

Consider the time factor when working with Maven: Before you have not indexed the repo and built the project at least once, it’s not downloaded completely, and you can’t really start working.

Next you want to try out some commands, create a Confluence plugin, and install it into a Confluence instance. Continue reading about How to develop Confluence Blueprint plugins in my next blog.

Comments are closed.