Offline installation

I am trying to demo XWiki on an offline server inside our corporate network. the http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Installation page states the following options for offline installations:

  1. Set up a local Extension Repository- This seems to work, but I cannot find a good way of downloading all available extensions to host internally. Manually installing extensions will take too long due to the dependency chains.
  2. Install the standalone distribution: XWiki failed to run when I installed using the exe installer for windows. Furthermore, we are looking at deploying several applications, so I’d rather host manually using our own database and Tomcat (which works fine, but I can’t easily import packages).
  3. Import default wiki pages using the XAR import feature- this worked, but the pages and theme were different than what was installed when I did this with an online server.
  4. Use the offline packager maven plugin - I tried this option, but it didn’t seem to work.

The best option seems to be to somehow clone the XWiki extension database for offline use- is there any way to do this?

It depends what you mean exactly by “demo”. If you don’t plan to add much content in it you might want to try the all in one jetty/hsqldb based package (“ZIP Package”) from http://www.xwiki.org/xwiki/bin/view/Download/DownloadVersion/?projectVersion=9.4.

We’d like to deploy XWiki in a manner similar to a production deployment. Is there a simple way of moving the packages from the ZIP download to an extracted WAR set up in Tomcat? How would we upgrade / manage packages going forward?

Offline install is not really first class citizen right now but the good news is that we worked on it in 9.5.

What issue did you have with offline packager maven plugin ? It’s usually what gives the cleanest result.

That’s good news that it is being worked on in 9.5.

