I have a pom.xml that uses cxf-codegen-plugin to generate a couple of WS clients.
Inside the configuration of cxf-codegen-plugin, there are the WSDL locations.
I would like to externalize those strings to a env.properties file.
I used org.codehaus.mojo’s properties-maven-plugin to look inside src/main/resources/conf/app/env.properties.
How can I make Hudson to replace those properties with the apropiate host?
Thanks in advance
Filtering and profiles should work.
Setup a husdon filter file and place in src/main/filters. Create an additional filter file for each region you need to run in.
The filter files should be named similarly, like so: filter-hudson.properties, filter-prod.properties, etc. and contain the same properties:
Then have simple profiles that contain the environment you run on:
If you then setup your filters in your pom:
Then the files in conf app will have wsdl.host replaced with the specific values in your filter.
Then when you run your hudson build, add -P hudson to invoke the hudson profile.
There may be a “better” way to do this, but about a year and a half ago, I had success with this technique. To give proper credit, here’s the blog post I used as instructions.