How to Import an extension if it's a jar file?

How to import formula macro extension in an intranet xwiki, I tried importing like an xar file but it keeps on loading, is there any other way to include jar kind of extensions in xwiki?

Hello @Agustus,
If your wiki has internet access, you should be able to install it by searching for it in the extension manager.
If your wiki does not have internet access, you can follow those explanations.

Hi @mleduc ,
Thanks for the reply, I tried but I don’t know how to setup a local extension repository with maven.

Hello @Agustus If you want to install a .jar extension by copying the .jar file manually to your XWiki instance, this might help. (You should copy the jar to this location in your local XWiki.
<your xwiki distribution>/webapps/xwiki/WEB-INF/lib/

You can setup a local extension repository by modifying the file in your XWiki instance (as linked in @mleduc’s answer)
Basically, you have to uncomment some lines in the file. It should have the following lines enabled, I have an example file that you might want to see.
After following all this, you should restart your XWiki instance. This method has always worked for me.

Then finally use the advanced search to find it in your installed extensions.

Edit: I am using linux if that helps

Hello @rajat ,
I gave it a try but it is returning a 503 code in browser

That is unexpected. Can you tell me step-by-step what did you do exactly?

Hello, are you sure in this steps? Because on my side I also get 503 error

HTTP ERROR 503 Service Unavailable
URI:	/xwiki/
MESSAGE:	Service Unavailable

with this log in console

2023-09-12 14:41:53.410:WARN :oejw.WebAppContext:main: Failed startup of context o.e.j.w.WebAppContext@1ed6388a{XWiki,/xwiki,file:///[my_xwiki_location]/webapps/xwiki/,UNAVAILABLE}{[my_xwiki_location]\./webapps/xwiki}

java.lang.NoClassDefFoundError: Failed to get fields for class [org.xwiki.rendering.internal.macro.formula.FormulaMacro] because the class [org/xwiki/formula/internal/TemporaryResourceReferenceProvider] couldn't be found in the ClassLoader.
        at org.xwiki.component.util.ReflectionUtils.getAllFields(
        at org.xwiki.component.annotation.ComponentDescriptorFactory.createComponentDescriptor(
        at org.xwiki.component.annotation.ComponentDescriptorFactory.createComponentDescriptors(
        at org.xwiki.component.annotation.ComponentAnnotationLoader.getComponentsDescriptors(
        at org.xwiki.component.annotation.ComponentAnnotationLoader.register(
        at org.xwiki.component.annotation.ComponentAnnotationLoader.initialize(
        at org.xwiki.component.annotation.ComponentAnnotationLoader.initialize(
        at org.xwiki.component.embed.EmbeddableComponentManager.initialize(
        at org.xwiki.container.servlet.XWikiServletContextListener.contextInitialized(
        at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(
        at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(
        at org.eclipse.jetty.server.handler.ContextHandler.contextInitialized(
        at org.eclipse.jetty.servlet.ServletHandler.initialize(
        at org.eclipse.jetty.servlet.ServletContextHandler.startContext(
        at org.eclipse.jetty.webapp.WebAppContext.startContext(
        at org.eclipse.jetty.server.handler.ContextHandler.doStart(
        at org.eclipse.jetty.servlet.ServletContextHandler.doStart(
        at org.eclipse.jetty.webapp.WebAppContext.doStart(
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(
        at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(
        at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(
        at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(
        at org.eclipse.jetty.deploy.DeploymentManager.addApp(
        at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(
        at org.eclipse.jetty.deploy.providers.WebAppProvider.fileAdded(
        at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(
        at org.eclipse.jetty.util.Scanner$DiscreteListener.pathAdded(
        at org.eclipse.jetty.util.Scanner.reportAddition(
        at org.eclipse.jetty.util.Scanner.reportDifferences(
        at org.eclipse.jetty.util.Scanner.scan(
        at org.eclipse.jetty.util.Scanner.doStart(
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(
        at org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(
        at org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(
        at org.eclipse.jetty.deploy.DeploymentManager.doStart(
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(
        at org.eclipse.jetty.server.Server.start(
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(
        at org.eclipse.jetty.server.handler.AbstractHandler.doStart(
        at org.eclipse.jetty.server.Server.doStart(
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(
        at org.eclipse.jetty.xml.XmlConfiguration.lambda$main$4(
        at java.base/
        at org.eclipse.jetty.xml.XmlConfiguration.main(
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.base/java.lang.reflect.Method.invoke(
        at org.eclipse.jetty.start.Main.invokeMain(
        at org.eclipse.jetty.start.Main.start(
        at org.eclipse.jetty.start.Main.main(

Do you have installed and set Maven on your Windows 10 machine? What’s the result of mvn --version in CommandLine?

I copied the jar file and placed it in
<your xwiki distribution>/webapps/xwiki/WEB-INF/lib/
Then I went to file and uncommented those lines same like you did and then relaunched my xwiki

I am getting this

Apache Maven 3.9.4 (dfbb324ad4a7c8fb0bf182e6d91b0ae20e3d2dd9)
Maven home: D:\apache-maven-3.9.4
Java version: 17.0.8, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-17
Default locale: en_IN, platform encoding: Cp1252
OS name: “windows 10”, version: “10.0”, arch: “amd64”, family: “windows”

It sounds to me as if you’re missing dependencies. If you install an extension manually, you also need to install all its dependencies that aren’t part of the installation already. Also, why don’t you want to install the extension using the extension manager? Is your installation offline?

Yes it’s an intranet application, that is the reason

Offline installs need a XIP to install extensions, see How to generate a XIP file for an Extension? (

See also the doc at Install the wiki UI (

Hello @vmassol, I saw these documentations ,but I don’t have expertise in creating a maven module and how to create a maven module, that’s why I was not able to do it. Anyway thanks for the help