Blog Application not rendering content after offline .xar import (Problem with import of extensions offline)

Hello,

I would like to know whether it is possible to import extensions using .xar files from:

Administration → Import → Add File → Import

in the context of a standalone, offline demo installation of XWiki.

I am using the following version:
xwiki-platform-distribution-flavor-xip-17.10.3


Context

My XWiki instance is running on a completely offline machine (no Internet access).
I can only download files from another computer that has Internet access, and then transfer them manually.


Issue encountered

I am trying to use the XWiki Blog Application.

When I create a blog post, instead of displaying my content, I only see the following text:

$services.blog.renderContentHTML($postDoc, $postObj, $useSummary, false, false)

I imported the following file:

org.xwiki.contrib.blog_application-~.xar

What I have already tried

  • Importing .xar files via Administration → Import

  • Manually installing dependencies:

    • .jar files copied into:

      webapps/xwiki/WEB-INF/lib

    • .xar files imported via the Import menu

However:

  • I cannot always find all required dependencies in .jar or .xar format

  • When importing a .xar, it seems to download and install items, but then shows an import error

  • I have seen on the forum that offline extensions are supposed to work, but they are simply not recognized as “extensions” by the Extension Manager


My questions

  • Am I doing something wrong in the installation process?

  • What is the correct procedure to properly install an extension in a fully offline environment?

  • Should I use a different method instead of manually importing .xar files?

  • Is copying .jar files into WEB-INF/lib actually recommended?

In any case, I cannot connect this machine to the Internet.

Thank you in advance for your help :slightly_smiling_face:

Trying to install a complex extension offline using XAR and JAR is often hard (mainly because of the hunting down the right dependencies part, as you noticed).

What generally give better results is to produce a XIP package (like the one you used to install the flavor) with the extension(s) you need (and their dependencies) in it. It involves Maven, and it’s not very complex, but it’s a bit of learning if you never used Maven before.

See https://dev.xwiki.org/xwiki/bin/view/Community/ExtensionPlugin/#HXIPMojoandextension which contain an example very similar to your use case.

Hello,

Thank you very much for your reply. It’s really not as simple as you say because I’ve never used Maven and I’m not very comfortable with it. Furthermore, I don’t know how to handle dependencies that don’t have a .xar or .jar file. For example for blog application: org.xwiki.platform:xwiki-platform-localization-macro 12.10.3. There are many dependancies like this that don’t have jar or xar files.
To make what is in the link that you sent, Do I need to add all .jar and .xar in the folder with the pom.xml?

And is it possible to make the command “mvn package” offline?

Have a good day.

No, the idea is that Maven automatically download everything needed automatically from the repository. You just indicate the identifier of the top level extension (so the blog in your case).

No, you would create a XIP package on a computer which have access to internet and then use the produced XIP package on the offline XWiki instance.

Hello,

Thank you for your answer. I will try this.

Have a good day.

Hello,

I wasn’t able to create XIP packages; the pom.xml (based on the one in the documentation you sent me) threw errors when I ran the “mvn package” command. However, I was able to create a pom.xml that sets up a local repository containing everything needed for an extension, and in the pom.xml, I had to add the missing repositories for it to work. My extensions seem to be working this way.

Thank you for your help.