# How to include a dependency JAR file in the Maven .modl build?

**URL:** <https://forum.inductiveautomation.com/t/how-to-include-a-dependency-jar-file-in-the-maven-modl-build/27631>\
**Category:** Module Development\
**Created:** [August 21, 2019, 1:07pm UTC](https://forum.inductiveautomation.com/t/how-to-include-a-dependency-jar-file-in-the-maven-modl-build/27631 "2019-08-21T13:07:10Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruce.burton](https://avatars.discourse-cdn.com/v4/letter/b/67e7ee/32.png) [@bruce.burton](https://forum.inductiveautomation.com/u/bruce.burton)\
**Post date:** [August 21, 2019, 1:07pm UTC](https://forum.inductiveautomation.com/t/how-to-include-a-dependency-jar-file-in-the-maven-modl-build/27631/1 "2019-08-21T13:07:10Z")

</div>

Hey All,

I’m using Eclipse and the Maven plug in to build a module. I would like the resulting modl file to include a jar file that my project is dependent on. Does anybody know how to configure either the the eclipse project or the maven plug such that I can control which files are included in the modl file?

thanks,

Bruce

---

<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 21, 2019, 1:12pm UTC](https://forum.inductiveautomation.com/t/how-to-include-a-dependency-jar-file-in-the-maven-modl-build/27631/2 "2019-08-21T13:12:42Z")

</div>

Have you tried packaging yet? The ignition-maven-plugin does this automatically.

---

<div class="post-metadata">

**Author:** ![bruce.burton](https://avatars.discourse-cdn.com/v4/letter/b/67e7ee/32.png) [@bruce.burton](https://forum.inductiveautomation.com/u/bruce.burton)\
**Post date:** [August 21, 2019, 1:41pm UTC](https://forum.inductiveautomation.com/t/how-to-include-a-dependency-jar-file-in-the-maven-modl-build/27631/3 "2019-08-21T13:41:20Z")

</div>

Hi Kevin,

I am using the ignition-maven plugin to build the module. When I run “Maven build…” i use “package” as the goals. Is that what you mean by packaging?

The resulting modl file only includes jar and compresses jars for client, common, and designer.

Bruce

---

<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 21, 2019, 2:36pm UTC](https://forum.inductiveautomation.com/t/how-to-include-a-dependency-jar-file-in-the-maven-modl-build/27631/4 "2019-08-21T14:36:53Z")

</div>

Take a look at the [example projects](https://github.com/inductiveautomation/ignition-sdk-examples) and make sure you have the same module layout and appropriate configurations in the ~~root~~ build submodule pom.xml for the ignition-maven-plugin.

---

<div class="post-metadata">

**Author:** ![bruce.burton](https://avatars.discourse-cdn.com/v4/letter/b/67e7ee/32.png) [@bruce.burton](https://forum.inductiveautomation.com/u/bruce.burton)\
**Post date:** [August 22, 2019, 12:56am UTC](https://forum.inductiveautomation.com/t/how-to-include-a-dependency-jar-file-in-the-maven-modl-build/27631/5 "2019-08-22T00:56:17Z")

</div>

Kevin,

Thanks for the info. I compared what I have in the build project’s pom.xml. It is pretty much the same as the scripting function example. The only difference I thought might impact it is the Maven plug in version. Mine is 1.0.8 and the example is using 1.1.0.

Do you know which example might be bundling a 3rd party jar file?

thanks,

Bruce

---

<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 22, 2019, 11:31am UTC](https://forum.inductiveautomation.com/t/how-to-include-a-dependency-jar-file-in-the-maven-modl-build/27631/6 "2019-08-22T11:31:16Z")

</div>

I don’t think there’s any examples that actually include one, but all you need to do is have a regular dependency entry.

Make sure it’s not provided scope. Try updating the version of ignition-maven-plugin to 1.1.0 as well.

If that doesn’t work and you want to upload your module somewhere I can take a quick look.

---

<div class="post-metadata">

**Author:** ![bruce.burton](https://avatars.discourse-cdn.com/v4/letter/b/67e7ee/32.png) [@bruce.burton](https://forum.inductiveautomation.com/u/bruce.burton)\
**Post date:** [August 22, 2019, 12:24pm UTC](https://forum.inductiveautomation.com/t/how-to-include-a-dependency-jar-file-in-the-maven-modl-build/27631/7 "2019-08-22T12:24:38Z")

</div>

Kevin,

I had to specify system scope in order to provide the path to the jar file. It seems like a pretty basic thing I’m trying to do and this is the first module I’ve ever built. Hopefully, you’ll see something obvious.

Can you email a link of where to upload the project? I can also put it on our cloud server for you, just email so I can provide you the link.

thanks,

Bruce

---

<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 22, 2019, 12:27pm UTC](https://forum.inductiveautomation.com/t/how-to-include-a-dependency-jar-file-in-the-maven-modl-build/27631/8 "2019-08-22T12:27:46Z")

</div>

Oooh, the system scope explains it. The plugin will not gather anything but compile-scoped dependencies for you. System scope is deprecated in Maven and not supported by the plugin.

---

<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 22, 2019, 12:34pm UTC](https://forum.inductiveautomation.com/t/how-to-include-a-dependency-jar-file-in-the-maven-modl-build/27631/9 "2019-08-22T12:34:35Z")

</div>

If you can’t get this jar from a repository, try this instead of system scope: [https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html](https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html)

---

<div class="post-metadata">

**Author:** ![bruce.burton](https://avatars.discourse-cdn.com/v4/letter/b/67e7ee/32.png) [@bruce.burton](https://forum.inductiveautomation.com/u/bruce.burton)\
**Post date:** [August 22, 2019, 2:16pm UTC](https://forum.inductiveautomation.com/t/how-to-include-a-dependency-jar-file-in-the-maven-modl-build/27631/10 "2019-08-22T14:16:24Z")

</div>

Kevin,

The jar file I’m referencing may be in a repository but I’d like to just use the local copy I have since that’s what we’ve tested. After installing the file in my local repository, I was able to change the dependency scope to ‘compile’. After rebuilding it still didn’t have the jar file in the modl file.

I also had the same dependency with ‘system’ scope in the client, common, and gateway projects. After changing all of these to ‘compile’ scope, it now included a jar file for my dependency. I’m going to play around and see if I can remove it from the build project. I’m also going to see if I can control the file name of the jar that is included. The 3rd party jar file is named ‘sapjco3.jar’ and the included one is named ‘jco-3.0.jar’.

Thanks for all of your help.

Bruce

---

<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 22, 2019, 2:23pm UTC](https://forum.inductiveautomation.com/t/how-to-include-a-dependency-jar-file-in-the-maven-modl-build/27631/11 "2019-08-22T14:23:58Z")

</div>

> [@bruce.burton](#):
>
> The 3rd party jar file is named ‘sapjco3.jar’ and the included one is named ‘jco-3.0.jar’.

This should be a consequence of the artifact id you used when installing into the local repository.

I'm afraid you won't be able to stop it from using the "$artifactId-$version.jar" format, which if I remember correctly for this particular jar is a problem because it needs to be called "sapjco3.jar" for some dumb reason.

see [Ignition changes JAR file names artificially](http://forum.inductiveautomation.com/t/ignition-changes-jar-file-names-artificially/17241)
