Hi,

I am trying to compile the GWT code in Production mode so that I don't have 
any Dev mode code in my generated JavaScript file. I have a Production App 
that I build using Maven and am not able to compile the code in Production 
mode. I set production mode to be true for my gwt-maven-plugin in pom file, 
as follows. But, I still get hosted mode code generated. What can I do, to 
compile in Production mode using maven? Is there a flag/property I can set 
in my pom file or *.gwt.xml file or somewhere else?

            <!-- 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 in GWT example using Ant, you can compile in production. 
Following gets called in its build.xml file. Can I do similarly in maven? 
Is there an example to use Ant with Maven without changing the existing 
maven structure? 

  <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>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to