Hi All,
I'd like to suggest a change to MergeWebXmlMojo.java in this plugin to
clarify documentation.
On line 50 of r9947, this:
/**
* Location on filesystem where project should be built.
*
* @parameter expression="${project.build.directory}"
*/
private File buildDir;
could be changed to:
/**
* Location on filesystem where the web.xml will be merged.
*
* @parameter expression="${project.build.directory}"
*/
private File buildDir;
I figured out how to get my GWT RPC services to run using the plugin
with minimal configuration compared to other folks [1] [2] [3] after
reading the source code of the plugin because of this line. The
underlying issue is that the web.xml file is merged in place by the
MergeWebXmlMojo; the source and target directory and filename are the
same when the GWT RPC services are added to the file.
To make it one step clearer for users, it'd be great to rename
"buildDir" to "webXmlMergeDir", in the MergeWebXmlMojo.java file.
Once I figured this out, the GWT RPC services "just work" with a
plugin config similar below, and -without- configuring the maven-war-
plugin or jetty plugin as others have done (again [1], [2], [3]).
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.1-SNAPSHOT</version>
<configuration>
<runTarget>org.myapp.Application/Application.html</runTarget>
<hostedWebapp>${project.build.directory}/hostedWebapp</
hostedWebapp>
<!-- SEE HERE, buildDir MUST BE WITHIN THE hostedWebapp -->
<buildDir>${project.build.directory}/hostedWebapp/WEB-INF</
buildDir>
</configuration>
<executions>
<execution>
<id>full</id>
<goals>
<goal>mergewebxml</goal>
<goal>compile</goal>
<goal>run</goal>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
Hope it helps someone else. If leadership desires, I can submit a
patch for this, just let me know.
cheers,
Jason
[1]
http://groups.google.com/group/codehaus-mojo-gwt-maven-plugin-users/browse_thread/thread/86cec82399b3fcc8/b904c391b99bc647?hl=en&lnk=gst&q=pom#b904c391b99bc647
[2]
http://groups.google.com/group/codehaus-mojo-gwt-maven-plugin-users/browse_thread/thread/a65d06c3309d5f9b/f252fc86c8f3cb33?lnk=gst&q=web.xml#f252fc86c8f3cb33
[3]
http://milen.commsen.com/2009/04/run-gwt-application-in-hosted-mode-from-maven.html