There are 2 types of Extensions:

  • XAR Extensions: they are wiki pages packaged in a format that is called XAR (which stands for XWiki Archive). It's a ZIP file with a specific directory structure and an XML syntax to represent the wik pages, along with a package metadata file.
  • JAR Extensions: they are XWiki Components written in Java and packaged in a JAR.

Creating a XAR Extension

The simplest strategy is to create the wiki pages in a running XWiki instance and then to export them as a XAR.

Note that those wiki pages can contain a lot of things:

Building a XAR with Maven

If you wish to save your XAR sources under version control and be able to build it, we recommend using Maven. There's a plugin called the XAR Maven plugin to help with this.

Here's how you can save the XAR you got when exporting pages from the wiki into your source tree:

  • create a [ROOT] directory to be the root of your Maven project
  • add a pom.xml file (see below for more details)
  • unzip the XAR into the [ROOT]/src/main/resources directory and remove the package.xml file (you don't need to save it since the Maven XAR plugin will regenerate it)
  • run mvn xar:format to pretty format the wiki pages (XML files)
  • run mvn install to automatically perform validation and generate the XAR

Authoring a Maven POM for a XAR

Here's an example of how your pom.xml could look like (adapt to your need):

<?xml version="1.0" encoding="UTF-8"?>

 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * Lesser General Public License for more details.
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site:

<project xmlns="" xmlns:xsi="" xsi:schemaLocation="">
 <name>Your extension's name</name>
 <description>Your extension's description</description>
   <connection>scm:git:git:// extension id).git</connection>
   <developerConnection>scm:git:[email protected]:xwiki-contrib/(your extension id).git</developerConnection>
   <url> extension id)</url>
     <id>scm id of developer 1</id>
     <name>Full Name of developer 1 as registered on, e.g. Vincent Massol</name>
     <id>scm id of developer N</id>
     <name>Full Name of developer N as registered on, e.g. Vincent Massol</name>
   <!-- Don't check for API backward-compatibility here since there's no Java code. -->
    If you're using a xwiki-commons parent POM that is >= 8.1M1 then you need to use:
    Otherwise you should use:
   <!-- The Extension name. If not defined, the <name> property is used -->
   <>Your extension's name</>
   <!-- The extension's category -->
     <name>XWiki Staging Repository</name>
   <url> jira project id)</url>

It's important that you set the following information as they'll be used by XWiki's Extension Manager when the extension is installed in XWiki (see below):

  • Extension id
  • Name
  • Description
  • Developers
  • Category (using <xwiki.extension.category>). Valid values are listed here.
  • SCM (Note: this is also required by the Maven Release plugin if you use it to release your extension)
  • Issue Management

If you've modified the groupId or artifactId of the extension you need to tell it to the Extension Manager so that it can handle upgrades and understand it's the same extension being upgraded. For example if the extension previously had an extension id of tdelafosse:meeting-application and you're now using another id, you need to add the following property to your pom.xml:

 <!-- Old names of this module used for retro compatibility when resolving dependencies of old extensions -->

In addition you need to pay attention to the version of the dependencies you're going to use (for example the version of your parent POM). If you wish your extension to be used by the maximum number of XWiki users you need to use the oldest dependencies version for which you extension still works. This is because your extension will only be able to be installed in XWiki versions satisfying those dependencies you expressed.

LTS are always provided for, in case the version you want is not listed you can either ask for it to be released in the Mailing List or use org.xwiki.commons:xwiki-commons-pom instead.

Creating a JAR Extension

XWiki has a notion of Components, and this is how it provides extensibility at the level of Java. XWiki itself is written as a set of Components. This allows extension writers to author Components that can replace (i.e. override) existing Components or add new Components to the system.

Here are some examples:

Follow the Creating an XWiki Component tutorial to learn how to both develop a Component and use Maven to build it.

Installing an Extension

There are 2 ways but the recommended one is to use the Extension Manager which you can find in the XWiki instance where you wish to install the extension in.

Using the Extension Manager

The advantage over the Manual way is that you don't need to regularly start/stop your XWiki instance and thus you don't occur the start wait times.

  • Have a running XWiki instance configured with a local Extension Repository pointing to your Maven local Repository. Edit and make sure you have the following set:
  • Build your component and deploy it in your local Maven repository with mvn install
  • Inside your running XWiki instance, go to the Extension Manager in the Admin UI (e.g. http://localhost:8080/xwiki/bin/admin/XWiki/XWikiPreferences?editor=globaladmin&section=XWiki.AddExtensions) and click on Advanced Search and enter your extension's id and version and follow the instructions.
If you want to redeploy an extension and it's already installed with the same version, the Extension Manager won't let you do so. Thus you'll need to uninstall it first using the Extension Manager. You'll also need to remove metadata in memory using the Extension Tweak.


For a XAR

  • To build the component, issue mvn install. This generates a XAR in the target directory of your project.
  • Inside your XWiki instance, go the Admin and Import the XAR.

For a JAR

  • To build the component, issue mvn install. This generates a JAR in the target directory of your project.
  • To install it into a XWiki Enterprise instance, just copy that JAR file in XE_WAR_HOME/WEB-INF/lib where XE_WAR_HOME is where the XWiki Enterprise WAR is deployed.

Deploying Extensions

If you wish to make your extension available to others to use, the best is to contribute it on Go there and enter a name for your extension in the Contribute box and submit. Then document nicely your extension with instructions on how to use. The more screenshots the better! Here are some documentation guidelines.

Once your extensions is there, it means that any user of XWiki in the world will be able to find it and install it directly from his/her wiki!

You may also want to join a family and contribute your extension on XWiki Contrib so that it is developed and maintained collaboratively.

Created by Vincent Massol on 2016/08/31 09:50

Get Connected