Overriding gatewayAddress in Maven Build

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

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.

1 Like

Ok, I might have answered my own question.

In the root pom.xml I added a:


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


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

<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0">

And I compile with:

mvn install -s ~/settings.xml

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