Maven执行install的时候报OutOfMemoryError解决办法

场景如下:

利用maven(3.0)编译部署的时候报了OutOfMemoryError错误,详情如下:

 

[INFO] Copying 14415 resources
[ERROR] Java heap space -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/OutOfMemoryError

 问题原因:

1.cp的文件太多了

2.cp的jar太多了

解决方式:

 

windows:
set MAVEN_OPTS=-Xmx1024m -XX:MaxPermSize=256m
linux:
export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m"

你可能感兴趣的:(Maven执行install的时候报OutOfMemoryError解决办法)