Take the 2-minute tour ×

My Maven build process gets killed at the OS level when it tries to compile GWT so the build does not finish and does not report either success or fail. I ran mvn3 with the -X option and here is where it happens:

[DEBUG] Execute command :
/bin/sh -c /usr/lib/jvm/java-6-sun- -Xmx512m -classpath <really_long_classpath> com.google.gwt.dev.Compiler -gen <path_loc> -logLevel INFO -style OBF -war <war_path> -localWorkers 1 <module_path>
./build.sh: line 2: 24139 Killed                  mvn3 -X clean install blah blah

When I take the command out of Maven and run it solo, I get the same failure. However, when I just run Java without /bin/sh -c, GWT compiles fine.

Why does Maven use /bin/sh? My default shell on Ubuntu 10.04 is bash.

share|improve this question
You system probably told you why in one of the systems' logs. Probably at /var/log/messages or some other file in /var/log/. You can list all files ordered by time, latest last, by executing "ls -ltr /var/log/" –  thibaultd Oct 8 '13 at 18:49
add comment

1 Answer

There is no reason for the command working without the 'sh -c', but who knows.

The mvn command is just a shell script which set the appropriate java environment to run java with the maven class. It uses /bin/sh because it is set in the first line of the script. If you want to use bash just change the first line of the script !/bin/sh by !/bin/bash.

Anyway, it seems your ubuntu is killing the compiler because it is taking more resources that it is allowed. Take a look to your /var/log/syslog file to see the reason why the kernel killed the build.

1- Try to reconfigure gwt-maven plugin in your pom.xml so as it only launches a worker


2- try to increase memory of the gwt compiler process


3- try to run maven with more memory

 $ export MAVEN_OPTS="-Xmx1g"

4- take a look to your shell ulimit and increase the appropriate parameters

 $ ulimit -a
share|improve this answer
add comment

Your Answer


