Skip to content

Instantly share code, notes, and snippets.

@branflake2267
Created September 22, 2017 20:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save branflake2267/f674d0d69882d84e1b3437cc1a08ca31 to your computer and use it in GitHub Desktop.
Save branflake2267/f674d0d69882d84e1b3437cc1a08ca31 to your computer and use it in GitHub Desktop.
Add GWT maven build properties to module.gwt.xml from maven. I wanted to speed up the build by specifying specific binding properties.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.8.1//EN"
"http://gwtproject.org/doctype/2.8.1/gwt-module.dtd">
<module rename-to='explorer'>
<!-- ... -->
<!-- The property below is replaced from maven profile mvn install -Pfast-build -->
<!--{profile.fast.build}-->
</module>
<!-- Incomplete pom.xml -->
<!-- Define a profile in the pom.xml -->
<profile>
<id>fast-build</id>
<properties>
<profile.fast.build>
&lt;set-property name="user.agent" value="safari" /&gt;
&lt;set-property name="gxt.user.agent" value="chrome" /&gt;
&lt;set-property name="gxt.device" value="desktop" /&gt;
&lt;set-property name="gxt.theme" value="triton" /&gt;
</profile.fast.build>
</properties>
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<filtering>true</filtering>
<includes>
<!-- only filter gwt.xml module descriptors -->
<include>**/*.gwt.xml</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<encoding>UTF-8</encoding>
<!-- Define a custom delimiter for property replacement in the module.gwt.xml file -->
<delimiters>&lt;!--{*}--&gt;</delimiters>
</configuration>
</plugin>
</plugins>
</build>
</profile>
@branflake2267
Copy link
Author

branflake2267 commented Sep 22, 2017

I run it with mvn clean install -Pfast-build

Optional handy parameters and some can speed a compile too.

<configuration>
  <compileReport>true</compileReport> <!-- Used for debugging build -->
  <compilerMetrics>true</compilerMetrics> <!-- Used for debugging build -->
  <draftCompile>true</draftCompile>
  <maven.javadoc.skip>true</maven.javadoc.skip>
</configuration>

@gabrielstelmach
Copy link

gabrielstelmach commented Jun 17, 2019

Hey mate, thank you for sharing! It worked great here.

Just a small correction at line 34: <delimiters><delimiter>&lt;!--{*}--&gt;</delimiter></delimiters>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment