My Adventures in Coding

June 12, 2009

mvn deploy – java.lang.OutOfMemoryError

Filed under: Maven — Brian @ 12:48 pm
Tags: ,

If you are doing a mvn deploy and get the following error:

[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Java heap space
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.OutOfMemoryError: Java heap space

The problem is most likely that Maven has run out of memory. By default maven sets a maximum memory size of 64mbs. When deploying a large file such as a 15mb+ jar file it can easily run out of memory.

The simple but not so obvious solution is to tell maven to set the max memory size in the MAVEN_OPTS environment variable:

MAVEN_OPTS="-Xmx128m"

Now execute your deploy again and it should work fine!

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: