Fill a local Maven repository with the default user interface extensions

Last modified by Clemens Robbenhaar on 2018/07/16

This should only be used if the server in which to install XWiki has no network access, and no other means to install the user interface is available.

This only works if you want to install extensions via the extension manager, and you know how to use the "extended search". It will not work when installing the main UI with the Distribution wizard, as it will not find the available flavors. For this, you must use an alternative method, like the XIP package.

Prerequisites

  • a staging / development server which has access to the internet, to collect the necessary resources from there 
  • a minimal development environment on the staging server including the mvn tool, as if you want to build XWiki from Source
  • a way to copy the resources from the staging to the production server 
  • write access to the xwiki.properties on the server

Download the UI resources

First make sure that you have the right settings.xml on the staging server, which has the XWiki repositories enabled.
You also might want to move away your current $HOME/.m2/repository temporarily to mimimize the amount of files to be transferred to production later.

Create an empty directory and place the following file as pom.xml in it:

 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 <modelVersion>4.0.0</modelVersion>
 <parent>
   <groupId>org.xwiki.commons</groupId>
   <artifactId>xwiki-commons-pom</artifactId>
   <version>7.4</version>
 </parent>
 <groupId>never-mind</groupId>
 <artifactId>never-mind</artifactId>
 <version>0.0</version>
 <name>dummy download package</name>
 <packaging>pom</packaging>
 <dependencies>
   <dependency>
     <groupId>org.xwiki.enterprise</groupId>
     <artifactId>xwiki-enterprise-ui-mainwiki</artifactId>
     <version>7.4</version>
     <type>xar</type>
   </dependency>
    [... add the extensions that you want to install here ...]
 </dependencies>
</project>

Make sure to update the version numbers (here 7.4) in both the <parent> and the <dependencies>.

Open a command line, change to the directory created in the previous step and issue the command:

mvn clean org.apache.maven.plugins:maven-dependency-plugin:go-offline

This should download all the required resources and dependencies.

Install the resources on the server

As the next step, copy the complete /.m2/repository to a directory on the production server where the user running the XWiki webapp can read it.
(TODO: figure out if only parts of the directory are sufficient, i.e. /.m2/repository/org/xwiki)

Configure in the xwiki.properties the destination directory on the server as the "main xwiki" repository:

extension.repositories=maven-xwiki:maven:file:/path/to/copy/of/the/.m2/repository

You now can install the extension offline by typing in the groupId:artifactId as extension id (e.g. org.xwiki.contrib:xwiki-application-admintools for the Admin Tools Application and then the version number. (Searching for the extension by name will not work, because a file system maven repo does not support this.)

Tags:
   

Get Connected