[英]Determine date on Maven profile
在您的Maven个人资料中,您可以通过Surefire将日期时间作为系统属性传递:
...
<profile>
...
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<testDateTime>2013-01-01T00:00:00.000Z</testDateTime>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
...
然后像这样在测试中使用它:
final String dateTime = System.getProperty("testDateTime");
// parse date-time etc...
有帮助吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.