Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: 2.1.0-1, 2.2.0
-
Fix Version/s: None
-
Labels:None
-
Number of attachments :1
Description
Hello,
when I use filtered resources for messages or constant files in my maven gwt project it seems like the original source .properties files are used instead of the filtered ones from the target directory.
As far as I can see it, I have the same problem as MGWT-216 which seems to be closed. But it does not work for me in 2.1.0-1 or 2.2.0.
Example:
Following command is executed by the maven gwt plugin:
/usr/lib/jvm/java-6-sun-1.6.0.22/jre/bin/java -Xmx512m -classpath PROJECTPATH/src/main/java:PROJECTPATH/src/main/resources:PROJECTPATH/target/admingui/WEB-INF/classes:HOME/.m2/repository/com/google/gwt/gwt-user/2.1.1/gwt-user-2.1.1.jar:HOME/.m2/repository/com/google/gwt/inject/gin/1.0/gin-1.0.jar:HOME/.m2/repository/com/google/inject/guice/2.0/guice-2.0.jar:HOME/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar:HOME/.m2/repository/com/google/code/gwt-log/gwt-log/3.0.2/gwt-log-3.0.2.jar:HOME/.m2/repository/com/extjs/gxt/2.2.0/gxt-2.2.0.jar:HOME/.m2/repository/log4j/log4j/1.2.16/log4j-1.2.16.jar:HOME/.m2/repository/com/google/gwt/gwt-user/2.1.1/gwt-user-2.1.1.jar:HOME/.m2/repository/com/google/gwt/gwt-dev/2.1.1/gwt-dev-2.1.1.jar com.google.gwt.i18n.tools.I18NSync -out PROJECTPATH/target/generated-sources/gwt namespace.client.constants.Version
What works is the following, without PROJECTPATH/src/main/resources maybe it even should be without PROJECTPATH/src/main/java:
/usr/lib/jvm/java-6-sun-1.6.0.22/jre/bin/java -Xmx512m -classpath PROJECTPATH/src/main/java:PROJECTPATH/target/admingui/WEB-INF/classes:HOME/.m2/repository/com/google/gwt/gwt-user/2.1.1/gwt-user-2.1.1.jar:HOME/.m2/repository/com/google/gwt/inject/gin/1.0/gin-1.0.jar:HOME/.m2/repository/com/google/inject/guice/2.0/guice-2.0.jar:HOME/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar:HOME/.m2/repository/com/google/code/gwt-log/gwt-log/3.0.2/gwt-log-3.0.2.jar:HOME/.m2/repository/com/extjs/gxt/2.2.0/gxt-2.2.0.jar:HOME/.m2/repository/log4j/log4j/1.2.16/log4j-1.2.16.jar:HOME/.m2/repository/com/google/gwt/gwt-user/2.1.1/gwt-user-2.1.1.jar:HOME/.m2/repository/com/google/gwt/gwt-dev/2.1.1/gwt-dev-2.1.1.jar com.google.gwt.i18n.tools.I18NSync -out PROJECTPATH/target/generated-sources/gwt namespace.client.constants.Version
Looking at the plugin source it seems the whole compile classpath is used to build the messages files, maybe a different classpath should be used here. I fear I don't have enough knowledge to make those changes myself but I guess shell/I18NMojo.java and AbstractGwtMojo.java maybe with SCOPEs are involved.
-
Hide
- MGWT-285.zip
- 21/Apr/11 12:49 PM
- 11 kB
- jieryn
-
- MGWT-285/pom.xml 3 kB
- MGWT-285/src/main/webapp/WEB-INF/web.xml 0.6 kB
- MGWT-285/src/main/webapp/Application.css 0.6 kB
- MGWT-285/src/.../webapp/Application.html 3 kB
- MGWT-285/src/.../shared/FieldVerifier.java 1 kB
- MGWT-285/src/.../GreetingServiceImpl.java 2 kB
- MGWT-285/src/.../client/Application.java 5 kB
- MGWT-285/src/.../client/GreetingService.java 0.4 kB
- MGWT-285/src/.../mojo/Application.gwt.xml 0.3 kB
- MGWT-285/src/.../client/Messages.properties 0.0 kB
Activity
Here is an example project which demonstrates the problem. It uses a simple variable to define the entry point, and exploits that variable in the Application.gwt.xml. Filtering is enabled, and you can see that target/mgwt-285/WEB-INF/classes/org/codehaus/mojo/Application.gwt.xml contains the properly filtered GWT configuration..
Compilation will succeed, but gwt:run (and browser loading the page) will trigger the error. You will see it in the browser tab of the GWT development mode window.
+1 month and this problem is still hitting a lot of users. The intricacies of Maven classpath munging are beyond my abilities.. what can I do to help this problem get resolved?
I really want this to be resolved because I maintain lots of .gwt.xml files which are twinned for production and development modes (e.g. setting GWT j.u.logging to different levels) and it would be nice to simply reference a variable in my exploiting project's .gwt.xml for the <inherits name="com.acme.base.gwt.Logging-$
{env}"/> where ${env}is set by default for production and overridden via profile for development.
As generate-source phase occurs prior to resource filtering I can't see a simple solution at plugin level.
I'd suggest that you package your bundles in another artefact and use them as project dependency.
Here's some more evidence:
[INFO] --- gwt-maven-plugin:2.2.0:compile (default) @ gwt --- [DEBUG] Configuring mojo org.codehaus.mojo:gwt-maven-plugin:2.2.0:compile from plugin realm ClassRealm[plugin>org.codehaus.mojo:gwt-maven-plugin:2.2.0, parent: sun.misc.Launcher$AppClassLoader@35a16869] [DEBUG] Configuring mojo 'org.codehaus.mojo:gwt-maven-plugin:2.2.0:compile' with basic configurator --> [DEBUG] (f) compileReport = false [DEBUG] (f) disableCastChecking = false [DEBUG] (f) disableClassMetadata = false [DEBUG] (f) draftCompile = true [DEBUG] (f) enableAssertions = false [DEBUG] (f) extra = /home/jesse/workspaces/acme/com.acme.myapp/gwt/target/extra [DEBUG] (f) extraJvmArgs = -Xmx512m [DEBUG] (f) extraParam = false [DEBUG] (f) force = false [DEBUG] (f) gen = /home/jesse/workspaces/acme/com.acme.myapp/gwt/target/.generated [DEBUG] (f) generateDirectory = /home/jesse/workspaces/acme/com.acme.myapp/gwt/target/generated-sources/gwt [DEBUG] (f) gwtSdkFirstInClasspath = false [DEBUG] (f) inplace = false [DEBUG] (f) localRepository = id: local url: file:///home/jesse/.m2/repository/ layout: none [DEBUG] (f) logLevel = INFO [DEBUG] (f) module = com.acme.myapp.gwt.Application [DEBUG] (f) optimizationLevel = -1 [DEBUG] (f) pluginArtifacts = {org.codehaus.mojo:gwt-maven-plugin=org.codehaus.mojo:gwt-maven-plugin:maven-plugin:2.2.0:, org.apache.maven.reporting:maven-reporting-api=org.apache.maven.reporting:maven-reporting-api:jar:3.0:compile, org.apache.maven.reporting:maven-reporting-impl=org.apache.maven.reporting:maven-reporting-impl:jar:2.1:compile, org.apache.maven.doxia:doxia-core=org.apache.maven.doxia:doxia-core:jar:1.1.2:compile, commons-httpclient:commons-httpclient=commons-httpclient:commons-httpclient:jar:3.1:compile, commons-codec:commons-codec=commons-codec:commons-codec:jar:1.2:compile, commons-validator:commons-validator=commons-validator:commons-validator:jar:1.2.0:compile, commons-beanutils:commons-beanutils=commons-beanutils:commons-beanutils:jar:1.7.0:compile, commons-digester:commons-digester=commons-digester:commons-digester:jar:1.6:compile, oro:oro=oro:oro:jar:2.0.8:compile, org.apache.maven.doxia:doxia-sink-api=org.apache.maven.doxia:doxia-sink-api:jar:1.0:compile, org.apache.maven.doxia:doxia-site-renderer=org.apache.maven.doxia:doxia-site-renderer:jar:1.1.4:compile, org.apache.maven.doxia:doxia-logging-api=org.apache.maven.doxia:doxia-logging-api:jar:1.1.4:compile, org.apache.maven.doxia:doxia-decoration-model=org.apache.maven.doxia:doxia-decoration-model:jar:1.1.4:compile, org.apache.maven.doxia:doxia-module-xhtml=org.apache.maven.doxia:doxia-module-xhtml:jar:1.1.4:compile, org.apache.maven.doxia:doxia-module-fml=org.apache.maven.doxia:doxia-module-fml:jar:1.1.4:compile, org.codehaus.plexus:plexus-i18n=org.codehaus.plexus:plexus-i18n:jar:1.0-beta-7:compile, org.codehaus.plexus:plexus-velocity=org.codehaus.plexus:plexus-velocity:jar:1.1.7:compile, org.apache.velocity:velocity=org.apache.velocity:velocity:jar:1.5:compile, commons-collections:commons-collections=commons-collections:commons-collections:jar:3.2:compile, org.springframework:spring-core=org.springframework:spring-core:jar:3.0.5.RELEASE:compile, org.springframework:spring-asm=org.springframework:spring-asm:jar:3.0.5.RELEASE:compile, commons-logging:commons-logging=commons-logging:commons-logging:jar:1.1.1:compile, org.codehaus.plexus:plexus-utils=org.codehaus.plexus:plexus-utils:jar:2.0.5:compile, com.thoughtworks.qdox:qdox=com.thoughtworks.qdox:qdox:jar:1.12:compile, freemarker:freemarker=freemarker:freemarker:jar:2.3.6:compile, com.google.gwt:gwt-dev=com.google.gwt:gwt-dev:jar:2.2.0:compile, com.google.gwt:gwt-user=com.google.gwt:gwt-user:jar:2.2.0:compile, com.google.gwt:gwt-servlet=com.google.gwt:gwt-servlet:jar:2.2.0:compile, org.codehaus.plexus:plexus-archiver=org.codehaus.plexus:plexus-archiver:jar:1.0-alpha-9:compile, org.codehaus.plexus:plexus-io=org.codehaus.plexus:plexus-io:jar:1.0-alpha-1:compile, org.apache.maven:maven-archiver=org.apache.maven:maven-archiver:jar:2.4.1:compile, org.codehaus.plexus:plexus-interpolation=org.codehaus.plexus:plexus-interpolation:jar:1.13:compile, junit:junit=junit:junit:jar:4.8.1:compile, org.apache.maven.surefire:surefire-booter=org.apache.maven.surefire:surefire-booter:jar:2.4.3:compile, org.apache.maven.surefire:surefire-api=org.apache.maven.surefire:surefire-api:jar:2.4.3:compile, commons-lang:commons-lang=commons-lang:commons-lang:jar:2.5:compile, org.jdom:jdom=org.jdom:jdom:jar:1.1:compile, jaxen:jaxen=jaxen:jaxen:jar:1.1.1:compile, dom4j:dom4j=dom4j:dom4j:jar:1.6.1:compile, jdom:jdom=jdom:jdom:jar:1.0:compile, xml-apis:xml-apis=xml-apis:xml-apis:jar:1.3.02:compile, xom:xom=xom:xom:jar:1.0:compile, xerces:xmlParserAPIs=xerces:xmlParserAPIs:jar:2.6.2:compile, xalan:xalan=xalan:xalan:jar:2.6.0:compile, com.acme.icu:icu4j=com.acme.icu:icu4j:jar:2.6.1:compile, org.apache.bcel:bcel=org.apache.bcel:bcel:jar:5.2:compile, jakarta-regexp:jakarta-regexp=jakarta-regexp:jakarta-regexp:jar:1.4:compile, xerces:xercesImpl=xerces:xercesImpl:jar:2.9.1:compile, org.codehaus.plexus:plexus-compiler-api=org.codehaus.plexus:plexus-compiler-api:jar:1.5.3:compile, org.codehaus.plexus:plexus-compiler-javac=org.codehaus.plexus:plexus-compiler-javac:jar:1.5.3:compile} [DEBUG] (f) project = MavenProject: com.acme.myapp:gwt:0.2.4-SNAPSHOT @ /home/jesse/workspaces/acme/com.acme.myapp/gwt/pom.xml [DEBUG] (f) remoteRepositories = [ id: maven.pdl-public url: http://maven.pdl.pok.acme.com/content/groups/public/ layout: default snapshots: [enabled => false, update => daily] releases: [enabled => true, update => daily] , id: maven.pdl-public-snapshots url: http://maven.pdl.pok.acme.com/content/groups/public-snapshots/ layout: default snapshots: [enabled => true, update => daily] releases: [enabled => false, update => daily] , id: central url: http://repo1.maven.org/maven2 layout: default snapshots: [enabled => false, update => daily] releases: [enabled => true, update => daily] ] [DEBUG] (f) skip = false [DEBUG] (f) soyc = false [DEBUG] (f) soycDetailed = false [DEBUG] (f) strict = false [DEBUG] (f) style = DETAILED [DEBUG] (f) treeLogger = false [DEBUG] (f) validateOnly = false [DEBUG] (f) version = 2.2.0 [DEBUG] (f) warSourceDirectory = /home/jesse/workspaces/acme/com.acme.myapp/gwt/src/main/webapp [DEBUG] (f) webappDirectory = /home/jesse/workspaces/acme/com.acme.myapp/gwt/target/gwt-0.2.4-SNAPSHOT [DEBUG] -- end configuration -- [DEBUG] establishing classpath list (scope = compile) [DEBUG] candidate artifacts : 51 [DEBUG] GWT SDK execution classpath : [DEBUG] /home/jesse/workspaces/acme/com.acme.myapp/gwt/src/main/java [DEBUG] /home/jesse/workspaces/acme/com.acme.myapp/gwt/target/generated-sources/gwt [DEBUG] /home/jesse/workspaces/acme/com.acme.myapp/gwt/src/main/resources [DEBUG] /home/jesse/workspaces/acme/com.acme.myapp/gwt/target/maven-shared-archive-resources [DEBUG] /home/jesse/workspaces/acme/com.acme.myapp/gwt/target/gwt-0.2.4-SNAPSHOT/WEB-INF/classes [DEBUG] /home/jesse/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar [DEBUG] /home/jesse/.m2/repository/com/google/gwt/gwt-user/2.2.0/gwt-user-2.2.0.jar [DEBUG] /home/jesse/.m2/repository/com/google/gwt/google-apis/gwt-visualization/1.1.1/gwt-visualization-1.1.1.jar [DEBUG] /home/jesse/.m2/repository/com/acme/isvt/base/converter/0.0.71/converter-0.0.71.jar [DEBUG] /home/jesse/.m2/repository/com/acme/isvt/base/assertions/0.0.71/assertions-0.0.71.jar [DEBUG] /home/jesse/.m2/repository/net/sf/dozer/dozer/5.3.2/dozer-5.3.2.jar [DEBUG] /home/jesse/.m2/repository/commons-beanutils/commons-beanutils/1.8.3/commons-beanutils-1.8.3.jar [DEBUG] /home/jesse/.m2/repository/org/apache/xmlbeans/xmlbeans/2.4.0/xmlbeans-2.4.0.jar [DEBUG] /home/jesse/.m2/repository/stax/stax-api/1.0.1/stax-api-1.0.1.jar [DEBUG] /home/jesse/.m2/repository/com/acme/isvt/base/logging/0.0.71/logging-0.0.71.jar [DEBUG] /home/jesse/.m2/repository/com/acme/isvt/base/spring-gwt/0.0.71/spring-gwt-0.0.71.jar [DEBUG] /home/jesse/.m2/repository/org/springframework/spring-core/3.0.5.RELEASE/spring-core-3.0.5.RELEASE.jar [DEBUG] /home/jesse/.m2/repository/org/springframework/spring-webmvc/3.0.5.RELEASE/spring-webmvc-3.0.5.RELEASE.jar [DEBUG] /home/jesse/.m2/repository/org/springframework/spring-context-support/3.0.5.RELEASE/spring-context-support-3.0.5.RELEASE.jar [DEBUG] /home/jesse/.m2/repository/com/acme/isvt/base/gwt/bundles/0.0.71/bundles-0.0.71.jar [DEBUG] /home/jesse/.m2/repository/com/acme/isvt/base/gwt/events/0.0.71/events-0.0.71.jar [DEBUG] /home/jesse/.m2/repository/com/acme/isvt/base/gwt/misc/0.0.71/misc-0.0.71.jar [DEBUG] /home/jesse/.m2/repository/com/acme/isvt/base/gwt/services/0.0.71/services-0.0.71.jar [DEBUG] /home/jesse/.m2/repository/org/apache/commons/commons-email/1.2/commons-email-1.2.jar [DEBUG] /home/jesse/.m2/repository/javax/mail/mail/1.4.1/mail-1.4.1.jar [DEBUG] /home/jesse/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar [DEBUG] /home/jesse/.m2/repository/commons-io/commons-io/2.0.1/commons-io-2.0.1.jar [DEBUG] /home/jesse/.m2/repository/com/acme/isvt/base/properties/0.0.71/properties-0.0.71.jar [DEBUG] /home/jesse/.m2/repository/com/acme/isvt/base/threads/0.0.71/threads-0.0.71.jar [DEBUG] /home/jesse/.m2/repository/com/acme/isvt/base/gwt/visualizations/0.0.71/visualizations-0.0.71.jar [DEBUG] /home/jesse/.m2/repository/com/acme/isvt/base/gwt/widgets/0.0.71/widgets-0.0.71.jar [DEBUG] /home/jesse/.m2/repository/com/acme/isvt/myapp/domain/0.2.4-SNAPSHOT/domain-0.2.4-SNAPSHOT.jar [DEBUG] /home/jesse/.m2/repository/com/acme/isvt/base/dao-jpa/0.0.71/dao-jpa-0.0.71.jar [DEBUG] /home/jesse/.m2/repository/org/apache/openjpa/openjpa-kernel/2.1.0/openjpa-kernel-2.1.0.jar [DEBUG] /home/jesse/.m2/repository/org/apache/geronimo/specs/geronimo-jms_1.1_spec/1.1.1/geronimo-jms_1.1_spec-1.1.1.jar [DEBUG] /home/jesse/.m2/repository/org/apache/geronimo/specs/geronimo-jta_1.1_spec/1.1.1/geronimo-jta_1.1_spec-1.1.1.jar [DEBUG] /home/jesse/.m2/repository/commons-pool/commons-pool/1.5.4/commons-pool-1.5.4.jar [DEBUG] /home/jesse/.m2/repository/com/acme/isvt/base/validation/0.0.71/validation-0.0.71.jar [DEBUG] /home/jesse/.m2/repository/org/apache/geronimo/specs/geronimo-jpa_2.0_spec/1.1/geronimo-jpa_2.0_spec-1.1.jar [DEBUG] /home/jesse/.m2/repository/org/apache/geronimo/specs/geronimo-validation_1.0_spec/1.1/geronimo-validation_1.0_spec-1.1.jar [DEBUG] /home/jesse/.m2/repository/org/apache/openjpa/openjpa-persistence/2.1.0/openjpa-persistence-2.1.0.jar [DEBUG] /home/jesse/.m2/repository/com/acme/isvt/myapp/service/0.2.4-SNAPSHOT/service-0.2.4-SNAPSHOT.jar [DEBUG] /home/jesse/.m2/repository/com/acme/isvt/myapp/dao/0.2.4-SNAPSHOT/dao-0.2.4-SNAPSHOT.jar [DEBUG] /home/jesse/.m2/repository/org/apache/openjpa/openjpa-lib/2.1.0/openjpa-lib-2.1.0.jar [DEBUG] /home/jesse/.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar [DEBUG] /home/jesse/.m2/repository/net/sourceforge/serp/serp/1.13.1/serp-1.13.1.jar [DEBUG] /home/jesse/.m2/repository/junit/junit/4.8.2/junit-4.8.2.jar [DEBUG] /home/jesse/.m2/repository/org/springframework/spring-tx/3.0.5.RELEASE/spring-tx-3.0.5.RELEASE.jar [DEBUG] /home/jesse/.m2/repository/org/springframework/spring-beans/3.0.5.RELEASE/spring-beans-3.0.5.RELEASE.jar [DEBUG] /home/jesse/.m2/repository/org/springframework/spring-context/3.0.5.RELEASE/spring-context-3.0.5.RELEASE.jar [DEBUG] /home/jesse/.m2/repository/org/springframework/spring-aop/3.0.5.RELEASE/spring-aop-3.0.5.RELEASE.jar [DEBUG] /home/jesse/.m2/repository/org/springframework/spring-expression/3.0.5.RELEASE/spring-expression-3.0.5.RELEASE.jar [DEBUG] /home/jesse/.m2/repository/org/springframework/spring-asm/3.0.5.RELEASE/spring-asm-3.0.5.RELEASE.jar [DEBUG] /home/jesse/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar [DEBUG] /home/jesse/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar [DEBUG] /home/jesse/.m2/repository/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar [DEBUG] NOT create extra directory [DEBUG] SOYC disabled [DEBUG] GWT module com.acme.myapp.gwt.Application found in /home/jesse/workspaces/acme/com.acme.myapp/gwt/src/main/resources
I think it would be better if the GWT modules would be found from the classpath instead. I am not sure of all the consequences though..
gwt:compile run later in lifecycle but generating source run at ... generate-source phase.
Those source are required for IDE import, standard compile phase, etc
I can't see a simple non-hack to make it happen after ressource filtering, that would require to change the default lifecycle, that is not in the scope of this plugin and would break many users builds.
@jieryn: your issue is different from the one originally reported here. What you're asking basically is that {{$
{project.build.outputDirectory}}} be added to the classpath before src/main/resources, so that your filtered resources is picked up, rather than your non-filtered one. Please open another issue (if you haven't already).
I use workaround that I have two maven modules. One with packaging jar and gwt module containing placeholders which are translated by resources plugin. Second with packaging war and gwt module which inherits from first gwt module and is build by gwt-maven-plugin.
Hope this helps
PING! This is unresolved in both 2.2.0 and 2.2.0-1-SNAPSHOT (r13979). Even renaming to MyModule.gwt.xml.vm did not solve the problem, nor did hard coding the configuration.module option. It seems like it should be a simple fix since it is just classpath reordering.