Author: jjamrich
Date: 2011-10-17 19:39:24 -0400 (Mon, 17 Oct 2011)
New Revision: 22815
Modified:
modules/tests/metamer/trunk/ftest/pom.xml
Log:
Add profiles for changes context params in web.xml
This newly added profiles provide additional functionality to ftest process. Firstly
unpack maven dependency - metamer-*.war, then update web.xml's context-params (related
to richfaces resources mapping/compressing) and then pack metamer back to war.
Modified: modules/tests/metamer/trunk/ftest/pom.xml
===================================================================
--- modules/tests/metamer/trunk/ftest/pom.xml 2011-10-17 11:36:24 UTC (rev 22814)
+++ modules/tests/metamer/trunk/ftest/pom.xml 2011-10-17 23:39:24 UTC (rev 22815)
@@ -440,6 +440,190 @@
<deployable.classifier>jee6</deployable.classifier>
</properties>
</profile>
+
+ <!-- unpack metamer -->
+ <profile>
+ <id>unpack-metamer</id>
+ <activation>
+ <property>
+ <name>org.richfaces.resourceMapping.enabled</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack-metamer-war</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+
<groupId>org.richfaces.tests</groupId>
+ <artifactId>metamer</artifactId>
+
<version>4.1.0-SNAPSHOT</version>
+ <type>war</type>
+
<classifier>${deployable.classifier}</classifier>
+ <overWrite>true</overWrite>
+
<outputDirectory>target/metamer</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+
<overWriteReleases>true</overWriteReleases>
+
<overWriteSnapshots>true</overWriteSnapshots>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!-- enable resource mapping by context-param in web.xml -->
+ <profile>
+ <id>org.richfaces.resourceMapping.enabled</id>
+ <activation>
+ <property>
+ <name>org.richfaces.resourceMapping.enabled</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+
<groupId>com.google.code.maven-replacer-plugin</groupId>
+ <artifactId>maven-replacer-plugin</artifactId>
+ <version>1.3.9</version>
+ <executions>
+
+ <execution>
+
<id>replacer-org.richfaces.resourceMapping.enabled</id>
+ <phase>process-test-resources</phase>
+ <goals>
+ <goal>replace</goal>
+ </goals>
+ <configuration>
+
<file>target/metamer/WEB-INF/web.xml</file>
+ <regex>false</regex>
+
<token><param-name>org.richfaces.resourceMapping.enabled</param-name>\s*<param-value>false</param-value>></token>
+
<value><param-name>org.richfaces.resourceMapping.enabled</param-name>\n\t<param-value>true</param-value>></value>
+ </configuration>
+ </execution>
+
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!-- enable resource mapping compressedStages -->
+ <profile>
+ <id>org.richfaces.resourceMapping.compressedStages</id>
+ <activation>
+ <property>
+ <name>org.richfaces.resourceMapping.compressedStages</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+
<groupId>com.google.code.maven-replacer-plugin</groupId>
+ <artifactId>maven-replacer-plugin</artifactId>
+ <version>1.3.9</version>
+ <executions>
+ <execution>
+
<id>replacer-org.richfaces.resourceMapping.compressedStages</id>
+ <phase>generate-test-resources</phase>
+ <goals>
+ <goal>replace</goal>
+ </goals>
+ <configuration>
+
<file>target/metamer/WEB-INF/web.xml</file>
+ <regex>true</regex>
+ <regexFlags>
+ <regexFlag>MULTILINE</regexFlag>
+ </regexFlags>
+
<token><param-name>org.richfaces.resourceMapping.compressedStages</param-name>\s*<param-value>None</param-value></token>
+
<value><param-name>org.richfaces.resourceMapping.compressedStages</param-name><param-value>All</param-value></value>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!-- enable resource mapping packedStages -->
+ <profile>
+ <id>org.richfaces.resourceMapping.packedStages</id>
+ <activation>
+ <property>
+ <name>org.richfaces.resourceMapping.packedStages</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+
<groupId>com.google.code.maven-replacer-plugin</groupId>
+ <artifactId>maven-replacer-plugin</artifactId>
+ <version>1.3.9</version>
+ <executions>
+ <execution>
+
<id>replacer-org.richfaces.resourceMapping.packedStages</id>
+ <phase>generate-test-resources</phase>
+ <goals>
+ <goal>replace</goal>
+ </goals>
+ <configuration>
+
<file>target/metamer/WEB-INF/web.xml</file>
+ <regex>true</regex>
+ <regexFlags>
+ <regexFlag>MULTILINE</regexFlag>
+ </regexFlags>
+
<token><param-name>org.richfaces.resourceMapping.packedStages</param-name>\s*<param-value>None</param-value></token>
+
<value><param-name>org.richfaces.resourceMapping.packedStages</param-name><param-value>All</param-value></value>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!-- pack metamer back to WAR -->
+ <profile>
+ <id>repack-metamer</id>
+ <activation>
+ <property>
+ <name>org.richfaces.resourceMapping.enabled</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+
<classifier>${deployable.classifier}</classifier>
+
<webappDirectory>target/metamer</webappDirectory>
+ <warName>metamer-updated</warName>
+ </configuration>
+ <executions>
+ <execution>
+ <id>repack-metamer-back-to-war</id>
+ <phase>generate-test-resources</phase>
+ <goals>
+ <goal>war</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
</profiles>
<build>