Mojo's maven-gwt-plugin or Thomas's maven-gwt-plugin?

663 views
Skip to first unread message

Michael Zhou

unread,
Nov 17, 2015, 4:11:36 AM11/17/15
to GWT Users
I'm trying to build a Java application with GWT, using maven as the build system. I'm trying to decide which maven-gwt-plugin to use.
The project's directory structure doesn't follow Maven convention, so I guess I will run into some problems with Thomas' plugin?

Thomas Broyer

unread,
Nov 17, 2015, 5:15:47 AM11/17/15
to GWT Users


On Tuesday, November 17, 2015 at 10:11:36 AM UTC+1, Michael Zhou wrote:
I'm trying to build a Java application with GWT, using maven as the build system. I'm trying to decide which maven-gwt-plugin to use.

Major differences are:
  • Mojo's one is tied to a specific version of GWT. To get a fix for the plugin, you possibly need to update your GWT too (it's a good idea anyway, but there could be timing conflicts); and to update your GWT you might have to wait for a release of the plugin. I completely stopped maintaining Mojo's plugin and following its development so I have no idea whether there'll be a new release and when (I'm absolutely not trying to throw FUD here); all I can say is it hasn't been updated for 4 months whereas they has been some changes to GWT and more changes to come (e.g. disableCastChecking was deprecated in September, jsInteropMode default was recently changed from NONE to JS_RC, there's a patch in review that removes jsInteropMode=JS and the jsInteropMode argument will be removed entirely before 2.8.0, and there's a new generateJsInteropExports).
  • Mojo's plugin gwt:run and gwt:run-codeserver don't play well with multi-module builds. You can make them work but they need really nasty hacks in your POMs (BTW, this is a similar situation to the Jetty Maven Plugin).
  • My plugin brings in new packagings, so you have fewer things to configure.
 
The project's directory structure doesn't follow Maven convention, so I guess I will run into some problems with Thomas' plugin?

No you shouldn't.
All paths are configurable, and many goals (e.g. generateModule) can be skipped.
And you can also use the goals without using the gwt-lib/gwt-app packagings, just like with Mojo's plugin.

In any case, it's not hard to switch from one plugin to the other, so just pick the one you'd prefer working with.

Tomek Kańka

unread,
Nov 17, 2015, 5:00:21 PM11/17/15
to GWT Users
Thomas.

I have no luck in forcing your plugin (or/and tomcat7-maven-plugin) to work with  spring application without web.xml.
Whatever I tried I've got

INFO: No Spring WebApplicationInitializer types detected on classpath


Do you or someone else have any experience with this?

--
Tomek Kanka

Martin Trummer

unread,
Nov 20, 2015, 5:46:22 AM11/20/15
to GWT Users
@Thomas: I am surprised, that you make a maven plugin.
I can remember one of your blog posts was like "Maven is broken by design"
Then, why do you write a maven plugin? 
Did Maven improve with version 3.x, or is there just no other alternative for some reason?
What build system would you recommend for a new gwt project?

Thomas Broyer

unread,
Nov 20, 2015, 7:35:33 AM11/20/15
to GWT Users


On Friday, November 20, 2015 at 11:46:22 AM UTC+1, Martin Trummer wrote:
@Thomas: I am surprised, that you make a maven plugin.
I can remember one of your blog posts was like "Maven is broken by design"
Then, why do you write a maven plugin?

Ha, because a) I happen to still use Maven in some projects† and b) Maven users deserve a better plugin than Mojo's one, and an overall better Maven+GWT integration.
This is also one reason I created and continue to maintain my Maven archetypes for GWT: https://github.com/tbroyer/gwt-maven-archetypes

† I even tend to use Maven by default for libraries; but I avoid it all all costs for applications.

Did Maven improve with version 3.x,

I don't think I ever used anything else than 3.x (or only briefly, and not really knowing Maven at the time). But yes there's been some progress in 3.2 and 3.3.
But my main issues with Maven (it's linear lifecycle, and how it's applied to a reactor build) are by-design and I really doubt they'll ever change that.
 
