When developing, I set the user.agent property to a single value, to keep compile times down. When releasing, I have a WAR file built for all user agents.
I unfortunately seem to keep forgetting to switch the property, either:
- wasting development time waiting for compiles, or
- preparing a WAR file with incomplete browser support ( not yet deployed , thankfully ).
I want to automate this, preferably using the maven-release-plugin.
You want to have 2 different .gwt.xml files – one used for development and one used for production.
There is a good example on the ‘Renaming modules’ section of Developer Guide/Organizing projects.
The gwt.xml file used for development would inherit from the gwt.xml file used for production and set the user.agent property as well. e.g.:
Now, when doing development, you would use the development gwt.xml file, and when doing a production build. you would use the production gwt.xml file.
The easiest way to achieve this with Maven is to activate the development module using a profile. I’ve written in detail about this at Maven Recipe : GWT development profile.