Tạo mô-đun MavenFilteredHơn mô-đun chung đặt user.agent
từ các cấu hình khác nhau trong tệp pom.xml.
MavenFilteredUserAgent.gwt.xml
...
<set-property name="user.agent" value="${gwt.compile.user.agent}" />
...
pom.xml
...
<properties>
<!-- By default we still want all five rendering engines when none of the following profiles is explicitly specified -->
<gwt.compile.user.agent>ie6,ie8,gecko,gecko1_8,safari,opera</gwt.compile.user.agent>
</properties>
<profiles>
<profile>
<id>gwt-firefox</id>
<properties>
<gwt.compile.user.agent>gecko1_8</gwt.compile.user.agent>
</properties>
</profile>
</profiles>
<!-- Add additional profiles for the browsers you want to singly support -->
....
<build>
<resources>
<resource>
<!-- Put the filtered source files into a directory that later gets added to the build path -->
<directory>src/main/java-filtered</directory>
<filtering>true</filtering>
<targetPath>${project.build.directory}/filtered-sources/java</targetPath>
</resource>
<resource>
<directory>${project.basedir}/src/main/resources</directory>
</resource>
</resources>
<plugins>
...
<plugin>
<!-- Add the filtered sources directory to the build path-->
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/filtered-sources/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
...
</plugins>
...
Có tất cả các module của bạn kế thừa các mô-đun MavenFilteredUserAgent.
Sau đó, bạn có thể xây dựng cho chỉ firefox như vậy.
mvn install -Pgwt-firefox
http://9mmedia.com/blog/?p=854 có thêm chi tiết.
Trang web của bạn có thể truy cập công khai không? Ở đâu? –
Tôi cũng muốn xem nó cho Ant. – Glenn
@Don Branson: không, trang web không được công khai. –