Wednesday, July 29, 2015

Re: gwt-maven-archetypes multiple project setup

So I figured out that if I do a maven install a war is generated in the server project, however my servlet classes from the libraries were not copied into the war. Still looking into that...

On Tuesday, July 28, 2015 at 10:27:34 AM UTC-4, William Davis wrote:
So the good news is that everything is running well, the incremental compile is working for all the libraries client and server side. I am very impressed with the plugin Thomas.

One last question, what is the correct way to package the whole app into a war for production. I tried to run gwt:package-app on the parent project, the one containing the client, shared, and server projects in the modular-webapp archetype, however when I put the war on tomcat it didn't work. Should I install the projects and libraries in a certain order? What am I doing wrong?

Once again, great work Thomas, this is really excellent.
Thanks for the help,
Will

On Friday, July 24, 2015 at 10:42:19 AM UTC-4, Thomas Broyer wrote:


On Friday, July 24, 2015 at 4:13:45 PM UTC+2, William Davis wrote:
I think I figured something out. In the "base" project, in the parent pom, I only defined the three modules in that project like this:
<modules>
    <module>base-client</module>
    <module>base-shared</module>
    <module>base-server</module>
  </modules>

but I changed it to add the client library like this:
<modules>
    <module>base-client</module>
    <module>../library-core/library-core-client</module>
    <module>base-shared</module>
    <module>base-server</module>
  </modules>

and now the incremental compile works when I make changes to the library client.
Is this the correct/best way to do this?

With your initial setup, the library-core-client (and its transitive dependencies) come from your local repository, and you have to "mvn install" the library each time you make a change to it.
With your final setup, it's all one reactor project (you should include the library-core-shared and library-core-server too BTW), so the gwt-maven-plugin will look at the MavenProject from the reactor build to get its sources.

Your initial setup is OK if you intend to release library-core-* separately from the "base" webapp.
Your final setup is OK if you intend to release everything at once. I'd have rather put everything inside one big project with many submodules (organized into subfolders), but in the end it's up to you to decide.
Note that there's a way to get things working with your initial "2 separate projects" approach though: create a POM file somewhere that lists all modules as submodules (note: you can just list the 2 root modules of your 2 projects and thus get the submodules recursively) and from which one you can run the tomcat7:run and gwt:codeserver goals.

This is all "standard Maven", independent of the gwt-maven-plugin (you'd get the same behavior for server-side code with the tomcat-maven-plugin, not seeing changes to your library-core-shared and library-core-server until you "mvn install" them and restart Tomcat).

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

No comments:

Post a Comment