Here is the module (vaadin UI) structure:
src
- main
- java
- resources
- VAADIN.themes
- myproject.gwt.xml
- webapp
- WEB-INF
In order to strict gwt permutations I created a property that has different values depending on a build profile (gecko1_8 for debug and all permutations for production). So in order to replace property with a value I use resource filtering. But vaadin-maven-plugin copies (resources goal) gwt.xml file without changes. So if I remove resources goal - filtering works great. So here is how my module pom.xml looks like:
...
<!--Artifact info-->
<groupId>vaadin-ui</groupId>
<artifactId>vaadin-ui</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>Vaadin UI</name>
<!--Properties-->
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sour <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<vaadin.version>7.0.5</vaadin.version>
<gwt.restrict.user.agents>gecko1_8</gwt.restrict.user.agents>
</properties>
...
<!--Dependencies-->
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-server</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiled</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client</artifactId>
<version>${vaadin.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-themes</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<!--module dependency-->
<dependency>
<groupId>another-module</groupId>
<artifactId>another-module</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/myproject.gwt.xml</include>
</includes>
<excludes>
<exclude>**/VAADIN.themes/*</exclude>
</excludes>
</resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
<filtering>false</filtering>
<includes>
<include>**/VAADIN.themes/*</include>
</includes>
<excludes>
<exclude>**/myproject.gwt.xml</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<!-- As we are doing "inplace" GWT compilation, ensure the widgetset -->
<!-- directory is cleaned properly -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<filesets>
<fileset>
<directory>${basedir}/src/main/webapp/VAADIN/</directory>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.version}</version>
<configuration>
<extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
<!-- We are doing "inplace" but into subdir VAADIN/widgetsets. This
way compatible with Vaadin eclipse plugin. -->
<webappDirectory>
${basedir}/src/main/webapp/VAADIN/widgetsets
</webappDirectory>
<hostedWebapp>
${basedir}/src/main/webapp/VAADIN/widgetsets
</hostedWebapp>
<noServer>true</noServer>
<!-- Remove draftCompile when project is ready -->
<draftCompile>false</draftCompile>
<compileReport>true</compileReport>
<style>OBF</style>
<strict>true</strict>
<runTarget>http://localhost:8080/</runTarget>
</configuration>
<executions>
<execution>
<configuration>
<!-- if you don't specify any modules, the plugin will find them -->
<!-- <modules> <module>com.vaadin.demo.mobilemail.gwt.ColorPickerWidgetSet</module>
</modules> -->
</configuration>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
...
</plugins>
</build>
</project>
The problem is that in the end of a building process I get vaadin-ui.war file along with vaadin-ui-sources.jar, vaadin-ui-classes.jar and classes dir within target folder. And none of the jars or folders contain VAADIN/themes/. If I return goal resources to vaadin-maven-plugin, then VAADIN/themes/ are copied, but filtering stops working. After some experiments, I managed to get VAADIN/themes in classes folder but still it is absent in result .war file.
Why filtering doesn’t work with vaadin-maven-plugin? Maybe there’s a solution how to substitute properties and copy