Import jar file and use it in service

hello everyone , I want to use jalali-calendar and convert Jalali Date to Gregorian Date , so I download ir.huri:JalaliCalendar:1.3.3 , but the problem is , I don’t know how should I use it in service , where should I add the file in moqui files , and how should import it in the service


Hi mahdi_rasouli, you can create librepo dir, put *.jar file into this dir, and declare in build.gradle file in your component.
In services, you can use the following ways:

<script>
import your.packge;
 def var = yourMethod(param1, param2)
</script>

or
<set field="var" from="your.package.methodName(param1, param2)"/>

1 Like

hi kieuanhvu , thanks very much , its so helpful , thanks for your answer

This is a good way to do it, though even better if the jar is available on Maven Central then you don’t need to download it first, just reference it. This one may not be, the place I search for these is: https://mvnrepository.com