maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tibor Digana <>
Subject Re: [surefire] possible bug: cannot set line.separator in systemPropertyVariables
Date Tue, 07 May 2019 20:49:38 GMT
Hi John,

You must observe the warning in this case:
line.separator cannot be set as system property, use
<argLine>-Dline.separator=...</argLine> instead

The same is with
"java.library.path", "file.encoding", "",
"line.separator" .

This means that you should not use these property keys in
systemPropertyVariables because setting such ones in here would not take
These properties do not present in CLI. They are set too late after JVM
startup by Surefire code.

If you want to apply such of these properties and see their effect, you
should use them in CLI, this means in argLine, and this would be then fully
controlled by JVM spec.
I guess you use forking mode (or you implicitely use the default


On Tue, May 7, 2019 at 10:30 PM John Passaro <>

> Hi, I may have found a bug.
> My team's code has tests failing depending on what system they're run
> on, apparently because of conflicting line separator. I'm trying to
> change the line.separator value so I can debug.
> My normal setting is line.separator=\n, and tests currently pass. I
> tried adding this to my surefire config:
> <systemPropertyVariables>
>     <line.separator>&#x0A;</line.separator>
> </systemPropertyVariables>
> I expected that this was just giving explicitly the same setting that
> was normally natively available, so the tests should be unaffected. In
> fact, tests started to fail, it seems like the VM is treating
> line.separator as empty. For example, we expected a formatted stack
> trace:
> * Stack trace:
> java.lang.Exception: exception message
>     at
>     at com.poppin.Eggs.spam(
> and we got one without line breaks:
> * Stack trace:
> java.lang.Exception: exception message    at
>    at
> com.poppin.Eggs.spam(
> (the above is all one line)
> Similar results when I give <line.separator>&#x0D;&#x0A;</line.separator>.
> Am I right in thinking this is a bug? Maybe when reading the xml,
> whitespace is stripped, including my &#x0A;, and the property entry
> winds up empty (though I can't find anything in the surefire source
> explicitly doing that). Or is there something else I am doing wrong?
> Appreciate
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message