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 xwiki.properties file in your XWiki instance (as linked in @mleduc’s answer)
Basically, you have to uncomment some lines in the xwiki.properties 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/
STATUS:	503
MESSAGE:	Service Unavailable
SERVLET:	-

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(ReflectionUtils.java:83)
        at org.xwiki.component.annotation.ComponentDescriptorFactory.createComponentDescriptor(ComponentDescriptorFactory.java:135)
        at org.xwiki.component.annotation.ComponentDescriptorFactory.createComponentDescriptors(ComponentDescriptorFactory.java:108)
        at org.xwiki.component.annotation.ComponentAnnotationLoader.getComponentsDescriptors(ComponentAnnotationLoader.java:169)
        at org.xwiki.component.annotation.ComponentAnnotationLoader.register(ComponentAnnotationLoader.java:215)
        at org.xwiki.component.annotation.ComponentAnnotationLoader.initialize(ComponentAnnotationLoader.java:137)
        at org.xwiki.component.annotation.ComponentAnnotationLoader.initialize(ComponentAnnotationLoader.java:119)
        at org.xwiki.component.embed.EmbeddableComponentManager.initialize(EmbeddableComponentManager.java:156)
        at org.xwiki.container.servlet.XWikiServletContextListener.contextInitialized(XWikiServletContextListener.java:63)
        at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:1043)
        at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:624)
        at org.eclipse.jetty.server.handler.ContextHandler.contextInitialized(ContextHandler.java:978)
        at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:705)
        at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:392)
        at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1304)
        at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:895)
        at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:306)
        at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:532)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
        at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:40)
        at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:183)
        at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:516)
        at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:151)
        at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:186)
        at org.eclipse.jetty.deploy.providers.WebAppProvider.fileAdded(WebAppProvider.java:462)
        at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:58)
        at org.eclipse.jetty.util.Scanner$DiscreteListener.pathAdded(Scanner.java:282)
        at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:836)
        at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:802)
        at org.eclipse.jetty.util.Scanner.scan(Scanner.java:709)
        at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:597)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:171)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:121)
        at org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(ScanningAppProvider.java:158)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
        at org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(DeploymentManager.java:605)
        at org.eclipse.jetty.deploy.DeploymentManager.doStart(DeploymentManager.java:246)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:171)
        at org.eclipse.jetty.server.Server.start(Server.java:469)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:121)
        at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:89)
        at org.eclipse.jetty.server.Server.doStart(Server.java:414)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
        at org.eclipse.jetty.xml.XmlConfiguration.lambda$main$4(XmlConfiguration.java:1867)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
        at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1810)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.eclipse.jetty.start.Main.invokeMain(Main.java:227)
        at org.eclipse.jetty.start.Main.start(Main.java:512)
        at org.eclipse.jetty.start.Main.main(Main.java:74)

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 xwiki.properties 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? (XWiki.org)

See also the doc at Install the wiki UI (XWiki.org)

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