在 Maven 构建期间增加 Scala 堆栈大小 [英] increase scala stack size during maven build

查看:76
本文介绍了在 Maven 构建期间增加 Scala 堆栈大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用 maven (mvn compile) 编译 scala 项目时,出现错误:java.lang.StackOverflowError.我也从 eclipse 中得到了相同的结果,但可以通过提供附加命令行参数来解决它: -J-Xss256m for scala compiler ,如下所示 如何增加 scala 堆栈大小

While compiling a scala project using maven (mvn compile) , I am getting error: java.lang.StackOverflowError. I got the same from eclipse as well, but could solve it by giving Additional command line parameters: -J-Xss256m for scala compiler , as given here How to increase scala stack size

但是我在执行mvn compile"时遇到了同样的错误.我该如何解决这个问题?基本上如何在通过 maven 构建时增加 Scala 堆栈大小

But I am getting the same error while doing "mvn compile". How can I solve this ? Basically how to increase scala stack size while building via maven

推荐答案

你可以在pom.xml中配置scala-maven-plugin,如下图

You can configure the scala-maven-plugin in the pom.xml like bellow

<project>
  ...
      <plugin>
        <groupId>net.alchim31.maven</groupId>
        <artifactId>scala-maven-plugin</artifactId>
        <version>3.2.1</version>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
              <goal>testCompile</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <jvmArgs>
            <jvmArg>-Xms256m</jvmArg>
            <jvmArg>-Xmx1024m</jvmArg>
          </jvmArgs>
        </configuration>
      </plugin>
  ...
</project>

更多见http://davidb.github.io/scala-maven-plugin/example_compile.html

这篇关于在 Maven 构建期间增加 Scala 堆栈大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