or is there just no other alternative for some reason?

There are, and I'd written about it too: http://blog.ltgt.net/in-quest-of-the-ultimate-build-tool/
I'm a (rather) happy Gradle user, lurking at Bazel.
 
What build system would you recommend for a new gwt project?

Gradle without an hesitation, either with the gwt-gradle-plugin (I must say I never used it though; haven't created a new GWT project since I settled on Gradle, or created projects for customers who asked for Maven) or rolling your own tasks;
but if you're familiar with Maven and don't have major issues with it, then go ahead and then just pick one of the gwt-maven-plugin.

Filipe Sousa

unread,
Nov 20, 2015, 4:58:17 PM11/20/15
to GWT Users
This is a bit off topic, but what do you think about the takari lifecycle?

Bruno Salmon

unread,
Nov 20, 2015, 4:58:40 PM11/20/15
to GWT Users
Hello,

I'm trying to use the gwt-maven-plugin version 2.8.0-SNAPSHOT but it seems Maven can't load it:

[WARNING] The POM for org.codehaus.mojo:gwt-maven-plugin:jar:2.8.0-SNAPSHOT is missing, no dependency information available
[ERROR] Plugin org.codehaus.mojo:gwt-maven-plugin:2.8.0-SNAPSHOT or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.codehaus.mojo:gwt-maven-plugin:jar:2.8.0-SNAPSHOT: Could not find artifact org.codehaus.mojo:gwt-maven-plugin:pom:2.8.0-SNAPSHOT in google-snapshots (https://oss.sonatype.org/content/repositories/google-snapshots/) -> [Help 1]

Any idea what am I doing wrong?

Thomas Broyer

unread,
Nov 20, 2015, 5:27:58 PM11/20/15
to GWT Users


On Friday, November 20, 2015 at 10:58:40 PM UTC+1, Bruno Salmon wrote:
Hello,

I'm trying to use the gwt-maven-plugin version 2.8.0-SNAPSHOT but it seems Maven can't load it:

[WARNING] The POM for org.codehaus.mojo:gwt-maven-plugin:jar:2.8.0-SNAPSHOT is missing, no dependency information available
[ERROR] Plugin org.codehaus.mojo:gwt-maven-plugin:2.8.0-SNAPSHOT or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.codehaus.mojo:gwt-maven-plugin:jar:2.8.0-SNAPSHOT: Could not find artifact org.codehaus.mojo:gwt-maven-plugin:pom:2.8.0-SNAPSHOT in google-snapshots (https://oss.sonatype.org/content/repositories/google-snapshots/) -> [Help 1]

Any idea what am I doing wrong?

gwt-maven-plugin snapshots are in the https://oss.sonatype.org/content/repositories/snapshots/ repository, not the https://oss.sonatype.org/content/repositories/google-snapshots/ one (this one contains snapshots of GWT proper)
 

Bruno Salmon

unread,
Nov 23, 2015, 4:29:20 AM11/23/15
to GWT Users
Thanks Thomas, maven can now download the plugin with the correct repository url you gave me, a step forward to 2.8 :-)

However, this is now the gwt-user actifact itself that fails to download (this time in the google-snapshots repository) due to this unresolved dependency: 
Failure to find com.google.jsinterop:jsinterop:pom:1.0.0-SNAPSHOT in https://oss.sonatype.org/content/repositories/google-snapshots/
And indeed, there is no "jsinterop" repository under https://oss.sonatype.org/content/repositories/google-snapshots/com/google/

Any idea what's wrong?

Thomas Broyer

unread,
Nov 23, 2015, 4:44:15 AM11/23/15
to GWT Users


On Monday, November 23, 2015 at 10:29:20 AM UTC+1, Bruno Salmon wrote:
Thanks Thomas, maven can now download the plugin with the correct repository url you gave me, a step forward to 2.8 :-)

However, this is now the gwt-user actifact itself that fails to download (this time in the google-snapshots repository) due to this unresolved dependency: 
Failure to find com.google.jsinterop:jsinterop:pom:1.0.0-SNAPSHOT in https://oss.sonatype.org/content/repositories/google-snapshots/
And indeed, there is no "jsinterop" repository under https://oss.sonatype.org/content/repositories/google-snapshots/com/google/

Any idea what's wrong?


Bruno Salmon

unread,
Nov 23, 2015, 5:17:15 AM11/23/15
to GWT Users
Thanks Thomas, I will continue on that tread

kim young ill

unread,
Dec 6, 2015, 6:21:16 AM12/6/15
to google-we...@googlegroups.com
hi there, i'm considering moving  to gwt2.8 for (mostly because of jdk8) and switching to Thomas's plugin, i have several separate gwt modules in webapp-client-module, in the mojo plugin i can put it like this:
 <build>
        <plugins>
            <plugin>
<groupId>org.codehaus.mojo</groupId>
                <artifactId>gwt-maven-plugin</artifactId>
                <configuration>
                    <modules>
                        <module>com.app.client.module1</module>
                        <module>com.app.client.module2</module>
                        <module>com.app.client.module3</module>
                    </modules>
</plugin>

....

</plugins>
</build>

what would be the alternative for thomas's plugin ? do i need to create separate profiles for each module ?

thanx

--
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 post to this group, send email to google-we...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Thomas Broyer

unread,
Dec 6, 2015, 8:23:09 AM12/6/15
to GWT Users
You should be able to create several executions (for the same goal and phase, but different ids and configurations)

kim young ill

unread,
Dec 6, 2015, 10:05:16 AM12/6/15
to google-we...@googlegroups.com
my project structure look like this:

webapp-parent
  -webapp-client
  -weapp-shared
  -webapp-server
  -webapp-utils
 ...some other small non gwt-related modules


i come up with this: (in webapp-client module) but gwt:compile still complaining :

on project webapp-client: The parameters 'moduleName' for goal net.ltgt.gwt.maven:gwt-maven-plugin:1.0-rc-5:compile are missing or invalid


 <plugins>
            <plugin>
                <groupId>net.ltgt.gwt.maven</groupId>
                <artifactId>gwt-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>m1</id>
                        <configuration>
                            <moduleName>com.app.client.Module1/moduleName>
                            <moduleShortName>m1</moduleShortName>
                        </configuration>
                    </execution>   
                    <execution>
                        <id>m2</id>
                        <configuration>
                            <moduleName>com.app.client.Module2/moduleName>
                            <moduleShortName>m2</moduleShortName>
                        </configuration>
                    </execution>  

                </executions>
    </plugin>
...
</plugins>


do you have any sample in the repos i can look it up ?
i must admit i'm not a maven expert
thanx



On Sun, Dec 6, 2015 at 2:23 PM, Thomas Broyer <t.br...@gmail.com> wrote:
You should be able to create several executions (for the same goal and phase, but different ids and configurations)

Thomas Broyer

unread,
Dec 6, 2015, 4:14:34 PM12/6/15
to GWT Users
I don't see the <goal>compile</goal>, is it in a pluginManagement somewhere or are you using gwt-app packaging? Anyway, there should be <goals> in each <execution>.

kim young ill

unread,
Dec 6, 2015, 4:59:45 PM12/6/15
to google-we...@googlegroups.com
thanx, i got further with <goal>compile</goal> and  <skipModule>true</skipModule>, but now got hit by guava18. (similar to this:
https://groups.google.com/forum/m/#!topic/google-web-toolkit-contributors/VbokswmVz9w
), i'll see how to overcome this

On Sun, Dec 6, 2015 at 10:14 PM, Thomas Broyer <t.br...@gmail.com> wrote:
I don't see the <goal>compile</goal>, is it in a pluginManagement somewhere or are you using gwt-app packaging? Anyway, there should be <goals> in each <execution>.
Reply all
Reply to author
Forward
0 new messages