How to load moqui component using jar

Hi guys,

I have a situation where I’ve built a custom Moqui component and packaged it as a component.jar file. Now, I want to use this .jar file in another Moqui project. I’d like to know — does Moqui support this approach, and if so, what is the correct way to do it?

1 Like

Hi @arun! What I would do to reuse a component in different moqui projects is to create a different runtime for each project, and then put the component source code in the runtime/components folder. If you have the source code in a git repo you can use

./gradlew getComponent -Pcomponent={component name}

See Moqui Documentation
And
Moqui Documentation

Otherwise if you just want to add the jar as a dependency you can just put it in the lib folder inside the moqui framework.

2 Likes