Wednesday, November 2, 2011

Re: How to change GWT.xml with maven profile by a GWT project

On 2 November 2011 12:15, Gary S <agilej2ee@earthlink.net> wrote:
> It's not clear. gwt-maven-plugin user's guide
> http://mojo.codehaus.org/gwt-maven-plugin/user-guide/project.html
> has a screenshot eclipse package explorer of gwt.xml in src/main/
> resources then under Multi-project setup a text diagram with gwt.xml
> in src/main/java

Yes, this is the setup you should follow. If you use Maven you
can/should ignore the weird setup that GWT recommends (mixing source
and compiled output and including JARs in SCM).

> Then http://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjects.html
> shows
> <module rename-to="com.foo.MyModule">
>  <inherits name="com.foo.MyModule" />
>  <set-property name="user.agent" value="ie6" />
>  <set-property name="locale" value="default" />
> </module>
>
> Why inherit its own name?

Probably a typo, I suspect it should be inheriting from WorkingModule.

> I could build in Eclipse but Hudson couldn't find my module. What
> finally worked was adding a module property like this
>                        <!-- GWT Maven Plugin -->
>                         <plugin>
>                                <groupId>org.codehaus.mojo</groupId>
>                                <artifactId>gwt-maven-plugin</artifactId>
>                                <version>${gwt-maven-plugin.version}</version>
>                                <configuration>
>                                  <module>xxx.xxx.xxx.xxxClient</module>
>                                        <runTarget>xxx.xxx.xxx/xxxclient.html</runTarget>
>                                        <hostedWebapp>${webappDirectory}</hostedWebapp>
>                                </configuration>
> Which I found after endless googling here
> http://jgonian.wordpress.com/2011/02/24/efficient-gwt-development-swap-your-gwt-xml-with-maven/

This is what I use (GWT Maven Plugin 2.3.0-1 / GWT 2.4.0):

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<configuration>
<runTarget>/index.html</runTarget>
<hostedWebapp>${project.build.directory}/${project.artifactId}</hostedWebapp>
<webappDirectory>${project.build.directory}/${project.artifactId}</webappDirectory>
<copyWebapp>true</copyWebapp>
<port>${env.IP_GWT_HOSTED_MODE_PORT}</port>
<strict>true</strict>
</configuration>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<version>${gwt.main.version}</version>
</dependency>
</dependencies>
</plugin>

It's part of my parent POM and works for all of my GWT projects
*without changes*. Try it out and see how it works for you. I don't
use the <client> element but it doesn't look very portable (i.e.
reusable by other GWT projects without changes).

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment