# Use jar file instead of online repository

**URL:** <https://forum.inductiveautomation.com/t/use-jar-file-instead-of-online-repository/95131>\
**Category:** Module Development\
**Created:** [August 25, 2024, 9:22pm UTC](https://forum.inductiveautomation.com/t/use-jar-file-instead-of-online-repository/95131 "2024-08-25T21:22:31Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mehrdad\_Telli](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mehrdad_telli/32/77763_2.png) [@Mehrdad\_Telli](https://forum.inductiveautomation.com/u/Mehrdad_Telli)\
**Post date:** [August 25, 2024, 9:22pm UTC](https://forum.inductiveautomation.com/t/use-jar-file-instead-of-online-repository/95131/1 "2024-08-25T21:22:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 25, 2024, 9:40pm UTC](https://forum.inductiveautomation.com/t/use-jar-file-instead-of-online-repository/95131/2 "2024-08-25T21:40:56Z")

</div>

> [@Mehrdad\_Telli](#):
>
> implementation(fileTree("libs/library.jar"))

Try this instead:

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

```

---

<div class="post-metadata">

**Author:** ![Mehrdad\_Telli](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mehrdad_telli/32/77763_2.png) [@Mehrdad\_Telli](https://forum.inductiveautomation.com/u/Mehrdad_Telli)\
**Post date:** [August 25, 2024, 10:04pm UTC](https://forum.inductiveautomation.com/t/use-jar-file-instead-of-online-repository/95131/3 "2024-08-25T22:04:17Z")

</div>

I tried it but it is still not recognized

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 25, 2024, 10:05pm UTC](https://forum.inductiveautomation.com/t/use-jar-file-instead-of-online-repository/95131/4 "2024-08-25T22:05:34Z")

</div>

Works for me 🤷

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

---

<div class="post-metadata">

**Author:** ![Mehrdad\_Telli](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mehrdad_telli/32/77763_2.png) [@Mehrdad\_Telli](https://forum.inductiveautomation.com/u/Mehrdad_Telli)\
**Post date:** [August 25, 2024, 10:06pm UTC](https://forum.inductiveautomation.com/t/use-jar-file-instead-of-online-repository/95131/5 "2024-08-25T22:06:32Z")

</div>

It's in the root project.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 25, 2024, 10:49pm UTC](https://forum.inductiveautomation.com/t/use-jar-file-instead-of-online-repository/95131/6 "2024-08-25T22:49:31Z")

</div>

But relative to the `build.gradle.kts` file?

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

```python
├── build.gradle.kts
└── lib
    └── dependency.jar

```

---

<div class="post-metadata">

**Author:** ![Mehrdad\_Telli](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mehrdad_telli/32/77763_2.png) [@Mehrdad\_Telli](https://forum.inductiveautomation.com/u/Mehrdad_Telli)\
**Post date:** [August 26, 2024, 8:37pm UTC](https://forum.inductiveautomation.com/t/use-jar-file-instead-of-online-repository/95131/7 "2024-08-26T20:37:40Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 26, 2024, 8:45pm UTC](https://forum.inductiveautomation.com/t/use-jar-file-instead-of-online-repository/95131/8 "2024-08-26T20:45:35Z")

</div>

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](https://github.com/inductiveautomation/ignition-sdk-examples/blob/276f89239073e2108253716bce7f4ff70d20698d/perspective-component/gateway/build.gradle.kts#L17)

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](https://github.com/inductiveautomation/ignition-module-tools/tree/master/gradle-module-plugin)

---

<div class="post-metadata">

**Author:** ![Mehrdad\_Telli](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mehrdad_telli/32/77763_2.png) [@Mehrdad\_Telli](https://forum.inductiveautomation.com/u/Mehrdad_Telli)\
**Post date:** [August 26, 2024, 9:06pm UTC](https://forum.inductiveautomation.com/t/use-jar-file-instead-of-online-repository/95131/9 "2024-08-26T21:06:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 26, 2024, 10:21pm UTC](https://forum.inductiveautomation.com/t/use-jar-file-instead-of-online-repository/95131/10 "2024-08-26T22:21:31Z")

</div>

`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.

---

<div class="post-metadata">

**Author:** ![Mehrdad\_Telli](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mehrdad_telli/32/77763_2.png) [@Mehrdad\_Telli](https://forum.inductiveautomation.com/u/Mehrdad_Telli)\
**Post date:** [August 28, 2024, 1:01pm UTC](https://forum.inductiveautomation.com/t/use-jar-file-instead-of-online-repository/95131/11 "2024-08-28T13:01:07Z")

</div>

Thank you so much problem solved :⁠-⁠)
