Using External JAR file

Hello,
i am trying to use an external java library (available as jar file) in a cuba project. No Maven Repository in available for this library as searched on Maven. The library is available on github at url
https://github.com/Baseform/Baseform-Epanet-Java-Library
I have added this library in FIle → Project Structure → Library in IDEA and then tried both of following one by one in build.gradle
compile(AwareEpanetNoDeps)
compile(‘org.addition.epanet’)
but gradle build failed both times.
Please guide.

Hi,

You can install it to your local maven repository using this guide.

After that, just add local repository to the build.gradle - see the guide here.

And now the artifact should be available for you locally, you can add it as a dependency. Please note that it won’t be available for your colleagues. If you want to share it, install it to the repository that is available to everyone.

Thanks Andrey, i will give it a try.

Also, you can have a look at Studio Guide, section “Adding a JAR file dependency”

Thanks Andrey. It has make it easily possible. Thanks again.