tags:

views:

2982

answers:

1

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.

+1  A: 

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 this page: http://code.google.com/webtoolkit/doc/1.6/DevGuideOrganizingProjects.html#DevGuideModuleXml

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

<module rename-to="com.foo.MyModule">
  <inherits name="com.foo.MyModule" />
  <set-property name="user.agent" value="ie6" />
</module>

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.

Chi
Robert Munteanu
Does the gwt.xml used for the firefox build start with<module rename-to="Application"> ?
Chi
@Chi, you're correct, this the `rename-to` was missing. I will update the answer with the maven settings I've used as well.
Robert Munteanu