Tuesday, May 9, 2017

Re: Multiple GWT modules in one Maven module

I tried both the command line (mvn gwt:compile) and via the IntelliJ Maven plugin.
Indeed, binding the execution to the prepare-package phase and running mvn gwt:compile@compile-common works, and I'm glad it does.

If I'm reading what you're saying correctly, this means that there is no way to invoke all the plugin executions with a simple command?
I personally expected mvn gwt:compile to invoke everything it needs (so everything that comes earlier in it's lifecycle, including the executions I bound to the prepare-package phase),
or am I missing something obvious?

Thanks again!

On Tuesday, May 9, 2017 at 1:26:28 PM UTC+2, Thomas Broyer wrote:


On Tuesday, May 9, 2017 at 1:11:04 PM UTC+2, Frederik Van Hoyweghen wrote:


On Tuesday, May 9, 2017 at 12:59:17 PM UTC+2, Thomas Broyer wrote:

I wouldn't put any <moduleName> / <moduleShortName> into the plugin-level <configuration>, and only put them into the <executions>.

That's what I figured, but it seems to be a required property (The parameters 'moduleName' for goal net.ltgt.gwt.maven:gwt-maven-plugin:1.0-rc-7:compile are missing or invalid, when invoking gwt:compile).

How are you invoking gwt:compile? If on the command-line, then the execution ID matters, and only one such execution will match (the one with <id>default-cli</id>). But starting with Maven 3.3.1 you can specify the execution id on the command-line too: "mvn gwt:compile@compile-common gwt:compile@compile-foo".


I defined my executions as per your example:
<configuration>
   
<localWorkers>6</localWorkers>
   
<skipModule>true</skipModule>
   
<draftCompile>true</draftCompile>
</configuration>
<executions>
   
<execution>
       
<id>compile-common</id>
       
<goals><goal>compile</goal></goals>
       
<configuration>
           
<moduleName>com.test.common</moduleName>
       
</configuration>
   
</execution>

etc.. but it appears the executions aren't triggered (or is this an effect of the missing moduleName under configuration?). It seems I have much to learn still.

Rule of thumb: if a goal is (meant to be) bound to a lifecycle phase (such as gwt:compile which is bound by default to the prepare-package phase; see https://tbroyer.github.io/gwt-maven-plugin/compile-mojo.html; but not gwt:devmode or gwt:codeserver for example), then invoke the lifecycle phase, not the goal.
Another rule of thumb: only ever invoke the lifecycle phases "package" and "verify" (and "install" and "deploy" when dealing with libraries, to share them with other projects / people). If you want to skip tests, pass -DskipTests, if you want to skip the compilation of tests too then pass -Dmaven.test.skip.
If you know what you're doing, then feel free to break those rules; if you know what you're doing.

Also, have a look at Gradle rather than Maven, if that's a possibility for your project(s).

--
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+unsubscribe@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.

No comments:

Post a Comment