Use jar file instead of online repository

How to add desired jar file to build.gradle.kts instead of using online repository?
For example,
instead of the following code
implementation("com.github.library")

I used this code
implementation(fileTree("libs/library.jar"))
but it didn't work

Try this instead:

implementation(files("libs/library.jar"))

I tried it but it is still not recognized

Works for me :person_shrugging:

Where is your libs folder located relative to the build file?

It's in the root project.

But relative to the build.gradle.kts file?

In the project I'm looking at where this works it's something like:

โ”œโ”€โ”€ build.gradle.kts
โ””โ”€โ”€ lib
    โ””โ”€โ”€ dependency.jar
1 Like

Thank you, this code you gave worked, but I realized that the main problem is that the implemented files are not added to the output module file, what settings in Gradle are necessary for this?

The gradle example module uses modlImplementation rather than implementation: ignition-sdk-examples/perspective-component/gateway/build.gradle.kts at 276f89239073e2108253716bce7f4ff70d20698d ยท inductiveautomation/ignition-sdk-examples ยท GitHub

If that's not it then I'm not sure, I don't use the gradle plugin.

See ignition-module-tools/gradle-module-plugin at master ยท inductiveautomation/ignition-module-tools ยท GitHub

It's not a problem for perspective, when I use an external java library to write a scripting-function, that library is not added to the project output.

modlImplementation is the gradle configuration that instructs gradle-module-plugin to include a dependency in the module it builds. It doesn't really have anything to do with Perspective except that's the only example using it AFAIK.

1 Like

Thank you so much problem solved :โ -โ )