Offline install of Macros and Applications

Is there a way to install Macros and Applications (along with all of their dependencies) to a Xwiki instance offline. I was able to get this working with extensions by packaging them to a XIP using maven; however, the process does not work the same because Macros and Applications do not contain .jar files, but rather .xar files.

The type of extension does not have any impact on XIP packaging, the Standard Flavor XIP contains both types, for example.

Interesting, I don’t know why I can’t get it to work then. I was using your example that you provided me with for the MediaWiki Extension on Tuesday, but it complains that it can’t find a .jar file. For example if, I am trying to create a XIP for the application-filemanager. I created this pom:

<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.platform</groupId>
    <artifactId>xwiki-platform-distribution</artifactId>
    <!-- The version of XWiki where the extension is planned to be installed -->
    <version>13.10.7</version>
  </parent>
  <groupId>mygroupid</groupId>
  <artifactId>application-filemanager-xip</artifactId>
  <packaging>xip</packaging>
  <properties>
    <!-- It's expected for some enforcer rules to fail with a dependency that was not designed to be built with this version of XWiki -->
    <xwiki.enforcer.skip>true</xwiki.enforcer.skip>
  </properties>
  <dependencies>
    <!-- The extension to package along with its dependencies-->
    <dependency>
      <groupId>org.xwiki.contrib.application-filemanager</groupId>
      <artifactId>application-filemanager-ui</artifactId>
      <version>2.0.8</version>
    </dependency>
  </dependencies>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.xwiki.commons</groupId>
          <artifactId>xwiki-commons-tool-extension-plugin</artifactId>
          <version>${commons.version}</version>
          <configuration>
            <coreExtensions>
              <!-- We exclude what is already in the WAR -->
              <coreExtension>
                <groupId>org.xwiki.platform</groupId>
                <artifactId>xwiki-platform-distribution-war-dependencies</artifactId>
                <version>${platform.version}</version>
                <type>pom</type>
              </coreExtension>
            </coreExtensions>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
</project>

The warning I get is:

[WARNING] The POM for org.xwiki.contrib.application-filemanager:application-filemanager-ui:jar:2.0.8 is missing, no dependency information available

And then I get this error:

[ERROR] Failed to execute goal on project application-filemanager-xip: Could not resolve dependencies for project mygroupid:application-filemanager-xip:xip:13.10.7: Failure to find org.xwiki.contrib.application-filemanager:application-filemanager-ui:jar:2.0.8 in Index of /groups/public was cached in the local repository, resolution will not be reattempted until the update interval of xwiki-releases has elapsed or updates are forced

I’m assuming my issue is that I’m failing to point the pom to the correct artifact/group for the dependency, but I am not sure how to figure that out by looking through GitHub and the sources poms. Any help is much appreciated!

That’s because you told Maven that application-filemanager-ui is a JAR file (because jar is the default type in Maven), for a XAR you need to indicate <type>xar</type>.

That will definitely do it. Thanks for your help, apologizes in my lack of knowledge.