maven 内存不足_如何修复Maven内存不足问题

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选项轻松完成的。

export MAVEN_OPTS=-Xmx1024m
出口MAVEN_OPTS = -Xmx1024m

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 内存不足

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值