maven 内存不足
Recently I started working on a huge project that was using Maven as a build and deployment tool. When I tried to build the project, I got the ugly java.lang.OutOfMemoryError.
最近,我开始从事一个大型项目,该项目使用Maven作为构建和部署工具。 当我尝试构建项目时,遇到了丑陋的java.lang.OutOfMemoryError 。
To fix this, you will have to increase the maven heap size memory, good thing is that it can be done easily by using maven options.
要解决此问题,您将必须增加Maven堆大小的内存,这是可以使用maven选项轻松完成的。
Above command will increase the memory for maven and your build should be going fine.
上面的命令将增加Maven的内存,并且您的构建应该可以正常进行。
If you run the export command on terminal, then it’s valid for that session only. So if you want Maven to run with this option always, you should include it in your user profile. For example .bash_profile
in Mac OS.
如果在终端上运行export命令,则该命令仅对该会话有效。 因此,如果希望Maven始终使用此选项运行,则应将其包括在用户配置文件中。 例如,在Mac OS中为.bash_profile
。
Note that export command syntax is different on different operating systems, so use the syntax that is correct for your OS.
请注意,导出命令的语法在不同的操作系统上是不同的,因此请使用适合您的OS的语法。
翻译自: https://www.journaldev.com/600/how-to-fix-maven-out-of-memory-issue
maven 内存不足