# Overriding gatewayAddress in Maven Build

**URL:** <https://forum.inductiveautomation.com/t/overriding-gatewayaddress-in-maven-build/70755>\
**Category:** Module Development\
**Created:** [March 7, 2023, 10:47pm UTC](https://forum.inductiveautomation.com/t/overriding-gatewayaddress-in-maven-build/70755 "2023-03-07T22:47:51Z")\
**Posts on this page:** 3\
**Page:** 1

<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:** [March 7, 2023, 10:47pm UTC](https://forum.inductiveautomation.com/t/overriding-gatewayaddress-in-maven-build/70755/1 "2023-03-07T22:47:52Z")

</div>

This is probably a question for StackOverflow, but is there a way to override the property in the ignition-maven-plugin so that I have it install to a different gateway address after it compiles?

I want to leave the default as localhost but I use a VM to test modules when I'm in my office and don't want to have to update the pom file because I forget to revert it before committing...

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 7, 2023, 11:07pm UTC](https://forum.inductiveautomation.com/t/overriding-gatewayaddress-in-maven-build/70755/2 "2023-03-07T23:07:02Z")

</div>

Disclaimer: Maven is not my forte.

It looks like there _might_ be some workarounds (you can configure the POM once such that it _also_ accepts passed in arguments from the command line) but they don't look great.

What if you set it in the POM to some hardcoded domain name, and then configure your local DNS in the two environments (e.g. via `hosts` file) to target the appropriate gateway? Somewhat overkill, but only has to be configured once per possible host.

---

<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:** [March 7, 2023, 11:22pm UTC](https://forum.inductiveautomation.com/t/overriding-gatewayaddress-in-maven-build/70755/3 "2023-03-07T23:22:06Z")

</div>

Ok, I might have answered my own question.

In the root pom.xml I added a:

```
<properties>
    <gatewayAddress>http://localhost:8088</gatewayAddress>
</properties>

```

Then in the build pom.xml I set the gateway address to look at the project property:

```
<gatewayAddress>${gatewayAddress}</gatewayAddress>

```

Then I added a "settings.xml" file to my home folder with the following:

```auto
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0">
    <profiles>
        <profile>
            <id>office</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <gatewayAddress>http://second-gateway-address-here:8088</gatewayAddress>
            </properties>
        </profile>
    </profiles>
</settings>

```

And I compile with:

```auto
mvn install -s ~/settings.xml

```

I'm pretty happy about that because now I can do some Jenkins automation...
