- Download the SDK: Head over to the Atlassian Developer website and download the latest version of the SDK. Make sure you choose the version that’s compatible with your operating system.
- Install the SDK: Follow the installation instructions provided on the Atlassian website. Typically, this involves extracting the downloaded archive to a directory on your computer.
- Configure Environment Variables: You’ll need to set up a few environment variables to make sure the SDK works correctly. Add
ATLAS_HOMEandPATHvariables.ATLAS_HOMEshould point to the directory where you installed the SDK, andPATHshould include thebindirectory within the SDK installation. - Verify the Installation: Open your command line or terminal and run the command
atlas-version. If the SDK is installed correctly, you should see the version information displayed. - Install an IDE: If you haven’t already, download and install your preferred IDE.
- Install the Atlassian Plugin SDK Plugin: Most IDEs have plugins or extensions that provide additional support for Atlassian plugin development. For example, IntelliJ IDEA has the Atlassian Plugin SDK plugin, which helps you create, build, and debug your plugins.
- Configure Your Project: When creating a new project, choose the appropriate template for an Atlassian plugin. The Atlassian Plugin SDK plugin should provide a template specifically for Confluence plugins.
- Download Confluence: Download the Confluence Server or Data Center from the Atlassian website. You can get a free developer license for testing purposes.
- Install Confluence: Follow the installation instructions provided by Atlassian. This typically involves running an installer and configuring the database.
- Start Confluence: Once installed, start your Confluence instance. It might take a few minutes for Confluence to start up completely.
- Access Confluence: Open your web browser and navigate to the address where Confluence is running (usually
http://localhost:1990/confluence). Follow the setup wizard to configure your Confluence instance. - Open Your Command Line: Open your command line or terminal and navigate to the directory where you want to create your plugin project.
- Run the
atlas-createCommand: Execute the following command:
So, you want to create a Confluence plugin, huh? That's awesome! Confluence plugins can seriously boost the functionality of your Confluence instance, tailoring it to your specific needs. Whether you're looking to automate tasks, integrate with other tools, or simply add a unique feature, building a plugin is the way to go. In this guide, we'll walk you through the entire process, step-by-step, making it super easy to understand, even if you're relatively new to plugin development. Let’s dive in and get you started on your Confluence plugin journey!
Setting Up Your Development Environment
First things first, before you start coding, you need to set up your development environment. This involves installing the necessary tools and configuring your IDE (Integrated Development Environment). Trust me; a properly set up environment will save you tons of headaches down the road. Think of it like prepping your kitchen before cooking a gourmet meal – you want everything within easy reach.
Install the Atlassian SDK
The Atlassian Software Development Kit (SDK) is your best friend when it comes to developing Confluence plugins. It provides the necessary tools and libraries to create, build, and test your plugins. Here’s how to get it installed:
Choose and Configure Your IDE
An IDE makes coding much easier with features like code completion, debugging, and project management. Popular choices include IntelliJ IDEA, Eclipse, and Visual Studio Code. Here’s how to configure your IDE for Confluence plugin development:
Setting Up Your Confluence Instance
To test your plugin, you’ll need a running instance of Confluence. You can use a local instance for development purposes. Here’s how to set it up:
With your development environment set up, you’re now ready to start creating your Confluence plugin. This initial setup is crucial, so make sure you've got each step down before moving forward. Think of it as laying the foundation for a skyscraper – you want it to be rock solid!
Creating a New Confluence Plugin Project
Alright, with your development environment all set up, it's time to roll up our sleeves and create a new Confluence plugin project. This is where the magic begins! We'll use the Atlassian SDK to generate a basic project structure, which we can then customize to our heart's content.
Using the atlas-create Command
The Atlassian SDK provides a handy command called atlas-create that automates the creation of a new plugin project. Here's how to use it:
atlas-create confluence-plugin
This command tells the SDK to create a new Confluence plugin project. The SDK will then prompt you for some information about your plugin, such as the group ID, artifact ID, and version.
- Enter Project Details:
- Group ID: This is typically a reverse domain name, such as
com.example. - Artifact ID: This is the name of your plugin, such as
my-confluence-plugin. - Version: The initial version of your plugin, typically
1.0.0-SNAPSHOT. - Package: The package name for your plugin's Java code, such as
com.example.myplugin.
- Group ID: This is typically a reverse domain name, such as
The SDK will use this information to generate the project structure and configuration files.
- Confirm Project Creation: After entering the project details, the SDK will ask you to confirm the creation of the project. Type
Yand press Enter to proceed.
Understanding the Project Structure
Once the atlas-create command completes, you'll have a new directory containing the basic structure of your Confluence plugin project. Here's a breakdown of the key directories and files:
src/main/java: This directory contains the Java source code for your plugin.src/main/resources: This directory contains resource files, such as Velocity templates, CSS files, and JavaScript files.src/test/java: This directory contains the unit tests for your plugin.src/test/resources: This directory contains resource files for your unit tests.pom.xml: This file is the Project Object Model (POM) file, which contains information about your project, such as dependencies, build configuration, and plugin metadata. This is crucial for managing your project's dependencies and build process.atlassian-plugin.xml: This file is the plugin descriptor, which defines the modules and components that make up your plugin. It tells Confluence what your plugin does and how to integrate it into the Confluence UI.
Importing the Project into Your IDE
Now that you've created the project, it's time to import it into your IDE. This will allow you to easily edit, build, and debug your plugin.
- Open Your IDE: Launch your preferred IDE (e.g., IntelliJ IDEA, Eclipse).
- Import the Project: Use the IDE's import function to import the project. In IntelliJ IDEA, you can select
File > New > Project from Existing Sourcesand choose thepom.xmlfile in your project directory. Eclipse has a similar import function. - Configure the Project: Your IDE should automatically recognize the project as a Maven project and configure it accordingly. If not, you may need to manually configure the project settings.
With your project created and imported into your IDE, you're now ready to start adding functionality to your plugin. Remember, the atlas-create command is your friend, so don't hesitate to use it whenever you need to create a new plugin project. It's like having a magic wand for plugin development!
Defining Plugin Modules
Okay, so you've got your project set up. Now comes the fun part: defining the modules that will make up your Confluence plugin. Modules are the building blocks of your plugin, defining what it does and how it interacts with Confluence. Think of them as the individual components of a machine, each with its own specific function.
Understanding Plugin Modules
Confluence plugins can consist of various types of modules, each serving a different purpose. Here are some of the most common module types:
- Web Items: These modules add links to the Confluence UI, allowing users to navigate to different parts of your plugin.
- Web Sections: These modules define sections in the Confluence UI where web items can be placed.
- Web Panels: These modules add custom panels to Confluence pages, displaying information or providing functionality.
- Macros: These modules allow users to insert dynamic content into Confluence pages using a simple syntax.
- Event Listeners: These modules listen for events in Confluence and perform actions in response.
- REST APIs: These modules expose REST APIs that can be used by other applications to interact with your plugin.
Declaring Modules in atlassian-plugin.xml
The atlassian-plugin.xml file is where you declare all the modules that make up your plugin. This file tells Confluence what your plugin does and how to integrate it into the Confluence UI. Here's an example of how to declare a web item module:
<web-item key="my-web-item" name="My Web Item" section="system.header/left" weight="10">
<label key="my.web.item.label"/>
<link>/plugins/servlet/my-plugin/my-web-item</link>
</web-item>
In this example:
keyis a unique identifier for the module.nameis a human-readable name for the module.sectionspecifies where the web item should be placed in the Confluence UI.weightdetermines the order in which the web item appears in the section.labelis the text that will be displayed for the web item.linkis the URL that the web item will link to.
Creating a Simple Web Item
Let's create a simple web item that adds a link to the Confluence header. Follow these steps:
- Open
atlassian-plugin.xml: Open theatlassian-plugin.xmlfile in your project. - Add the Web Item Module: Add the following XML code to the file:
<web-item key="my-web-item" name="My Web Item" section="system.header/left" weight="10">
<label key="my.web.item.label"/>
<link>/plugins/servlet/my-plugin/my-web-item</link>
</web-item>
- Add a Resource Bundle: Create a resource bundle file (e.g.,
src/main/resources/my-plugin.properties) and add the following entry:
my.web.item.label=My Web Item
- Create a Servlet: Create a servlet that will handle the request when the web item is clicked. This servlet should be mapped to the URL specified in the
linkelement of the web item module.
With these steps completed, you've successfully added a web item to your Confluence plugin. This is just one example of the many types of modules you can create. Experiment with different module types to create powerful and feature-rich plugins! Remember, the atlassian-plugin.xml file is the key to defining your plugin's modules, so make sure you understand its structure and syntax.
Building and Deploying Your Plugin
Alright, you've coded up a storm, defined your plugin modules, and now you're itching to see your creation in action. The next step is to build and deploy your plugin to your Confluence instance. Don't worry, it's not as daunting as it sounds. With the Atlassian SDK, the process is pretty straightforward.
Building Your Plugin
Building your plugin involves compiling the code, packaging the resources, and creating a plugin artifact that can be deployed to Confluence. The Atlassian SDK provides a command called atlas-package that automates this process.
- Open Your Command Line: Open your command line or terminal and navigate to the root directory of your plugin project.
- Run the
atlas-packageCommand: Execute the following command:
atlas-package
This command tells the SDK to build your plugin. The SDK will compile the Java code, package the resources, and create a plugin artifact (a JAR file) in the target directory of your project.
- Check the Build Output: The SDK will display the build output in the command line. If the build is successful, you should see a message indicating that the plugin artifact has been created.
Deploying Your Plugin
Once you've built your plugin, you can deploy it to your Confluence instance. The Atlassian SDK provides a command called atlas-install-plugin that automates this process.
- Ensure Confluence is Running: Make sure your Confluence instance is running.
- Run the
atlas-install-pluginCommand: Execute the following command:
atlas-install-plugin
This command tells the SDK to install your plugin to your Confluence instance. The SDK will automatically deploy the plugin artifact to Confluence.
- Restart Confluence (If Necessary): In some cases, you may need to restart Confluence for the plugin to be fully installed. The SDK will usually prompt you if a restart is required.
Verifying Your Plugin
After deploying your plugin, it's important to verify that it's working correctly. Here's how to do it:
- Log in to Confluence: Open your web browser and navigate to your Confluence instance. Log in as an administrator.
- Navigate to the Plugin Administration Page: Go to the Confluence administration page and click on the
Lastest News
-
-
Related News
San Antonio Personals: Find Connections & More
Alex Braham - Nov 13, 2025 46 Views -
Related News
Lazio U20 Vs Inter U20: IPK Dan Klasemen Terbaru
Alex Braham - Nov 9, 2025 48 Views -
Related News
Michael Franks: Exploring Antoniou's Song
Alex Braham - Nov 9, 2025 41 Views -
Related News
Emma Romero De Callejas: Unveiling Her Life And Legacy
Alex Braham - Nov 9, 2025 54 Views -
Related News
GoSport Soccer Tournaments 2025: What You Need To Know
Alex Braham - Nov 13, 2025 54 Views