increase scala stack size during maven build

北城以北 提交于 2019-12-24 10:23:06

问题


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

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


回答1:


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>

For more see http://davidb.github.io/scala-maven-plugin/example_compile.html



来源:https://stackoverflow.com/questions/44133177/increase-scala-stack-size-during-maven-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!