Maven issues:

  1. I’m not sure how to find the extension groupid and artifactid for extensions listed on the online repository. Is there a way to simply add all extensions?
    2a) using the pom contained on github:, the .jar file is created in the /target directory (there is no data folder), but the zip archive is not created.).2017-06-15 mvnlog.txt (4.3 KB)
    2b) using the pom documented on github (which is different than the file downloaded with the package) generates several errors and no output files.
  2. nothing seems to happen when I load the .jar file (there was no zip file generated to go along with it.

Thank you for your help!

As suggested by its name this is a Maven plugin. So you are not supposed to build it, you are supposed to create a custom pom with what you want to package and use the plugin to package them.

I can’t add much more to what’s on https://github.com/xwiki-contrib/maven-plugin-offline-xwiki-repository-packager#usage. In you use case you should keep only xwiki-enterprise-web and xwiki-enterprise-ui-mainwiki in the dependencies given as example since that’s the only thing you want. And it produces a zip, not a jar.

At the bottom of the instructions it says:

"You can build your project with mvn package , and you will get your repository packaged in the target folder, under the data folder, and a ready to transfer zip file in my.artifact.id-version.zip .

To use that repository, in a fresh installation of XWiki (no database, nor existing extensions installed yet), unzip the resulting package in the permanent directory. Be careful to give appropriate rights to allow the servlet container to write over the extracted files."

I assumed the refence to “you will get your repository packaged in the target folder” would create a .jar file. The output was created when issuing the mvn package command as instructed.

I added a few things to the example pom.xml to make it more accurate.

The goal here is to create a package containing a bunch of extensions in a zip so that you can put them in your XWiki instance and most of those extension are not JARs but packaged wiki pages. Then XWiki will find and install the extensions you added.

Thanks…

Now I’m getting a build failure stating that Plugin org.xwiki.contrib:offline-xwiki-repository-packager-maven-plugin:1.0 could not be resolved. I’ve downloaded this from github and extracted to .m2\repository… am I missing something?

You don’t need to download anything actually if you use maven. You just need to have a plugin dependency on it. And make sure you defined the XWiki repository in your settings.xml maybe. See http://dev.xwiki.org/xwiki/bin/view/Community/Building#HInstallingMaven

That did the trick! I just simply installed Maven (I’ve never used it before) and I didn’t realize I needed to create the settings.xml file first. Thanks so much!

I added plugin repository to the example, should not require any settings now.

Ok - so I tried this out and I am able to get to the user interface installation page when configuring XWiki, but the installation fails when it gets to “Resolving extension dependency [org.xwiki.platform:xwiki-platform-livetable-ui-8.4] on namespace [Home]”

I’m guessing I need to add this package to the Maven pom file? How do I establish the groupID, artifactID, and version?

1 Like

How is it going?
Have you done that challenge?
I faced the same needs - to make offline repository and still cannot understand how it should work.
Can you show me pls your pom.xml and settings.xml?

Hi - yes, I was able to figure this out with the help of Thomas. I currently don’t have access to my personal laptop, but I will put together a set of instructions and send the appropriate files. The offline installation package has helped tremendously as now I only need to do this for extensions which are not included/bundled by default.

1 Like

I believe you need to set up Maven as if you were going to compile XWiki as described here

Here’s a copy of my pom.xml file pom.txt (10.8 KB)

As you can see there are quite a few extensions commented out. I’m not sure why, but for some reason all extensions would not package correctly in the zip file, so I would note any missing extensions, and then repeat the process with just those extensions until all were loaded and available on my offline installation. I started with the pom.xml listed on GitHub and modified accordingly.

1 Like

Thank you very much for your file, but I couldn’t setup offline repository.
I do the next steps:

  1. put pom.xml pom.txt (10.8 KB) and offline-repository.xml at the /var/lib/tomcat8/webapps/ROOT/
  2. I run command “mvn package” and wait some time
  3. while it’s downloading(~450Mb), I open xwiki.properties and add there “extension.repositories=local:maven:file://var/lib/tomcat8/webapps/ROOT/.m2/repository”
    But there are no extensions - “Administer xWiki - Extensions - Extensions - Local - Local Extensions - Scope button” shows nothing.
  4. I was trying to restart xWiki with changed xwiki.properties.
    Where is/are mistake(s)?
    I think:
  • in my .m2/repository only directories, maybe there is should be *.xml also?
    Please, let me know about any yours assumptions.

Could you please tell me: which arguments of command “mvn” do you use, when you make an repository?
I try to make repository with “mvn -X -f /tmp/pom.xml -s /var/maven/.m2/settings.xml -Duser.home=/var/maven install” but then, when I add repository /var/maven to xwiki`s config it find no any plugins.

Assuming Maven has been set up correctly, you just navigate to the root folder for your project (my-app from the https://github.com/xwiki-contrib/maven-plugin-offline-xwiki-repository-packager example) and execute “mvn package”. You will see a lot of download activity and if all the extensions are resolved correctly, they will be packaged into a zip file which appears in the target subfolder

Sorry- I just re-read your older post!

  • The whole Maven setup / offline repo should NOT be done under your Tomcat folder- In fact, it shouldn’t be possible as you’re production machine is “offline”. I literally have two machines - production (no internet access) and development (internet access).
  • No need to edit any XWiki/Tomcat configuration files (xwiki.properties) as we’re not standing up a new repository site- we’re simply deploying extensions (and their dependencies directly to XWiki)

You need to follow the instructions here on the development machine - you don’t need tomcat installed at all!

On your development machine:

  1. Follow the instructions described in the above link:
    1a. Install and setup Maven
    1b. Create a new Maven project (folder)
    1c. Create pom.xml and offline-repository.xml and place as instructed
    1d. Execute “mvn package”

  2. Copy the .zip file to your production machine

On your production machine:

  1. Extract the zip file to a temporary location
  2. Copy or move the extensions (just like deploying the offline XIP package) (extension\repository) to your XWiki permanent directory extension repository (Tomcat\work\Catalina\localhost\xwiki\extension\repository) - note: mine is called “xwiki” you’re free to name yours whatever you’d like. Note- you should copy and merge the extensions as I’m assuming you’ve already deployed the offline XIP package
  3. Restart Tomcat and you should see your extensions within XWiki when you change the dropdown to “local”
1 Like