Confluence : Setting up a new Confluence plugin
This page last changed on Apr 25, 2007 by jnolen.
Creating the base pluginMethod 1: Extract the sample project
Follow the instructions in the README.txt for generating an IDE project file and customising the plugin. The contents of the sample project are like this: example-plugin/pom.xml example-plugin/README.txt example-plugin/src/main/java/com/example/confluence/plugin/ExampleMacro.java example-plugin/src/main/resources/atlassian-plugin.xml example-plugin/src/test/java/com/example/confluence/plugin/TestExampleMacro.java It includes a sample macro, ExampleMacro.java, a test case for that macro, TestExampleMacro.java, and a plugin descriptor, atlassian-plugin.xml. Method 2: Use the Confluence plugin archetypeThis Maven archetype automatically creates a simple plugin project, customising the sample files according to the parameters you provide on the command line. The Maven archetype plugin is responsible for downloading the Confluence plugin archetype and extracting it. All you need to do is run the archetype:create goal from the command line. Here is the command used to create the attached sample project: mvn archetype:create \ -DarchetypeGroupId=com.atlassian.maven.archetypes \ -DarchetypeArtifactId=confluence-plugin-archetype \ -DarchetypeVersion=2.0 \ -DremoteRepositories=http://repository.atlassian.com/maven2/ \ -DgroupId=com.example.confluence.plugin \ -DartifactId=example-plugin The last two parameters, groupId and artifactId, should be customised to suit your project. The first four parameters select the archetype to use, and should not be changed. Related pagesFor more information on writing Confluence plugins, see the Confluence plugin guide. Now what?Next, we have to add your new project to the Confluence project you set up earlier. |
![]() |
Document generated by Confluence on May 01, 2007 19:27 |