Scott Kurz created SUREFIRE-1545:
------------------------------------
Summary: Not possible to configure java.util.logging with failsafe
plugin in forked JVM
Key: SUREFIRE-1545
URL: https://issues.apache.org/jira/browse/SUREFIRE-1545
Project: Maven Surefire
Issue Type: Improvement
Components: Maven Failsafe Plugin
Affects Versions: 2.22.0
Environment: Windows + IBM Java 8 JDK
Reporter: Scott Kurz
As suggested here: [https://stackoverflow.com/a/12276898/634324] I'm simply
doing this (using the updated rather than deprecated prop name) which forks a
JVM (the default):
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.0</version>
<configuration>
<systemPropertyVariables>
<java.util.logging.config.file>${project.basedir}/src/test/resources/logging.properties</java.util.logging.config.file>
</systemPropertyVariables>
</configuration>
<executions>
<execution>
<id>default-integration-test</id>
<phase>integration-test</phase>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
</executions>
</plugin>
But it doesn't seem to be having any effect.
I stepped through it a bit in the debugger... enough to see that it seems to
be that this sequence:
[https://github.com/apache/maven-surefire/blob/19ea21e3d7681c33a158dd7e06e8b5a993a33d85/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java#L91-L95]
ends up initializing the LogManager before a system prop like
java.util.logging.config.file can be set.
I could add a test case if it helps, but I think this should be easy to
recreate just based on the above.
---
Would be interested to hear if there is a better way to do this (making this
improvement unnecessary). And I guess a workaround is probably not forking the
JVM, but that wasn't a good fit for me.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)