I struggled with this myself. I finally just found a simple solution
here:
http://code.google.com/eclipse/docs/faq.html#gwt_with_maven
Basically, GPE 1.3 now allows you to specify an alternate location for
your WAR directory, where static resources and web.xml will be found
(as well as a flag labeled "Launch and deploy from this directory",
whatever exactly that's for). It defaults to war/, which is where GWT
historically likes it to be, but you can change it to src/main/webapp
instead, which is where maven (and especially the gwt-maven-plugin)
wants it to be.
The only tricky thing that I ran into is that eclipse wasn't letting
me enable GWT for the project. From the GPE docs, it sounds like it
detects when there's a valid war/ directory. Doing a maven build and
manually copying the web.xml from src/main/webapp/WEB-INF to war/WEB-
INF should get you there, though I'm hoping that what Michael
suggested adding to the POM to add the GWT nature will work.
With that in place, the only thing left that wants anything to do with
the war/ directory is the gwt-maven-plugin, and that's only because
it's trying to conform to what GPE and GWT development mode want. I'm
currently using the hostedWebapp (http://mojo.codehaus.org/gwt-maven-
plugin-1.2/run-mojo.html#hostedWebapp) property to point to the
exploded WAR in target instead:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<configuration>
<hostedWebapp>${project.build.directory}/$
{project.build.finalName}</hostedWebapp>
</configuration>
</plugin>
The only problem with this is that the project has to be packaged
before running gwt:run, but I can live with that for now while I try
to figure out a better way.
The beauty of this is that I now have a GWT project using maven with
no war/ directory and no directories where some files are under source
control and some aren't.
-Brian
On Apr 18, 1:55 pm, Steve <[email protected]> wrote:
> I'm getting very frustrated -- reading dozens of messages, faqs,
> whatever I can find on the subject, but I haven't found all the info I
> need in one place and haven't been able to piece it all together ...
> maybe I just missed it, but hopefully someone here can help.
>
> What I'd like to do ...
>
> Create a GWT project, use Maven instead of Ant to build. Be able to
> debug in DevMode, be able to "mvn package" and manually deploy my war
> to a container.
>
> Using Eclipse (3.5.2), m2eclipse, GPE 1.3.2 -- what do I need to do?
> What is the directory structure I need? Is there a maven archetype to
> create the directory structure?
>
> I tried the MavenAppRpc project. I was successful in building it and
> deploying the war to Tomcat. However, I could never get it to work in
> DevMode.
>
> Is there a 1-2-3 type tutorial available that can get me started?
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group
> athttp://groups.google.com/group/google-web-toolkit?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.