0

I have a GWT project, with 3 modules :

- MyProject
- MyProjectProduit
- CatalogueConnecte

I need to have some resources (html files) filtered, to get the ${project.version} in them.

The war generated by maven have this format :

META-INF/
...
WEB-INF/
  classes/
  ...
  MyProject.html -> Filtered
  MyProjectproduit.html -> Filtered
  CatalogueConnecte.html -> Filtered
  ...
  deploy/
  lib/
  web.xml

com.al6.myProject.gwt.MyProject/
  css/
  gwt/chrome/
  gxt/
  help/
  images/
  MyProject.html -> Not Filtered
  MyProjectproduit.html -> Not Filtered
  CatalogueConnecte.html -> Not Filtered
...

com.al6.myProject.gwt.MyProjectProduit/
  css/
  gwt/chrome/
  gxt/
  help/
  images/
  MyProject.html -> Not Filtered
  MyProjectproduit.html -> Not Filtered
  CatalogueConnecte.html -> Not Filtered
...

com.al6.myProject.gwt.CatalogueConnecte/
  css/
  gwt/chrome/
  gxt/
  help/
  images/
  MyProject.html -> Not Filtered
  MyProjectproduit.html -> Not Filtered
  CatalogueConnecte.html -> Not Filtered
  ...

With this pom.xml configuration, the filtering works but only for the html files in the WEB-INF directory, not in each com.al6.myProject.gwt... directories.

Why ?

<?xml version="1.0" encoding="UTF-8"?><project>
  <parent>
    <artifactId>myProject</artifactId>
    <groupId>com.al6</groupId>
    <version>0.0.1-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.al6</groupId>
  <artifactId>myProject.ihm</artifactId>
  <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <build>
    <resources>
      <resource>
        <directory>src/main/java</directory>
        <filtering>true</filtering>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
      <resource>
        <directory>src/main/java/com/al6/myProject/gwt/public/images</directory>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>src/main/jasperreports</directory>
      </resource>
    </resources>
    <finalName>myProject</finalName>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <configuration>
            <encoding>UTF-8</encoding>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jasperreports-maven-plugin</artifactId>
        <version>1.0-beta-2</version>
        <executions>
          <execution>
            <goals>
              <goal>compile-reports</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>com.al6.ireport</groupId>
            <artifactId>jasperreports</artifactId>
            <version>${jasperreports.version}</version>
          </dependency>
          <dependency>
            <groupId>com.al6.ireport</groupId>
            <artifactId>ireport</artifactId>
            <version>3.0.0</version>
          </dependency>
          <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.1.1</version>
          </dependency>
          <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
            <version>3.2.1</version>
          </dependency>
          <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <version>1.8.3</version>
          </dependency>
          <dependency>
            <groupId>commons-digester</groupId>
            <artifactId>commons-digester</artifactId>
            <version>2.1</version>
          </dependency>
          <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>4.0.6.RELEASE</version>
            <exclusions>
              <exclusion>
                <artifactId>commons-logging</artifactId>
                <groupId>commons-logging</groupId>
              </exclusion>
              <exclusion>
                <artifactId>jta</artifactId>
                <groupId>javax.transaction</groupId>
              </exclusion>
            </exclusions>
          </dependency>
        </dependencies>
        <configuration>
          <outputDirectory>${project.build.directory}/classes/jasperreports</outputDirectory>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>2.4.0</version>
        <executions>
          <execution>
            <goals>
              <goal>mergewebxml</goal>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <logLevel>INFO</logLevel>
          <compileTargets>
            <value>com.al6.myProject.gwt.MyProject</value>
            <value>com.al6.myProject.gwt.MyProjectProduit</value>
            <value>com.al6.myProject.gwt.CatalogueConnecte</value>
          </compileTargets>
          <runTarget>com.al6.myProject.gwt.MyProject/MyProject.html</runTarget>
          <style>OBF</style>
          <noServer>false</noServer>
          <extraJvmArgs>-Xmx872m</extraJvmArgs>
          <gwtVersion>${gwt.version}</gwtVersion>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.1.1</version>
        <executions>
          <execution>
            <goals>
              <goal>war</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <outputDirectory>${deploy.dir}</outputDirectory>
          <webXml>${project.build.directory}/web.xml</webXml>
          <warSourceExcludes>.gwt-tmp</warSourceExcludes>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    ...
  </dependencies>
  <properties>
    <gwt.version>2.4.0</gwt.version>
    <deploy.dir>${project.build.directory}</deploy.dir>
  </properties>
</project>
user2178964
  • 124
  • 6
  • 16
  • 40

0 Answers0