1

I have the issue that my mvn compile fails on an internal project for some reason. Two other colleagues tried it as well and it does not fail on their machines. We use Lombok there (I am not a fan but that was not my choice) and for some reason it fails with a StackOverflowError. After some research I found a solution, adding:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.8.1</version>
    <configuration>
        <fork>true</fork>
        <compilerArgs>
            <arg>-J-Xss4M</arg>
        </compilerArgs>
    </configuration>
</plugin>

This works fine, but I'd like not to change the pom.xml if this only happens on my machine. So is there a way to add the Xss flag to some environment variable?

I tried to add it via MAVEN_OPTS, in Windows as well as in IntelliJ -> Maven Runner Settings, with and without -Jin front, but it fails as before.

Apollo
  • 1,296
  • 2
  • 11
  • 24
  • 2
    The first thing I would request to find why it fails only on a single machine... different JDK version ? etc. ? And no it's not possible to do so... – khmarbaise Aug 18 '21 at 13:54
  • I have OpenJDK 1.8.0_212, they have 1.8.0_201. Those are managed machines, I have no way of installing something on it, so this does not matter to me. I want to find a way to increase the stack size without changing the project code. – Apollo Aug 18 '21 at 13:56
  • 3
    @ctwx If it fails on one machine but not the other, you need to find out why, not build around it. – J Fabian Meier Aug 18 '21 at 14:32
  • As @JFabianMeier you must find the root cause anything else will cause more issues in the future...already giving a compiler arg with defining the stack size is very strange...Second if there is a stackoverflow there is a stack trace which should give you at least a hint.... – khmarbaise Aug 18 '21 at 15:18
  • I fully agree, but the issue is that I only have 5 days left in that company and this is a managed machine. The company I work for has a few thousand employees and the IT department is very restrictive. So, I have no way of fixing it in 5 days. Thanks though. – Apollo Aug 19 '21 at 05:24
  • I guess, having something similar to the `maven.compiler.*` properties for that would be handy. – Apollo Aug 19 '21 at 05:29

0 Answers0