On Thursday, September 1, 2016 at 11:33:53 AM UTC+2, Bruno Salmon wrote:
>
> Hi,
>
> The GWT documentation 
> <http://www.gwtproject.org/doc/latest/DevGuideOrganizingProjects.html#DevGuideHostPage>
>  
> describes the project layout using Eclipse, but I have a couple of 
> questions when transposing it into the maven project layout (using the 
> tbroyer plugin):
>
> - where is the public folder located in the maven project layout? I tried 
> different places (such as src/public, src/main/public, 
> src/main/resources/public) but it was never found by the compiler
>

The 'public' folder always comes as a subpackage of where your *.gwt.xml 
lives. So if your module is com.example.testapp.TestApp (ultimately a 
com/example/testapp/TestApp.gwt.xml file in the classpath), your public 
folder would be (using the default convention) com/example/testapp/public. 
You could technically put it either in src/main/java or src/main/resources, 
though src/main/resources would be preferred in a gwt-app or gwt-lib 
project.
 

> - where can I put my host page and other html/css sources files? The 
> documentation talks about the war folder, but this directory seems to be 
> the webappDirectory in the tbroyer plugn, so it's a an output directory 
> under the target folder which is not a good place for sources files (they 
> are erased with maven clean).
>

The 'war folder' is used as both input (for static assets and your WEB-INF/ 
folder) and output (where GWT will write the compilation output), but Maven 
(and many other build tools) have a clear/clean separation of input(source) 
and output(target) folders.
It's impossible to accurately answer your questions, because it depends 
what you're building and how you build it.

If you're building a webapp with a server part, then use the 
src/main/webapp from your server/webapp Maven module (you use distinct 
modules for client and server parts, right?); in other words, the host page 
is part of your webapp, not your GWT app. See 
https://github.com/tbroyer/gwt-maven-archetypes
If you build a standalone client application, then use the 'public path' in 
a gwt-app Maven module; that way the WAR/ZIP file created by your build 
will include both the JS output from GWT and your static assets, actually 
copied there by the GWT compiler. (You could also use the 
resources:copy-resources in the prepare-package phase to copy from, say, 
src/main/webapp to the target folder, but running your app in development 
mode would be a bit more complicated).

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to