Question

I've read several other questions and answers here, none of which seem to help me. I'm trying to build a mgwt project that will have lots of permutations so the memory setting must be really high.

I'm using the maven4eclipse plugin to build with package as the goal, on the jre tab of my run configuration I have set the following

vm args:-Xms1024m -Xmx2048m -XX:MaxPermSize=1024m -XX:ReservedCodeCacheSize=64m

When attempting to run it fails and comes back with this error:

[ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.3.0-1:compile (default) on project: Command [[
[ERROR] **C:\Program Files\Java\jdk1.7.0_17\jre\bin\java -Xmx512m** -classpath "..others stuff" -logLevel INFO -style OBF -war "Branch(mobile)\Project\target\Mobile-webcontent" -localWorkers 8
[ERROR] ]] failed with status 1
[ERROR] -> [Help 1]

That shows to me the arguments I've set are not being used, am I setting it in the wrong place?

Was it helpful?

Solution

Sample POM file for GWT compilation with settings configured for most GWT Compiler options including JVM options.

    <plugins>
        <!-- GWT Maven Plugin -->
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>gwt-maven-plugin</artifactId>
            <dependencies>
                <dependency>
                    <groupId>com.google.gwt</groupId>
                    <artifactId>gwt-user</artifactId>
                    <version>${gwt.version}</version>
                </dependency>
                <dependency>
                    <groupId>com.google.gwt</groupId>
                    <artifactId>gwt-codeserver</artifactId>
                    <version>${gwt.version}</version>
                </dependency>                   
                <dependency>
                    <groupId>com.google.gwt</groupId>
                    <artifactId>gwt-dev</artifactId>
                    <version>${gwt.version}</version>
                </dependency>
                <dependency>
                    <groupId>com.google.gwt</groupId>
                    <artifactId>gwt-servlet</artifactId>
                    <version>${gwt.version}</version>
                </dependency>
            </dependencies>
            <!-- JS is only needed in the package phase, this speeds up testing -->
            <executions>
                <execution>
                    <phase>prepare-package</phase>
                    <goals>
                        <goal>compile</goal>
                    </goals>
                </execution>
            </executions>
            <!-- Plugin configuration. There are many available options, see gwt-maven-plugin 
                documentation at codehaus.org -->
            <configuration>
                <skip>true</skip>
                <strict>true</strict>
                <runTarget>app.html</runTarget>
                <!-- Turning This on after understanding soyc -->
                <!-- https://developers.google.com/web-toolkit/articles/fragment_merging -->
                <!-- <fragmentCount>95</fragmentCount> -->
                <!-- Ask GWT to create the Story of Your Compile (SOYC) (gwt:compile) -->
                <!-- Turn This on for generating soyc. This does not work if closure 
                    compiler is turned on. -->
                <compileReport>false</compileReport>
                <compilerMetrics>false</compilerMetrics>
                <soycDetailed>false</soycDetailed>
                <!-- End Generating SOYC -->
                <disableCastChecking>true</disableCastChecking>
                <disableClassMetadata>true</disableClassMetadata>
                <enableClosureCompiler>true</enableClosureCompiler>
                <optimizationLevel>9</optimizationLevel>
                <style>${gwt.style}</style>
                <module>${gwt.module}</module>
                <encoding>${project.build.sourceEncoding}</encoding>
                <logLevel>INFO</logLevel>
                <!-- ERROR, WARN, INFO, TRACE, DEBUG, SPAM, or ALL). -->
                <copyWebapp>true</copyWebapp>
                <hostedWebapp>${project.build.directory}/${project.artifactId}</hostedWebapp>
                <extraJvmArgs>-Xmx4096M -Xms1024M -XX:PermSize=128m -XX:MaxPermSize=256m</extraJvmArgs>
                <!-- <extraJvmArgs>-Xmx1024M -Xms1024m -Xss32m -XX:PermSize=64m -XX:MaxPermSize=128m -XX:+UseCompressedOops -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled -DgeneratePom=true -XX:ReservedCodeCacheSize=128m -XX:+PrintCompilation -server</extraJvmArgs> -->
                <extra>${project.build.directory}/gwt-extra</extra>
                <deploy>${project.build.directory}/gwt-deploy</deploy>
                <localWorkers>4</localWorkers>
            </configuration>
        </plugin>

OTHER TIPS

The gwt-maven-plugin forks a JVM and won't inherit the settings from the JVM used to run Maven.

If you need specific JVM settings for the forked JVM, you can set them using the <extraJvmArgs> in the <configuration> of the gwt-maven-plugin in your POM, or -Dgwt.extraJvmArgs="-Xms1g -Xmx2g" on the command line.

See http://www.mojohaus.org/gwt-maven-plugin/compile-mojo.html#extraJvmArgs

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top