<!-- Compile Using GWT -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.5.1</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<productionMode>true</productionMode>
<classifier>war</classifier>
<warSourceDirectory>src/main/webapp</warSourceDirectory>
<webappDirectory>war</webappDirectory>
<module>${Module Name}</module>
<extraJvmArgs>${gwt.extraJvmArgs}</extraJvmArgs>
</configuration>
</execution>
</executions>
</plugin>
I see that Ant lets you compile in production mode by using following in build.xml file. Is there a way I can do this in maven? Or using Ant plugin in Maven? (If yes please share an example or point me to a good doc)
<target name="gwtc" depends="javac" description="GWT compile to JavaScript (production mode)">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
<classpath>
<pathelement location="src"/>
<path refid="project.class.path"/>
<pathelement location="../../validation-api-1.0.0.GA.jar" />
<pathelement location="../../validation-api-1.0.0.GA-sources.jar" />
</classpath>
<!-- add jvmarg -Xss16M or similar if you see a StackOverflowError -->
<jvmarg value="-Xmx256M"/>
<arg line="-war"/>
<arg value="war"/>
<!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
<arg line="${gwt.args}"/>
<arg value="com.google.gwt.sample.hello.Hello"/>
</java>
</target>
function isHostedMode(){
var result = false;
try {
var query = $wnd_0.location.search;
return (query.indexOf('gwt.codesvr=') != -1 || (query.indexOf('gwt.hosted=') != -1 || $wnd_0.external && $wnd_0.external.gwtOnLoad)) && query.indexOf('gwt.hybrid') == -1;
}
catch (e) {
}
isHostedMode = function(){
return result;
}
;
return result;
}if (isHostedMode()) {
alert('Cross-site hosted mode not yet implemented. See issue ' + 'http://code.google.com/p/google-web-toolkit/issues/detail?id=2079');
return;
}I changed the linker to use 'xsiframe' as suggested and the code change in the generated code are as follows.
function isHostedMode(){ var query = $wnd_0.location.search; return query.indexOf('gwt.codesvr.Hello=') != -1 || query.indexOf('gwt.codesvr=') != -1; }if (isHostedMode()) { return computeUrlForResource('Hello.devmode.js');
}
Is the any flag/property I can set so that above method doesn't get generated?