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. We have developed 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:

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

Installing an Extension


Deploying Extensions


Created by Vincent Massol on 2016/08/31

Get Connected