# Building new module in Maven

**URL:** <https://forum.inductiveautomation.com/t/building-new-module-in-maven/12100>\
**Category:** Module Development\
**Created:** [September 5, 2016, 7:08pm UTC](https://forum.inductiveautomation.com/t/building-new-module-in-maven/12100 "2016-09-05T19:08:09Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [September 5, 2016, 7:08pm UTC](https://forum.inductiveautomation.com/t/building-new-module-in-maven/12100/1 "2016-09-05T19:08:09Z")

</div>

Hi,

While creating new modl using Maven as per documentation [docs.inductiveautomation.com:84 ... ven+Plugin](https://docs.inductiveautomation.com:8443/display/SE/The+Ignition+Maven+Plugin) , when i create Executions section in pom.xml of the generated maven project, I get error Malformed XML ....unrecognized tag Executions.

Similarly while creating the configuration section from the example given on the page, there are no errors , but my module is a gateway module , and the example given is designer example so it not suitable for me! What changes I have to make or which other example should I copy it from and modify for my gateway module?

Sorry to say that its not properly explained or documented! I am trying to port my module from non-maven version of Ignition sdk to Maven the version! I am really frustrated!

Please help!

Prafull

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [September 6, 2016, 6:15am UTC](https://forum.inductiveautomation.com/t/building-new-module-in-maven/12100/2 "2016-09-06T06:15:32Z")

</div>

After creating the skeleton project in maven from Ignitionsdk archetype, when I try to build my models using maven \> package option, I get following error:

Non-parseable POM C:\Users\xxxxxxx\Documents\NetBeansProjects\gatewaycomm\pom.xml: Unrecognised tag: 'executions' (position: START\_TAG seen ...\r\n... @55:13) @ C:\Users\xxxxxxxx\Documents\NetBeansProjects\gatewaycomm\pom.xml, line 55, column 13 -\> [Help 2]

where line 55 is "executions"(marked in red).

```
    <repository>
        <id>thirdparty</id>
        <url>http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-thirdparty
        </url>
    </repository>
</repositories>

```

[color=#808000][/color]  
  
modlexecution  
package  
  
modl  
  
  
  
postexecution  
install  
  
post

what to make out of 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:** [September 6, 2016, 4:01pm UTC](https://forum.inductiveautomation.com/t/building-new-module-in-maven/12100/3 "2016-09-06T16:01:25Z")

</div>

The executions element should be inside the plugin element where you configure the ignition-maven-plugin.

This is clearly shown at both the end of the page you linked as well as in all of the example projects. Here’s a gateway-scoped example if you can’t extrapolate how to configure the plugin from a client/designer scope example: [github.com/inductiveautomation/ … ld/pom.xml](https://github.com/inductiveautomation/ignition-sdk-examples/blob/master/SimpleTagProviderExample/stp-build/pom.xml)

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [September 6, 2016, 6:08pm UTC](https://forum.inductiveautomation.com/t/building-new-module-in-maven/12100/4 "2016-09-06T18:08:56Z")

</div>

On changing the pom file (my module name is gatewaycomm) as per the page you pointed out, the build still fails giving error

"Failed to execute goal com.inductiveautomation.ignitionsdk:ignition-maven-plugin:1.0.5:modl (modlexecution) on project gatewaycomm-gateway: Execution modlexecution of goal com.inductiveautomation.ignitionsdk:ignition-maven-plugin:1.0.5:modl failed. NullPointerException -\> [Help 1]  
"

The modified pom for the gateway module is as follows: (I try to build with goal as "package", it tries to build till compile/test phases but finally gives the above error):

\<?xml version="1.0" encoding="UTF-8"?\>

4.0.0

```
<parent>
    <groupId>com.pramanj</groupId>
    <artifactId>gatewaycomm</artifactId>
    <version>1.0-SNAPSHOT</version>
</parent>

<artifactId>gatewaycomm-gateway</artifactId>

<dependencies>
    <dependency>
        <groupId>com.inductiveautomation.ignitionsdk</groupId>
        <artifactId>ignition-common</artifactId>
        <version>${ignition-sdk-version}</version>
        <type>pom</type>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>com.inductiveautomation.ignitionsdk</groupId>
        <artifactId>gateway-api</artifactId>
        <version>${ignition-sdk-version}</version>
        <type>pom</type>
        <scope>provided</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>com.inductiveautomation.ignitionsdk</groupId>
            <artifactId>ignition-maven-plugin</artifactId>
            <version>1.0.5</version>

            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>modl</goal>
                    </goals>
                </execution>
            </executions>

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

                <moduleId>com.pramanj.gatewaycomm</moduleId>
                <moduleName>gatewaycomm</moduleName>
                <moduleDescription>Provides communication with ARSCADA/RMSCADA/UNISEMS modules of PRAMANJ Technologies</moduleDescription>
                <moduleVersion>${project.version}</moduleVersion>
                <requiredIgnitionVersion>7.7.0</requiredIgnitionVersion>
                <requiredFrameworkVersion>6</requiredFrameworkVersion>
                <licenseFile></licenseFile>
                <documentationFile>doc/index.html</documentationFile>

                <depends></depends>

                <hooks>
                    <hook>
                        <scope>G</scope>
                        <hookClass>com.pramanj.gatewaycomm.GatewayHook</hookClass>
                    </hook>
                </hooks>
            </configuration>
        </plugin>
    </plugins>
</build>

```

---

<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:** [September 6, 2016, 6:53pm UTC](https://forum.inductiveautomation.com/t/building-new-module-in-maven/12100/5 "2016-09-06T18:53:14Z")

</div>

The ignition-maven-plugin is meant to be run in a dedicated build maven modules like the examples do. See if setting up a “gatewaycomm-build” project with just a pom.xml that configures ignition-maven-plugin, as the examples do, allows you to build.

---

<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:** [September 6, 2016, 6:57pm UTC](https://forum.inductiveautomation.com/t/building-new-module-in-maven/12100/6 "2016-09-06T18:57:06Z")

</div>

Another thing that may help: the version of ignition-maven-plugin used by all the examples is rather out of date. The latest release is 1.0.11.

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [September 7, 2016, 7:00am UTC](https://forum.inductiveautomation.com/t/building-new-module-in-maven/12100/7 "2016-09-07T07:00:56Z")

</div>

when we create maven project for Ignitionsdk archetypes, module skeleton is generated for 5 projects (gatewaycomm-build, gatewaycomm-common, gatewaycomm-client, gatewaycomm-designer, gatewaycomm-gateway) by default . Where as I am interested in ONLY gatewaycomm-gateway module.

Can I delete the maven projects "common, client & designer", leaving only "gatewaycomm-build, and gatewaycomm-gateway?")?

When I edited the build project's pom.xml that configures ignition-maven-plugin with version 1.0.11 I get following error:

Failed to execute goal on project gatewaycomm-build: Could not resolve dependencies for project com.pramanj:gatewaycomm-build:jar:1.0-SNAPSHOT: Failure to find com.pramanj:gatewaycomm-gateway:jar:1.0-SNAPSHOT in [nexus.inductiveautomation.com:80 ... n-releases](http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-releases) was cached in the local repository, resolution will not be reattempted until the update interval of releases has elapsed or updates are forced -\> [Help 1]

the pom for the build project is as follows:

\<?xml version="1.0" encoding="UTF-8"?\>

4.0.0

```
<parent>
    <artifactId>gatewaycomm</artifactId>
    <groupId>com.pramanj</groupId>
    <version>1.0-SNAPSHOT</version>
</parent>

<artifactId>gatewaycomm-build</artifactId>

<dependencies>
    <dependency>
        <groupId>com.pramanj</groupId>
        <artifactId>gatewaycomm-gateway</artifactId>
        <version>1.0-SNAPSHOT</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>com.inductiveautomation.ignitionsdk</groupId>
            <artifactId>ignition-maven-plugin</artifactId>
            <version>1.0.11</version>

            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>modl</goal>
                    </goals>
                </execution>
            </executions>

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

                <moduleId>com.pramanj.gatewaycomm</moduleId>
                <moduleName>gatewaycomm</moduleName>
                <moduleDescription>Module for communication with ARSCADA/RMSCADA/UNISEMS modules of PRAMANJ Technologies.</moduleDescription>
                <moduleVersion>1.0-SNAPSHOT</moduleVersion>
                <requiredIgnitionVersion>7.7.0</requiredIgnitionVersion>
                <requiredFrameworkVersion>6</requiredFrameworkVersion>

                <hooks>
                    <hook>
                        <scope>G</scope>
                        <hookClass>com.pramanj.gatewaycomm.GatewayHook</hookClass>
                    </hook>
                </hooks>

            </configuration>
        </plugin>
    </plugins>
</build>

```

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [September 7, 2016, 7:26am UTC](https://forum.inductiveautomation.com/t/building-new-module-in-maven/12100/8 "2016-09-07T07:26:43Z")

</div>

I though my module compiled with version 7.7.8 without maven, is working fine and serving my purpose of testing my modules with version 7.8.3 of Ignition , I am trying to migrate to maven version of the sdk so that I am uptodate with the sdk in future.

Hope I will succeed one day!

regards  
prafull

---

<div class="post-metadata">

**Author:** ![xasga](https://avatars.discourse-cdn.com/v4/letter/x/838e76/32.png) [@xasga](https://forum.inductiveautomation.com/u/xasga)\
**Post date:** [September 20, 2016, 2:19pm UTC](https://forum.inductiveautomation.com/t/building-new-module-in-maven/12100/9 "2016-09-20T14:19:40Z")

</div>

[quote="Pramanj"]when we create maven project for Ignitionsdk archetypes, module skeleton is generated for 5 projects (gatewaycomm-build, gatewaycomm-common, gatewaycomm-client, gatewaycomm-designer, gatewaycomm-gateway) by default . Where as I am interested in ONLY gatewaycomm-gateway module.

Can I delete the maven projects "common, client & designer", leaving only "gatewaycomm-build, and gatewaycomm-gateway?")?[/quote]

I deleted the ones I didn't want, with no trouble.

> [@Pramanj](#):
>
> When I edited the build project's pom.xml that configures ignition-maven-plugin with version 1.0.11 I get following error:
> 
> Failed to execute goal on project gatewaycomm-build: Could not resolve dependencies for project com.pramanj:gatewaycomm-build:jar:1.0-SNAPSHOT: Failure to find com.pramanj:gatewaycomm-gateway:jar:1.0-SNAPSHOT in [nexus.inductiveautomation.com:80 ... n-releases](http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-releases) was cached in the local repository, resolution will not be reattempted until the update interval of releases has elapsed or updates are forced -\> [Help 1]

Check the version number of your jar. I found that I had to use the three number format: x.y.z  
Somewhere in the Ignition docs it does say that three numbers are required.

If you are using IntelliJ IDEA, you may need to wipe the project cache, or reimport the project, after making a change to the project structure. I haven't had to do this in quite a while, though.

Make sure the import statement in your class file matches the path in the file system.

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [October 14, 2016, 3:11pm UTC](https://forum.inductiveautomation.com/t/building-new-module-in-maven/12100/10 "2016-10-14T15:11:08Z")

</div>

Hi,

I created a Maven project "GCM" from Inginition-C-D-G-Archetype.

1. Just building the blank Client-Designer-Gateway & COMMON, the Client & Designer projects fail to build, whereas the common & gateway succeeds. (I just need the gateway module right now so its OK for me, but why should the default blank projects fail to compile and build!).

2.0 I deleted the D-C and common from GCM-build projects POM file leaving only Gateway module and tried to build the GCM-build project. It gives the following error

[color=#0000FF]"Scanning for projects...

* * *

## Building GCM-build 1.0-SNAPSHOT

Downloading: [nexus.inductiveautomation.com:80 ... tadata.xml](http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-snapshots/com/pramanj/GCM-gateway/1.0-SNAPSHOT/maven-metadata.xml)

Downloading: [nexus.inductiveautomation.com:80 ... tadata.xml](http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-snapshots/com/pramanj/GCM/1.0-SNAPSHOT/maven-metadata.xml)

Downloading: [nexus.inductiveautomation.com:80 ... APSHOT.pom](http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-snapshots/com/pramanj/GCM/1.0-SNAPSHOT/GCM-1.0-SNAPSHOT.pom)

* * *

## BUILD FAILURE

## Total time: 3.280s Finished at: Fri Oct 14 20:14:40 IST 2016 Final Memory: 6M/15M

Failed to execute goal on project GCM-build: Could not resolve dependencies for project com.pramanj:GCM-build:jar:1.0-SNAPSHOT: Failed to collect dependencies for [com.pramanj:GCM-gateway:jar:1.0-SNAPSHOT (compile)]: Failed to read artifact descriptor for com.pramanj:GCM-gateway:jar:1.0-SNAPSHOT: Failure to find com.pramanj:GCM:pom:1.0-SNAPSHOT in [nexus.inductiveautomation.com:80 ... n-releases](http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-releases) was cached in the local repository, resolution will not be reattempted until the update interval of releases has elapsed or updates are forced -\> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.  
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:  
[Help 1] [cwiki.apache.org/confluence/disp ... nException](http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException)"[/color]

1. Why is it failing to build the .modl file for me, when the GCM-gateway project is compiling successfully! Whereas the sample projects given by Ignition are creating the .modl files! Do I have to register my project in Nexus repository?

The GCM-build project's POM file is edited (deleting the D-C-Common projects) as follows:

[color=#0000FF]

\<?xml version="1.0" encoding="UTF-8"?\>

4.0.0

```
<parent>
    <artifactId>GCM</artifactId>
    <groupId>com.pramanj</groupId>
    <version>1.0-SNAPSHOT</version>
</parent>

<artifactId>GCM-build</artifactId>

<dependencies>
    <dependency>
        <groupId>com.pramanj</groupId>
        <artifactId>GCM-gateway</artifactId>
        <version>1.0-SNAPSHOT</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>com.inductiveautomation.ignitionsdk</groupId>
            <artifactId>ignition-maven-plugin</artifactId>
            <version>1.0.8</version>

            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>modl</goal>
                    </goals>
                </execution>
            </executions>

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

                <moduleId>com.pramanj.GCM</moduleId>
                <moduleName>${project.parent.name}</moduleName>
                <moduleDescription>${project.description}</moduleDescription>
                <moduleVersion>1.0-SNAPSHOT</moduleVersion>
                <requiredIgnitionVersion>7.7.0</requiredIgnitionVersion>
                <requiredFrameworkVersion>6</requiredFrameworkVersion>

                <hooks>
                    <hook>
                        <scope>G</scope>
                        <hookClass>com.pramanj.gcm.GatewayHook</hookClass>
                    </hook>
                </hooks>

            </configuration>
        </plugin>
    </plugins>
</build>

```

[/color]
1. The GCM-gateway projects POM file is as follows:

[color=#0000FF]\<?xml version="1.0" encoding="UTF-8"?\>  
  
4.0.0

```
<parent>
    <artifactId>GCM</artifactId>
    <groupId>com.pramanj</groupId>
    <version>1.0-SNAPSHOT</version>
</parent>

<artifactId>GCM-gateway</artifactId>

<dependencies>
    <dependency>
        <groupId>com.inductiveautomation.ignitionsdk</groupId>
        <artifactId>ignition-common</artifactId>
        <version>${ignition-sdk-version}</version>
        <type>pom</type>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>com.inductiveautomation.ignitionsdk</groupId>
        <artifactId>gateway-api</artifactId>
        <version>${ignition-sdk-version}</version>
        <type>pom</type>
        <scope>provided</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.2</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>
</build>

```

[/color]

---

<div class="post-metadata">

**Author:** ![chi](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@chi](https://forum.inductiveautomation.com/u/chi)\
**Post date:** [October 14, 2016, 8:05pm UTC](https://forum.inductiveautomation.com/t/building-new-module-in-maven/12100/11 "2016-10-14T20:05:35Z")

</div>

Did you try to build your parent project? The parent project will build your artifacts in the correct order, with the ‘build’ project as the the last step.

The maven project structure is a bit misleading. The ‘build’ project can not be build on its own, because it depends on its parent project.

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [October 15, 2016, 11:34am UTC](https://forum.inductiveautomation.com/t/building-new-module-in-maven/12100/12 "2016-10-15T11:34:23Z")

</div>

I didn't get it! I created a new project GCM from Ignition Archetypes first, then it generated following projects:  
GCM-build  
GCM-client  
GCM-common  
GCM-designer  
GCM-gateway  
GCM-Ignition Module

I built them in reverse order. The GCM-gateway and GCM-common built successfully, where as client and designer failed, but I need only gateway module. So I deleted the all other projects except gateway from the GCM-build projects POM file. (I have included the two POMs in my last post). There i get the error I have mentioned.

Which is the parent project in the above? The GCM-gateway project?

Please enlighten me, I am stuck for past few days!

Prafull

---

<div class="post-metadata">

**Author:** ![chi](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@chi](https://forum.inductiveautomation.com/u/chi)\
**Post date:** [October 15, 2016, 12:38pm UTC](https://forum.inductiveautomation.com/t/building-new-module-in-maven/12100/13 "2016-10-15T12:38:04Z")

</div>

I don’t know your project structure as it depends on the environment you are using. In general, there should be a parent pom file in the parent directory of your separate sub-projects. This is the that is referenced in the project pom’s.  
You start the build process on this parent pom. Maven will analyze the dependencies and build the projects in the correct order.

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [October 15, 2016, 12:58pm UTC](https://forum.inductiveautomation.com/t/building-new-module-in-maven/12100/14 "2016-10-15T12:58:23Z")

</div>

I thought the GCM-gateway is the parent and starting point for my project, where I will stick-in my module classes and files, like in the previous version of SDK there was a module skeleton creator jar that created the main startup/shutdown classes where I inserted my module files.

I don't understand what more parent project requires to be built and how! This is really frustrating, in the previous version I could simply get started with skeleton module created by the tool, here I don't know what's going on!

Please help me out.

regards  
prafull

---

<div class="post-metadata">

**Author:** ![chi](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@chi](https://forum.inductiveautomation.com/u/chi)\
**Post date:** [October 15, 2016, 6:59pm UTC](https://forum.inductiveautomation.com/t/building-new-module-in-maven/12100/15 "2016-10-15T18:59:14Z")

</div>

Ok, i will try to make things a bit clearer.

First, i recommend reading [Maven by Example](http://books.sonatype.com/mvnex-book/reference/index.html) book.

Now a concrete example:  
I use the Eclipse IDE. Depending on your IDE, things may look different!  
[ul]Create a new Maven Project (make sure to create a Project, not a Module) ans select the com.inductiveautomation.ignitionsdk:client-designer-gateway-archetype (I used Version 1.0.3)  
[/ul]  
[ul]Eclipse asks for archetype parameters in the next dialog. I used Group Id: ‘com.chitek.ignition’, Artifact Id: ‘maven-example’, Version ‘0.0.1-SNAPSHOT’[/ul]

Eclipse then creates the maven project. The result is shown in the screenshot. The left side shows the structure in Eclipse, the corresponding directory structure is shown on the right. The created project is a ‘Maven Multi-Module-Project’. See [here](http://books.sonatype.com/mvnex-book/reference/multimodule.html) for more detailed information about this kind of project. Please notice that the word ‘Module’ has different meanings in Maven and Ignition.  
[attachment=4]StructureEclipse.jpg[/attachment]  
To build this project in Eclipse, right click on the parent POM (highlighted in the screenshot) and select ‘Run As -\> Maven Build …’. Eclipse then asks for the goals, to compile all modules and build the modl file choose ‘clean package’. The clean goal deletes the results from earlier builds, the package goal starts the Ignition Maven Plugin to create the .modl file (clean is optional, but i prefer a clean workspace before compiling). ‘package’ depends on ‘compile’, so you don’t have to define the ‘compile’ goal explicitly. See [here](http://books.sonatype.com/mvnex-book/reference/simple-project-sect-simple-core.html) for more details about build phases and goals. If you are using unit tests (i hope you do 😉) the goal ‘test’ would compile your sources and run the test without packaging the modl file.  
On my system i can build the project at this point without problems, the console output is shown below. (Trying to build the maven.example.build fails because of missing dependencies. I am not a maven expert, so i simply accept the fact that a multi module project has to be built from the parent POM.)  
[attachment=3]FirstBuildResult.jpg[/attachment]

The next screenshot shows an excerpt of the parent POM and the build module POM. It should give you an impression about the mutual references.  
[attachment=2]Pom\_Paren\_Module.jpg[/attachment]  
To remove modules from your project, you have to remove the entries in the parent pom and the sections in all remaining module poms.The screenshot shows the modified pom’s with a gateway module only (Remember: module means a Maven module). I commented the unused sections instead of deleting them. The second screenshot shows the build result.  
[attachment=1]Pom\_Modified.jpg[/attachment]  
[attachment=0]SecondBuildResult.jpg[/attachment]

Hope this helps, regards,  
Carsten

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [October 17, 2016, 4:34am UTC](https://forum.inductiveautomation.com/t/building-new-module-in-maven/12100/16 "2016-10-17T04:34:19Z")

</div>

Hi Carsten,  
Thanks a lot for your post. Its great to know there are such wonderful helpful people like you in the world, who make the world a better place to live!

I am going thru the book link. However there a few issues in following your step by step instructions, first I am using Net-beans IDE, second, the attachments are not accessible to me (protected), third I tried to create a fresh project using ECLIPSE, but it couldn't find the Ignition Archetypes , it gave some error so I abandoned. But will continue to explore.

In my NetBeans IDE, I created the GCM project using the Ignition:client-designer-gateway-archetype and it does generate the Maven parent project "GCM Ignition Module" as well as the GCM-common, GCM-clinet, GCM-designer, GCM-gateway and GCM-build modules. I deleted the GCM-common, client, designer modules and retained CGM-build and CGM-gateway modules. Then I build the "GCM Ignition Module" parent project it builds successfully giving following msg:

[color=#0000FF]------------------------------------------------------------------------  
Reactor Summary:

## GCM Ignition Module ............................... SUCCESS [0.498s] GCM-gateway ....................................... SUCCESS [3.767s] GCM-build ......................................... SUCCESS [0.745s]

BUILD SUCCESS  
------------------------------------------------------------------------[/color]

Then I build the CGM-gateway module which contains my class files for my Ignition module. It builds successfully. Finally when I build GCM-build module which fails giving following error:

[color=#0000FF]Failed to execute goal com.inductiveautomation.ignitionsdk:ignition-maven-plugin:1.0.8:modl (default) on project GCM-build: Execution default of goal com.inductiveautomation.ignitionsdk:ignition-maven-plugin:1.0.8:modl failed. NullPointerException -\> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.  
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:  
[Help 1] [cwiki.apache.org/confluence/disp ... nException](http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException)

[/color]

POM for parent "GCM Ignition Module" is as follows:

[color=#400000]\<?xml version="1.0" encoding="UTF-8"?\>  
  
4.0.0

```
<groupId>com.pramanj</groupId>
<artifactId>GCM</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>

<name>GCM Ignition Module</name>
<description>GCM Ignition Module</description>

<properties>
    <ignition-sdk-version>7.7.5</ignition-sdk-version>
</properties>

<modules>
    <module>GCM-build</module>
    <module>GCM-gateway</module>
</modules>

<pluginRepositories>
    <pluginRepository>
        <id>releases</id>
        <url>http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-releases</url>
    </pluginRepository>
</pluginRepositories>

<repositories>
    <repository>
        <id>releases</id>
        <url>http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-releases</url>
    </repository>

    <repository>
        <id>snapshots</id>
        <url>http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-snapshots</url>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
        </snapshots>
    </repository>

    <repository>
        <id>thirdparty</id>
        <url>http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-thirdparty
        </url>
    </repository>
</repositories>

```

[/color]

POM for CGM-gateway module is as follows:

[color=#408000]\<?xml version="1.0" encoding="UTF-8"?\>  
  
4.0.0

```
<parent>
    <artifactId>GCM</artifactId>
    <groupId>com.pramanj</groupId>
    <version>1.0-SNAPSHOT</version>
</parent>

<artifactId>GCM-gateway</artifactId>

<dependencies>
    <dependency>
        <groupId>com.inductiveautomation.ignitionsdk</groupId>
        <artifactId>ignition-common</artifactId>
        <version>${ignition-sdk-version}</version>
        <type>pom</type>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>com.inductiveautomation.ignitionsdk</groupId>
        <artifactId>gateway-api</artifactId>
        <version>${ignition-sdk-version}</version>
        <type>pom</type>
        <scope>provided</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.2</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>
</build>

```

[/color]

POM for GCM-build module is as follows:

[color=#408000]\<?xml version="1.0" encoding="UTF-8"?\>  
  
4.0.0

```
<parent>
    <artifactId>GCM</artifactId>
    <groupId>com.pramanj</groupId>
    <version>1.0-SNAPSHOT</version>
</parent>

<artifactId>GCM-build</artifactId>

<dependencies>
    <dependency>
        <groupId>com.pramanj</groupId>
        <artifactId>GCM-gateway</artifactId>
        <version>1.0-SNAPSHOT</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>com.inductiveautomation.ignitionsdk</groupId>
            <artifactId>ignition-maven-plugin</artifactId>
            <version>1.0.8</version>

            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>modl</goal>
                    </goals>
                </execution>
            </executions>

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

                <moduleId>com.pramanj.GCM</moduleId>
                <moduleName>${project.parent.name}</moduleName>
                <moduleDescription>${project.description}</moduleDescription>
                <moduleVersion>1.0-SNAPSHOT</moduleVersion>
                <requiredIgnitionVersion>7.7.0</requiredIgnitionVersion>
                <requiredFrameworkVersion>6</requiredFrameworkVersion>

                <hooks>
                    <hook>
                        <scope>G</scope>
                        <hookClass>com.pramanj.gcm.GatewayHook</hookClass>
                    </hook>
                </hooks>

            </configuration>
        </plugin>
    </plugins>
</build>

```

[/color]

I don't know what's going wrong! I am getting stuck and fed up, by can't give up. Will appreciate your help, using netbeans example if possible!

Prafull

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [October 17, 2016, 5:21am UTC](https://forum.inductiveautomation.com/t/building-new-module-in-maven/12100/17 "2016-10-17T05:21:30Z")

</div>

Wait a minute! I think its working! When I build the "GCM Ignition Module" main project, it succeeds, and I should stop there! When I check the GCM-build module (sub-project) target folder, it already shows the GCM-build-1.0-SNAPSHOT.jar and GCM-Ignition-Module-unsigned.modl files there!

Looks like there is no need of separately building the sub-projects (modules) after the main project is built successfully! I was trying to build the sub-projects as well, after building the main project, and thats where I used to get error!

Eureka!

Let me see it the .modl works with ignition now!

Thanks a lot all for the patience and help!

Best Regards  
Prafull

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [October 17, 2016, 5:55am UTC](https://forum.inductiveautomation.com/t/building-new-module-in-maven/12100/18 "2016-10-17T05:55:37Z")

</div>

Yes, the modl is installing in Ignition (only thing is the the version number should not be the default name 1.0-SNAPSHOT, its should be changed to n.n.n everywhere in all the POM files, otherwise it gives error on reading XML!

Just on thing is that I am getting some wicket/jetty errors after installation, I hope the modules works.

INFO | jvm 1 | 2016/10/17 11:13:28 | 2016-10-17 11:13:28.743:WARN:oejs.ServletHandler:qtp2096318-4765: /main/web/config/conf.modules  
INFO | jvm 1 | 2016/10/17 11:13:28 | org.apache.wicket.protocol.http.servlet.ResponseIOException: org.eclipse.jetty.io.EofException  
INFO | jvm 1 | 2016/10/17 11:13:28 | at org.apache.wicket.protocol.http.servlet.ServletWebResponse.flush(ServletWebResponse.java:268)  
INFO | jvm 1 | 2016/10/17 11:13:28 | at org.apache.wicket.protocol.http.HeaderBufferingWebResponse.flush(HeaderBufferingWebResponse.java:92)  
INFO | jvm 1 | 2016/10/17 11:13:28 | at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:198)  
INFO | jvm 1 | 2016/10/17 11:13:28 | at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:245)  
INFO | jvm 1 | 2016/10/17 11:13:28 | at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1668)  
INFO | jvm 1 | 2016/10/17 11:13:28 | at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)  
INFO | jvm 1 | 2016/10/17 11:13:28 | at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)  
INFO | jvm 1 | 2016/10/17 11:13:28 | at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)  
INFO | jvm 1 | 2016/10/17 11:13:28 | at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)  
INFO | jvm 1 | 2016/10/17 11:13:28 | at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1160)  
INFO | jvm 1 | 2016/10/17 11:13:28 | at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)  
INFO | jvm 1 | 2016/10/17 11:13:28 | at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)  
INFO | jvm 1 | 2016/10/17 11:13:28 | at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1092)  
INFO | jvm 1 | 2016/10/17 11:13:28 | at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)  
INFO | jvm 1 | 2016/10/17 11:13:28 | at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)  
INFO | jvm 1 | 2016/10/17 11:13:28 | at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)  
INFO | jvm 1 | 2016/10/17 11:13:28 | at org.eclipse.jetty.server.Server.handle(Server.java:518)  
INFO | jvm 1 | 2016/10/17 11:13:28 | at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)  
INFO | jvm 1 | 2016/10/17 11:13:28 | at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:244)  
INFO | jvm 1 | 2016/10/17 11:13:28 | at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)  
INFO | jvm 1 | 2016/10/17 11:13:28 | at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)  
INFO | jvm 1 | 2016/10/17 11:13:28 | at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)  
INFO | jvm 1 | 2016/10/17 11:13:28 | at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:246)  
INFO | jvm 1 | 2016/10/17 11:13:28 | at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:156)  
INFO | jvm 1 | 2016/10/17 11:13:28 | at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)  
INFO | jvm 1 | 2016/10/17 11:13:28 | at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)  
INFO | jvm 1 | 2016/10/17 11:13:28 | at java.lang.Thread.run(Thread.java:745)

---

<div class="post-metadata">

**Author:** ![chi](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@chi](https://forum.inductiveautomation.com/u/chi)\
**Post date:** [October 17, 2016, 11:56am UTC](https://forum.inductiveautomation.com/t/building-new-module-in-maven/12100/19 "2016-10-17T11:56:36Z")

</div>

Glad you got it working now 🙂

[quote]I tried to create a fresh project using ECLIPSE, but it couldn't find the Ignition Archetypes , it gave some error so I abandoned[/quote]You have to update the archetype catalog manually in Eclipse. The url is [i][http://repo1.maven.org/maven2/archetype-catalog.xml[/i]](http://repo1.maven.org/maven2/archetype-catalog.xml%5B/i%5D). Maybe Netbeans does this automatically in the beackground.

> [@](#):
>
> Looks like there is no need of separately building the sub-projects (modules) after the main project is built successfully!

![:thumb_left:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/e26afb081ddde6df016df6ee49159cf56aaca688.gif ":thumb\_left:") Yes, that the purpose of a multi-module project.

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [October 24, 2016, 11:47am UTC](https://forum.inductiveautomation.com/t/building-new-module-in-maven/12100/20 "2016-10-24T11:47:10Z")

</div>

Why is the size of .modl file created using maven and using Ant and old sdknwithout maven so different? (\<100 kb in previous version of .modl and \>3.5Mb with Maven?). Though both Install on Ignition and work fine!  
Any clues? Hope everything is OK?

regards  
prafull

[Next page](https://forum.inductiveautomation.com/t/building-new-module-in-maven/12100.md?page=2)
