1

I have a particular test case that is run by surefire which fails when this vm arg is not set.

I am able to get the test to successfully pass if i run:

mvn test -Dtest=TestClass -Djava.net.preferIPv4Stack=true

This works great. Now I want to generalize this so that the vm arg is set for all maven builds.

In my .bashrc I've added

MAVEN_OPTS='-Djava.net.preferIPv4Stack=true'

I have confirmed via echoing the env variable that it is set. This unfortunately does not make a difference for my test case. What other considerations am I missing that would interfere here?

Thanks! R

Tunaki
  • 116,530
  • 39
  • 281
  • 370
user321605
  • 836
  • 2
  • 7
  • 20

1 Answers1

0

Based on the documentation you can give a supplemental configuration to the maven-surefire-plugin:

<configuration>
  <argLine>-Djava.net.preferIPv4Stack=true</argLine>
  ...
</configuration>
khmarbaise
  • 81,692
  • 23
  • 160
  • 199