How to put output from GWT compile into my html directory?

62 views
Skip to first unread message

Neil Aggarwal

unread,
Dec 8, 2024, 12:01:44 AM12/8/24
to google-we...@googlegroups.com

Hello:

 

I am trying to integrate GWT into an existing maven project.

 

My maven build calls gwt:compile and it creates several files
in target/3dmp/com._3dmathpuzzles.play.Play

 

I would like that output to go to a different directory

html/play so it will be served directly by my httpd server.

NOTE: this directory is not under in the target directory

 

I don’t see anything about that in the GWT compiler options

documentation.

 

Thank you,

 Neil

 

--

Neil Aggarwal, (972) 834-1565, http://www.propfinancing.com

We offer 30 year loans on single family houses!

 

Craig Mitchell

unread,
Dec 8, 2024, 1:49:07 AM12/8/24
to GWT Users
I feel your pain.  The gwt-maven-plugin works great, but personally, I find it hard to understand how to configure it.

This is my setup:
<plugin>
  <groupId>net.ltgt.gwt.maven</groupId>
  <artifactId>gwt-maven-plugin</artifactId>
  <configuration>
    <moduleName>team.drift.EntryPointMain</moduleName>
    <moduleShortName>dt</moduleShortName>
    <workDir>${basedir}/target/gwt/workDir</workDir>
    <deploy>${project.build.directory}/${project.build.finalName}/WEB-INF/deploy</deploy>

    <compilerArgs>
      <!--
      Ask GWT to create the Story of Your Compile (SOYC) (gwt:compile)
      Report goes in: drift-team-client\target\extras\dt\soycReport\compile-report\index.html
      -->
      <!-- <arg>-compileReport</arg> -->
    </compilerArgs>
  </configuration>
</plugin>

I have no clue what workDir and deploy arguments do, and I can't find them in the doco:  https://tbroyer.github.io/gwt-maven-plugin/  The only reason they are there, is I used https://github.com/NaluKit/gwt-maven-springboot-archetype to generate my app, and it put them there.

Another option would be to move it with the maven-resources-plugin copy-resources after it's built.  But that would mean it wouldn't work during development.

Neil Aggarwal

unread,
Dec 8, 2024, 10:41:26 AM12/8/24
to google-we...@googlegroups.com

Craig:

 

I changed my pom.xml file to this:

                                             <plugin>

                                               <groupId>net.ltgt.gwt.maven</groupId>

                                               <artifactId>gwt-maven-plugin</artifactId>

                                               <version>1.1.0</version>

                                               <extensions>true</extensions>

                                                            <configuration>

                                                              <moduleName>com._3dmathpuzzles.play.Play</moduleName>

                                                              <workDir>${basedir}/html/play</workDir>

                                                              <deploy>${basedir}/html/play</deploy>

                                                            </configuration>                                      

                                             </plugin> 

 

Now, I get some files in html/play, but the nocache.js file is still under the
target directory.

 

I will look into the copy resources plugin since I don’t need to run it on my
local machine, I always upload the code to a test server to run it. 

 

Thank you,

 Neil

 

--

Neil Aggarwal, (972) 834-1565, http://www.propfinancing.com

We offer 30 year loans on single family houses!

 

--
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-tool...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/8276d216-3ec1-4b78-b174-c7f4a78cd4dcn%40googlegroups.com.

Neil Aggarwal

unread,
Dec 8, 2024, 10:59:58 AM12/8/24
to google-we...@googlegroups.com

I think I found it, I added this line to my configuration:

               <webappDirectory>${basedir}/html/play</webappDirectory>

 

And it puts the nocache.js file generates to the html/play directory now.

 

Unfortunately, it also created a gwt-unitCache directory in my html directory.

Anyone know how to stop that?

 

Thank you,

 Neil

 

--

Neil Aggarwal, (972) 834-1565, http://www.propfinancing.com

We offer 30 year loans on single family houses!

 


Sent: Sunday, December 8, 2024 12:49 AM
To: GWT Users <google-we...@googlegroups.com>
Subject: Re: How to put output from GWT compile into my html directory?

 

I feel your pain.  The gwt-maven-plugin works great, but personally, I find it hard to understand how to configure it.

--

Thomas Broyer

unread,
Dec 8, 2024, 11:17:02 AM12/8/24
to GWT Users
On Sunday, December 8, 2024 at 7:49:07 AM UTC+1 ma...@craig-mitchell.com wrote:
I feel your pain.  The gwt-maven-plugin works great, but personally, I find it hard to understand how to configure it.

The documentation is not "high level", and you have to understand both Maven and GWT, and I agree it can be a barrier to entry.
The plugin (and its documentation) are here to answer the question "how do I use GWT from Maven?", so you start by understanding how GWT works then ask yourself "OK, now how do I do that with Maven?", and the plugin is here for that, and is a relatively "thin" level of abstraction: https://tbroyer.github.io/gwt-maven-plugin/compile-mojo.html
I fully understand that people come from many different horizons and don't necessarily approach it that way, but I'm happily leaving that to others to document (on the gwtproject.org site?)
 
