You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Scott Kurz <sk...@gmail.com> on 2018/07/24 15:43:11 UTC
How to configure java.util.logging for a forked failsafe invocation?
Hi,
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.
----
If this sounds like it'd be worth capturing in an issue/JIRA, I could add
more detail, but first wanted to check this wasn't a known problem or a
usage error... (or if the "solution" is just not to fork which I wasn't
hoping to resort to yet).
Thanks,
Scott Kurz