[
https://issues.apache.org/jira/browse/SUREFIRE-1176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14733945#comment-14733945
]
Tibor Digana commented on SUREFIRE-1176:
----------------------------------------
[~matihost]
I only want to know if you can help yourself and use <argLine/> configuration
parameter.
Unfortunately I cannot rewrite JVM so you have to make the choice in POM
configuration or in code.
Do you agree with me to close this?
If you have some wish we can help you.
> Maven surefire plugin sets systemPropertyVariables too late
> -----------------------------------------------------------
>
> Key: SUREFIRE-1176
> URL: https://issues.apache.org/jira/browse/SUREFIRE-1176
> Project: Maven Surefire
> Issue Type: Bug
> Components: Maven Surefire Plugin
> Affects Versions: 2.18.1
> Reporter: Mateusz Nowakowski
>
> I have a couple of test which need to be run under specific locale.
> It is achieved by this surefire plugin configuration:
> Under Java 7 this plugin configuration works:
> {code}
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-surefire-plugin</artifactId>
> <version>2.18.1</version>
> <configuration>
> <systemPropertyVariables>
> <user.timezone>America/Chicago</user.timezone>
> </systemPropertyVariables>
> </configuration>
> </plugin>
> {code}
> but under Java 8 the test sensitive test still uses default system locale and
> they fail.
> Surefire plugin sets system properties too late, because in Java 8, several
> locale-dependent variables are set much earlier than in Java 7, e.g.
> TimeZone.getDefault() and
> properties specified in systemPropertyVariables section don't have influence
> on tests.
> Workaround for it is setting system properties in argLine section, e.g.
> <argLine>-Duser.timezone=America/Chicago</argLine>.
> Workaround:
> {code}
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-surefire-plugin</artifactId>
> <version>2.18.1</version>
> <configuration>
> <argLine>-Duser.timezone=America/Chicago</argLine>
> </configuration>
> </plugin>
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)