# 'mvn install', DeveloperModuleLoadingServlet, dependencies

**URL:** <https://forum.inductiveautomation.com/t/mvn-install-developermoduleloadingservlet-dependencies/14002>\
**Category:** Module Development\
**Created:** [April 8, 2017, 11:21am UTC](https://forum.inductiveautomation.com/t/mvn-install-developermoduleloadingservlet-dependencies/14002 "2017-04-08T11:21:30Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpderbec](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@mpderbec](https://forum.inductiveautomation.com/u/mpderbec)\
**Post date:** [April 8, 2017, 11:21am UTC](https://forum.inductiveautomation.com/t/mvn-install-developermoduleloadingservlet-dependencies/14002/1 "2017-04-08T11:21:30Z")

</div>

The ‘mvn install’ piece that posts my freshly-compiled module to a running gateway really cuts down on the debug cycle, as you don’t have to kill the gateway and restart (which takes more than a minute on my dev machine).

Unfortunately, when I use this method, the gateway can not find second-order dependencies of my module, I get NoClassDefFoundErrors. (Second-order means a dependency of one of my dependencies.)

When I execute ‘mvn install’, the artifacts that are copied (shown in the build output starting with “copying dependency artifact:”) do not include second-order dependencies. However, ‘mvn package’ does include them.

I’m using Ignition 7.9.1 and ignition-maven-plugin 1.0.9 (I also tried 1.0.12).

Here’s my ignition-maven-plugin config:

```auto
            <plugin>
                <groupId>com.inductiveautomation.ignitionsdk</groupId>
                <artifactId>ignition-maven-plugin</artifactId>
                <version>1.0.9</version>

                <executions>
                    <execution>
                        <id>package-modl</id>
                        <phase>package</phase>
                        <goals>
                            <goal>modl</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>post-module</id>
                        <phase>install</phase>
                        <goals>
                            <goal>modl</goal>
                            <goal>post</goal>
                        </goals>
                    </execution>
                </executions>

                <configuration>
                    <projectScopes>
                        <projectScope>
                            <name>sqim-gateway</name>
                            <scope>G</scope>
                        </projectScope>

                        <projectScope>
                            <name>sqim-designer</name>
                            <scope>D</scope>
                        </projectScope>

                        <projectScope>
                            <name>sqim-client</name>
                            <scope>CD</scope>
                        </projectScope>
                    </projectScopes>

                    <moduleId>com.seeq.ignition</moduleId>
                    <moduleName>Seeq</moduleName>
                    <moduleDescription>Trending, visualizations, calculations, analytics, cleansing, modeling,
                        advanced monitoring and reporting.
                    </moduleDescription>
                    <moduleVersion>${project.version}</moduleVersion>
                    <requiredIgnitionVersion>7.9.0</requiredIgnitionVersion>
                    <requiredFrameworkVersion>7</requiredFrameworkVersion>
                    <!--<licenseFile>license.html</licenseFile>-->
                    <!--<documentationFile>doc/index.html</documentationFile>-->

                    <depends>
                        <depend>
                            <scope>G</scope>
                            <moduleId>xopc</moduleId>
                        </depend>

                        <depend>
                            <scope>D</scope>
                            <moduleId>fpmi</moduleId>
                        </depend>
                    </depends>

                    <hooks>
                        <hook>
                            <scope>G</scope>
                            <hookClass>com.seeq.ignition.gateway.GatewayHook</hookClass>
                        </hook>

                        <hook>
                            <scope>D</scope>
                            <hookClass>com.seeq.ignition.designer.DesignerHook</hookClass>
                        </hook>
                    </hooks>
                </configuration>
            </plugin>
```

---

<div class="post-metadata">

**Author:** ![mpderbec](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@mpderbec](https://forum.inductiveautomation.com/u/mpderbec)\
**Post date:** [April 8, 2017, 11:39am UTC](https://forum.inductiveautomation.com/t/mvn-install-developermoduleloadingservlet-dependencies/14002/2 "2017-04-08T11:39:43Z")

</div>

More info:

Adding the “post” goal to the “package” phase causes ‘mvn package’ to post the module to the gateway with the correct dependencies. So it’s a reasonable workaround, but it does mean that you have to manually alter your pom file when you’re iterating in development, and then revert it before committing (since you don’t want the build machine to try to post to a non-existent gateway).

So, it seems there still needs to be a fix made somewhere…

---

<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:** [April 8, 2017, 1:48pm UTC](https://forum.inductiveautomation.com/t/mvn-install-developermoduleloadingservlet-dependencies/14002/3 "2017-04-08T13:48:04Z")

</div>

Change the version of ignition-maven-plugin to 1.0.12 and try again. I know we fixed this bug once already, hopefully there hasn’t been a regression.

---

<div class="post-metadata">

**Author:** ![mpderbec](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@mpderbec](https://forum.inductiveautomation.com/u/mpderbec)\
**Post date:** [April 8, 2017, 2:46pm UTC](https://forum.inductiveautomation.com/t/mvn-install-developermoduleloadingservlet-dependencies/14002/4 "2017-04-08T14:46:04Z")

</div>

Hi Kevin, thanks for the response.

I tried 1.0.12 again to be sure-- it still has the problem.

---

<div class="post-metadata">

**Author:** ![mpderbec](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@mpderbec](https://forum.inductiveautomation.com/u/mpderbec)\
**Post date:** [July 26, 2017, 8:37pm UTC](https://forum.inductiveautomation.com/t/mvn-install-developermoduleloadingservlet-dependencies/14002/5 "2017-07-26T20:37:01Z")

</div>

Hey any update on this issue? It’s a bit of a pain to have to remember to modify the POM file when debugging…

---

<div class="post-metadata">

**Author:** ![Mau89](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mau89/32/20680_2.png) [@Mau89](https://forum.inductiveautomation.com/u/Mau89)\
**Post date:** [September 21, 2017, 12:31pm UTC](https://forum.inductiveautomation.com/t/mvn-install-developermoduleloadingservlet-dependencies/14002/6 "2017-09-21T12:31:27Z")

</div>

I have the same problem

---

<div class="post-metadata">

**Author:** ![Mau89](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mau89/32/20680_2.png) [@Mau89](https://forum.inductiveautomation.com/u/Mau89)\
**Post date:** [September 21, 2017, 1:16pm UTC](https://forum.inductiveautomation.com/t/mvn-install-developermoduleloadingservlet-dependencies/14002/7 "2017-09-21T13:16:50Z")

</div>

I have resolved adding this parmeter in ignition.conf

> wrapper.java.additional.11=-Dia.developer.moduleupload=true

---

<div class="post-metadata">

**Author:** ![mpderbec](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@mpderbec](https://forum.inductiveautomation.com/u/mpderbec)\
**Post date:** [September 28, 2017, 3:35pm UTC](https://forum.inductiveautomation.com/t/mvn-install-developermoduleloadingservlet-dependencies/14002/8 "2017-09-28T15:35:38Z")

</div>

Mau89, I don’t believe it’s the same problem. Adding the parameter you mention allows you to upload (period), but the bug I’m reporting is specific to second-order dependencies being left out during posting when using _mvn install_.

I’m using the _ignition-maven-plugin_ version 1.0.12 and it still has the problem.

---

<div class="post-metadata">

**Author:** ![brett](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@brett](https://forum.inductiveautomation.com/u/brett)\
**Post date:** [July 30, 2019, 10:54pm UTC](https://forum.inductiveautomation.com/t/mvn-install-developermoduleloadingservlet-dependencies/14002/9 "2019-07-30T22:54:59Z")

</div>

Reviving this topic since it seems there was no resolution, and I am seeing the same behavior in version 1.1.0 of the plugin as described above for versions 1.0.9 and 1.0.12. When using `mvn install`, only directly-declared dependencies from the gateway project, and the gateway project itself, are included in the module, and **none of the transitive dependencies are included**. When using `mvn package` or `mvn verify`, transitive dependencies are included as expected.

Here's an example. I have a project that is structured in the same way as one of the example projects:

```auto
parent-project <-- top-level "parent" POM
|-- my-build <-- "build" POM with ignition-maven-plugin:1.1.0
|-- my-gateway <-- "gateway" project POM with my source

```

These are the non-Ignition dependencies declared in `my-gateway`:

```auto
org.apache.kafka:kafka-clients:2.2.0
com.fasterxml.jackson.core:jackson-databind:2.9.9
com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.9

```

Running Maven on `parent-project` results in building `my-gateway` and then `my-build` as expected. However, when `ignition-maven-plugin` is invoked in `my-build`, it has different behavior depending on the Maven phase requested.

> **`parent-project $`** `mvn clean install`
> 
> ```auto
> ...
> [INFO] copying g artifacts
> [INFO] copying dependency artifact: jackson-datatype-jsr310-2.9.9.jar
> [INFO] copying dependency artifact: my-gateway-1.2.0.jar
> [INFO] copying dependency artifact: jackson-databind-2.9.9.jar
> [INFO] copying dependency artifact: kafka-clients-2.2.0.jar
> ...
> 
> ```

Using `install`, only the dependencies directly declared in the POM of my gateway project, and the gateway project itself, were included.

> **`parent-project $`** `mvn clean package`  
> or  
> **`parent-project $`** `mvn clean verify`
> 
> ```auto
> ...
> INFO] copying g artifacts
> [INFO] copying dependency artifact: slf4j-api-1.7.25.jar
> [INFO] copying dependency artifact: jackson-datatype-jsr310-2.9.9.jar
> [INFO] copying dependency artifact: lz4-java-1.5.0.jar
> [INFO] copying dependency artifact: jackson-core-2.9.9.jar
> [INFO] copying dependency artifact: my-gateway-1.2.0.jar
> [INFO] copying dependency artifact: zstd-jni-1.3.8-1.jar
> [INFO] copying dependency artifact: jackson-databind-2.9.9.jar
> [INFO] copying dependency artifact: jackson-annotations-2.9.0.jar
> [INFO] copying dependency artifact: kafka-clients-2.2.0.jar
> [INFO] copying dependency artifact: snappy-java-1.1.7.2.jar
> 
> ```

Using `package` or `verify`, the declared dependencies **and their transitive dependencies** have been included, as well as the gateway project itself.

Without the transitive dependencies, the module of course does not work. Looks like there could be a regression if this behavior has been fixed before.

---

<div class="post-metadata">

**Author:** ![mpderbec](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@mpderbec](https://forum.inductiveautomation.com/u/mpderbec)\
**Post date:** [July 30, 2019, 11:11pm UTC](https://forum.inductiveautomation.com/t/mvn-install-developermoduleloadingservlet-dependencies/14002/10 "2019-07-30T23:11:02Z")

</div>

FWIW I am also still experiencing the same problem with the latest version of the Maven 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:** [July 30, 2019, 11:17pm UTC](https://forum.inductiveautomation.com/t/mvn-install-developermoduleloadingservlet-dependencies/14002/11 "2019-07-30T23:17:02Z")

</div>

This hasn’t really been high enough priority to ever dig into. We looked at it real quick a long time ago and got nowhere.

I’ve been meaning to open source `ignition-maven-plugin` for a while now… I’ll try to get around to it and then if this issue is really important to you then you can try to fix it yourself 🙂

---

<div class="post-metadata">

**Author:** ![brett](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@brett](https://forum.inductiveautomation.com/u/brett)\
**Post date:** [July 31, 2019, 1:51am UTC](https://forum.inductiveautomation.com/t/mvn-install-developermoduleloadingservlet-dependencies/14002/12 "2019-07-31T01:51:13Z")

</div>

That sounds good to me. Maven always was kind of a mysterious black box type of thing to me, making it hard to figure out what’s going on when something goes wrong. Having a closed-source plugin inside of it is like nested black boxes. 🙂

If this could be made part of the SDK, I’d dig in and try to fix the problem so as to save the next person the hours of head-scratching that I went through. Thanks for working to open it up!

---

<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:** [July 31, 2019, 3:17pm UTC](https://forum.inductiveautomation.com/t/mvn-install-developermoduleloadingservlet-dependencies/14002/13 "2019-07-31T15:17:05Z")

</div>

Et voila: [https://github.com/inductiveautomation/ignition-maven-plugin](https://github.com/inductiveautomation/ignition-maven-plugin)

---

<div class="post-metadata">

**Author:** ![brett](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@brett](https://forum.inductiveautomation.com/u/brett)\
**Post date:** [July 31, 2019, 3:52pm UTC](https://forum.inductiveautomation.com/t/mvn-install-developermoduleloadingservlet-dependencies/14002/14 "2019-07-31T15:52:14Z")

</div>

Thanks, that’s great! I’ll take a look at it this week and see if I can spot the transitive dependencies issue (assuming someone else doesn’t find it first!).

---

<div class="post-metadata">

**Author:** ![cody.tamaki](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@cody.tamaki](https://forum.inductiveautomation.com/u/cody.tamaki)\
**Post date:** [October 21, 2020, 7:10pm UTC](https://forum.inductiveautomation.com/t/mvn-install-developermoduleloadingservlet-dependencies/14002/15 "2020-10-21T19:10:55Z")

</div>

I’m trying to take a look at this because I seem to be having the same issue. I’ve plugged in IntelliJ to debug this, and I’ve confirmed that the IgnitionModlMojo class is executing during the Package phase (checked by injecting the maven ExecutionPhase into the class) for both mvn package and mvn install, but for whatever reason the MavenProject is returning an empty set of artifacts…

Would it be worth upgrading those maven-plugin dependencies to the newest version and debugging from there?