This is my setup:
<plugin>
  <groupId>net.ltgt.gwt.maven</groupId>
  <artifactId>gwt-maven-plugin</artifactId>
  <configuration>
    <moduleName>team.drift.EntryPointMain</moduleName>
    <moduleShortName>dt</moduleShortName>
    <workDir>${basedir}/target/gwt/workDir</workDir>
    <deploy>${project.build.directory}/${project.build.finalName}/WEB-INF/deploy</deploy>

    <compilerArgs>
      <!--
      Ask GWT to create the Story of Your Compile (SOYC) (gwt:compile)
      Report goes in: drift-team-client\target\extras\dt\soycReport\compile-report\index.html
      -->
      <!-- <arg>-compileReport</arg> -->
    </compilerArgs>
  </configuration>
</plugin>

I have no clue what workDir and deploy arguments do, and I can't find them in the doco:  https://tbroyer.github.io/gwt-maven-plugin/  The only reason they are there, is I used https://github.com/NaluKit/gwt-maven-springboot-archetype to generate my app, and it put them there.

They directly map to the similarly-named options of the GWT compiler documented on that page: https://www.gwtproject.org/doc/latest/DevGuideCompilingAndDebugging.html#DevGuideCompilerOptions

Neil Aggarwal

unread,
Dec 8, 2024, 11:33:41 AM12/8/24
to google-we...@googlegroups.com

I figured it out. I changed my configuration to this:

 

                                             <plugin>

                                               <groupId>net.ltgt.gwt.maven</groupId>

                                               <artifactId>gwt-maven-plugin</artifactId>

                                               <version>1.1.0</version>

                                               <extensions>true</extensions>

                                                            <configuration>

                                                              <moduleName>com._3dmathpuzzles.play.Play</moduleName>

                                                            <webappDirectory>${basedir}/html/play</webappDirectory>

                                                 <systemProperties>

                                                                <gwt.persistentunitcachedir>false</gwt.persistentunitcachedir>

                                                 </systemProperties>

                                             </configuration>                                      

                                             </plugin>   

 

I don’t get the unit cache directory now.

 

Thank you,

 Neil

 

--

Neil Aggarwal, (972) 834-1565, http://www.propfinancing.com

We offer 30 year loans on single family houses!

 

From: Neil Aggarwal <ne...@propfinancing.com>
Sent: Sunday, December 8, 2024 9:59 AM
To: 'google-we...@googlegroups.com' <google-we...@googlegroups.com>
Subject: RE: How to put output from GWT compile into my html directory?

 

I think I found it, I added this line to my configuration:

               <webappDirectory>${basedir}/html/play</webappDirectory>

 

And it puts the nocache.js file generates to the html/play directory now.

 

Unfortunately, it also created a gwt-unitCache directory in my html directory.

Anyone know how to stop that?

 

Thank you,

 Neil

 

--

Neil Aggarwal, (972) 834-1565, http://www.propfinancing.com

We offer 30 year loans on single family houses!

 


Sent: Sunday, December 8, 2024 12:49 AM
To: GWT Users <google-we...@googlegroups.com>
Subject: Re: How to put output from GWT compile into my html directory?

 

I feel your pain.  The gwt-maven-plugin works great, but personally, I find it hard to understand how to configure it.

--

Thomas Broyer

unread,
Dec 8, 2024, 12:15:41 PM12/8/24
to GWT Users
On Sunday, December 8, 2024 at 5:33:41 PM UTC+1 ne...@propfinancing.com wrote:

I figured it out. I changed my configuration to this:

 

                                             <plugin>

                                               <groupId>net.ltgt.gwt.maven</groupId>

                                               <artifactId>gwt-maven-plugin</artifactId>

                                               <version>1.1.0</version>

                                               <extensions>true</extensions>

                                                            <configuration>

                                                              <moduleName>com._3dmathpuzzles.play.Play</moduleName>

                                                            <webappDirectory>${basedir}/html/play</webappDirectory>

                                                 <systemProperties>

                                                                <gwt.persistentunitcachedir>false</gwt.persistentunitcachedir>

                                                 </systemProperties>

                                             </configuration>                                      

                                             </plugin>   

 

I don’t get the unit cache directory now.


That'd be <gwt.persistentunitcache>false</gwt.persistentunitcache> but I think you'd better (for performance) keep the persistent unit-cache dir but just relocate it; so gwt.persistentunitcachedir but with a path, e.g. <gwt.persistentunitcachedir>${project.build.directory}/gwt-unitCache</gwt.persistentunitcachedir>.

Neil Aggarwal

unread,
Dec 8, 2024, 12:24:56 PM12/8/24
to google-we...@googlegroups.com
  • <gwt.persistentunitcachedir>${project.build.directory}/gwt-unitCache</gwt.persistentunitcachedir>.

 

Much better!  Thanks for the tip!

Craig Mitchell

unread,
Dec 8, 2024, 10:35:31 PM12/8/24
to GWT Users
Thanks Thomas.

The bit I was missing was from the Goals menu ( https://tbroyer.github.io/gwt-maven-plugin/plugin-info.html ), I needed to drill into the "gwt:compile".

And I should have known to do that if I looked at the Lifecycles menu ( https://tbroyer.github.io/gwt-maven-plugin/lifecycles.html ), and saw it does the "gwt:compile" in the "prepare-package" phase.

Always learning.  Thanks again.  🙂
Reply all
Reply to author
Forward
0 new messages