threerings/playn — Issue #2: Make playn maven archetype generate GWT pom that's version specific
Author: tmjee
Created: 2011-11-11 02:59:35+00:00
State: open

What steps will reproduce the problem?
html module generated by playn maven archetype replies on gwt-maven-plugin to decide on the GWT version which will causes compilation error if more 1 version of gwt is in the classpath

What is the expected output? What do you see instead?
maven playn skeleton to be generated successfully without errors (eg. ClassNotFoundException)

What version of the product are you using? On what operating system?
PlayN from trunk, Windows, Linux

Please provide any additional information below.

Attached is a patch that will generate pom for html module with gwt version configured as maven property default to 2.4.0, and force gwt-maven-plugin to use the specific version as indicated by maven property.

Following are traces from maven log when using the -X parameters

[INFO] --- gwt-maven-plugin:2.3.0-2-playn:compile (default) @ mplyn1-html ---
[DEBUG] org.codehaus.mojo:gwt-maven-plugin:jar:2.3.0-2-playn:
[DEBUG] com.google.gwt:gwt-user:jar:2.3.0:runtime
[DEBUG] com.google.gwt:gwt-dev:jar:2.3.0:runtime
[DEBUG] org.apache.maven:maven-project:jar:2.0.9:compile
[DEBUG] org.apache.maven:maven-settings:jar:2.0.9:compile

gwt-maven-plugin decided to use gwt 2.3.0

[DEBUG] GWT SDK execution classpath :
...
[DEBUG] D:\maven_repo\com\googlecode\playn\playn-html\1.1-SNAPSHOT\playn-html-1.1-SNAPSHOT.jar
[DEBUG] D:\maven_repo\com\googlecode\playn\playn-core\1.1-SNAPSHOT\playn-core-1.1-SNAPSHOT.jar
[DEBUG] D:\maven_repo\com\googlecode\playn\playn-webgl\1.1-SNAPSHOT\playn-webgl-1.1-SNAPSHOT.jar
[DEBUG] D:\maven_repo\com\google\gwt\gwt-user\2.4.0\gwt-user-2.4.0.jar
[DEBUG] D:\maven_repo\javax\validation\validation-api\1.0.0.GA\validation-api-1.0.0.GA.jar
[DEBUG] D:\maven_repo\javax\validation\validation-api\1.0.0.GA\validation-api-1.0.0.GA-sources.jar
[DEBUG] D:\maven_repo\com\allen-sauer\gwt\voices\gwt-voices\2.1.3\gwt-voices-2.1.3.jar
...

but then for some reason it decided to include gwt 2.4.0 in the classpath too

This patch will force gwt-maven-plugin to always use the version specified in gwt.version property

diff --git a/archetype/src/main/resources/archetype-resources/html/pom.xml b/archetype/src/main/resources/archetype-resources/html/pom.xml
index 3261267..13b9331 100644
--- a/archetype/src/main/resources/archetype-resources/html/pom.xml
+++ b/archetype/src/main/resources/archetype-resources/html/pom.xml
@@ -16,6 +16,7 @@

${package}.${gameName}
${rootArtifactId}
+ 2.4.0

@@ -37,6 +38,19 @@

org.codehaus.mojo
gwt-maven-plugin
+ ${gwt.version}
+
+
+ com.google.gwt
+ gwt-user
+ ${gwt.version}
+
+
+ com.google.gwt
+ gwt-dev
+ ${gwt.version}
+
+

maven-eclipse-plugin

Created one issue with PlayN site as well, but guess i should be cancelling that one.