maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tibor Digana (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SUREFIRE-1176) Maven surefire plugin sets systemPropertyVariables too late
Date Fri, 04 Sep 2015 23:37:45 GMT

    [ https://issues.apache.org/jira/browse/SUREFIRE-1176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14731614#comment-14731614
] 

Tibor Digana commented on SUREFIRE-1176:
----------------------------------------

[~matihost]
We are setting system properties in ForkedBooter.java (main() method of console app).
Is not it this case?
I guess JDK 7 has the most beautiful buggy behavior.
Please see this:
http://stackoverflow.com/questions/19121928/java-system-getproperty-user-timezone-does-not-work
http://www.cs.duke.edu/csed/java/jdk1.8/technotes/guides/troubleshoot/time-zone.html
Doe it still make sense to keep this issue open?

> 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)

Mime
View raw message