0

What is the 'best' way of serving compiled GWT stuff in a separate .war project?

I am working on a LibGDX game with backend web services. At the moment I have a single .war project that has HTTP endpoints for the web services, and is also doubling up to serve the HTML UI (welcome pages, static content).

I would like the contents of my Maven GWT module to magically appear where Tomcat can serve them in my .war project.

Should I be using a war overlay (I'm not really sure what one is)? Should I use maven-assembly-plugin to unpack GWT bits into the src/main/webapp/ directory of my .war project? Should I co-erce the GWT module to compile its stuff to the META-INF/resources directory of its jar, where Servlet 3.0 containers can serve it from? Is there a preferred approach?

Community
  • 1
  • 1
DeejUK
  • 12,891
  • 19
  • 89
  • 169
  • You have a working buildprocess which creates one waer archive, but you want to create a second war file with the static content, right? – Christian Kuetbach Apr 02 '14 at 19:38
  • Thanks for reading. I don't want the module that compiles the GWT stuff to be a .war project really, as I won't ever serve it on its own, so at the moment it is a .jar. – DeejUK Apr 02 '14 at 19:40

1 Answers1

1

If you already have a WAR-project and simply want to add the compiled GWT stuff as static files to that project, I would suggest to use the assembly-plugin.

Take a look at this two files:

pom.xml clientcode.xml

This will create a ZIP-file with the compiled GWT client as a ZIP file.

In you WAR-project you can download and unzip this artifact in the process-resources phase.

Christian Kuetbach
  • 15,850
  • 5
  • 43
  • 79