Mojo's GWT Maven Plugin
  1. Mojo's GWT Maven Plugin
  2. MGWT-216

Resource Filtering, does not filter all copy's of the resources.

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 2.1.0-1
    • Labels:
      None
    • Number of attachments :
      0

      Description

      About

      When applying maven resource filtering (http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html) only partial support is encountered.

      Example:

      My 'com.acme.gwtproject.GwtProject' uses the standard gwt-maven directory layout, consequently my html is located at...

      ./src/main/resources/com/acme/gwtproject/public/GwtProject.html

      If GwtProject.html contains a token say $

      {project.version} I want to see this in the released artifacts, released sources artifacts and in dev mode. But the build lifecycle only seems to filter/replace one copy of the file, that strangely end's up @ ./war/WEB-INF/classes/GwtProject.html <--- weird location!

      NOTE: I don't believe that this has anything todo with the bug, but my project is <packaging>jar</packaging>

      h1. Reproduce

      To reproduce this, and the following to a pom.
      	<build>
      	...
      		<resources>
      			<resource>
      				<directory>src/main/java</directory>
      			</resource>
      			<resource>
      				<directory>src/main/resources</directory>
      				<filtering>true</filtering>
      			</resource>
      		</resources>
      	...
      	<build>
      


      Then add a token to your project's html file...
      ${project.version}

      Try 'gwt:run', look at the html source and see it has not been filtered.
      Also try 'install' to build the war/jar and take a look at it's contents, the html file would not have been filtered within these artifacts.

        Issue Links

          Activity

          Hide
          Sean Flanigan added a comment -

          The same applies to property expansion in a GWT module descriptor (MyApp.gwt.xml). It looks to me like the original, unfiltered directory "src/main/resources" is added to the GWT compiler's classpath ahead of "target/classes". So even if the Resources plugin has done the filtering, GWT ignores it.

          Show
          Sean Flanigan added a comment - The same applies to property expansion in a GWT module descriptor (MyApp.gwt.xml). It looks to me like the original, unfiltered directory "src/main/resources" is added to the GWT compiler's classpath ahead of "target/classes". So even if the Resources plugin has done the filtering, GWT ignores it.
          Olivier Lamy made changes -
          Field Original Value New Value
          Fix Version/s 2.1.x [ 16941 ]
          Olivier Lamy made changes -
          Link This issue is duplicated by MGWT-222 [ MGWT-222 ]
          Hide
          Olivier Lamy added a comment -

          can you try with the trunk and using the copyWebapp mojo parameter ? (or -Dgwt.copyWebapp=true)

          Show
          Olivier Lamy added a comment - can you try with the trunk and using the copyWebapp mojo parameter ? (or -Dgwt.copyWebapp=true)
          Hide
          Geoffrey De Smet added a comment -

          Can't test on trunk because trunk doesn't work for us. We had to fork it due to MGWT-219

          Show
          Geoffrey De Smet added a comment - Can't test on trunk because trunk doesn't work for us. We had to fork it due to MGWT-219
          Hide
          Olivier Lamy added a comment -

          release starting so mark this as fixed.
          If not please open a new issue.

          Show
          Olivier Lamy added a comment - release starting so mark this as fixed. If not please open a new issue.
          Olivier Lamy made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Assignee Olivier Lamy [ olamy ]
          Fix Version/s 2.1.0-1 [ 16878 ]
          Fix Version/s 2.1.x [ 16941 ]
          Resolution Fixed [ 1 ]
          Benjamin Peter made changes -
          Comment [ I don't see why we should open a new task for this and why it was closed in the first place. It is not fixed in 2.1.0-1 or 2.2.0 from my experience.

          Following command is executed:

          /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
          ]
          Hide
          Benjamin Peter added a comment -

          Created MGWT-285 please vote and comment there if you have the same problem.

          Show
          Benjamin Peter added a comment - Created MGWT-285 please vote and comment there if you have the same problem.
          Hide
          Andrew Hughes added a comment - - edited

          Tested with 2.2.0 and maven 3.0.2. The html page and WEB-INF/web.xml located in src/main/webapp - this is the maven default location for such content in 2.1+ and also is used in the archetype (the issue was raised in 2.0 and the location was different, as described in the issue description).

          Repeating the Test

          Added the following to the pom.xml

          	<build>
          		<resources>
          			<resource>
          				<directory>src/main/webapp</directory>
          				<filtering>true</filtering>
          			</resource>
          		</resources>
          	        ...
          	<build>	
          

          Add the following to src/main/webapp/TheAppsPage.html

          ...
          <title>${project.artifactId}</title>
          ...
          

          Sorry to report...

          Filtering did not work with this configuration as desired.

          I would kindly request that if this is closed, could you please provide some documentation (either here or even better, on the gwt-maven-plugins maven site). No doubt that this was not closed accidently, does it have anything todo with this http://mojo.codehaus.org/gwt-maven-plugin/resources-mojo.html ?

          Any help would be great

          Show
          Andrew Hughes added a comment - - edited Tested with 2.2.0 and maven 3.0.2. The html page and WEB-INF/web.xml located in src/main/webapp - this is the maven default location for such content in 2.1+ and also is used in the archetype (the issue was raised in 2.0 and the location was different, as described in the issue description). Repeating the Test Added the following to the pom.xml <build> <resources> <resource> <directory>src/main/webapp</directory> <filtering>true</filtering> </resource> </resources> ... <build> Add the following to src/main/webapp/TheAppsPage.html ... <title>${project.artifactId}</title> ... Sorry to report... Filtering did not work with this configuration as desired. I would kindly request that if this is closed, could you please provide some documentation (either here or even better, on the gwt-maven-plugins maven site). No doubt that this was not closed accidently, does it have anything todo with this http://mojo.codehaus.org/gwt-maven-plugin/resources-mojo.html ? Any help would be great

            People

            • Assignee:
              Olivier Lamy
              Reporter:
              Andrew Hughes
            • Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: