You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Henrik Plate <he...@googlemail.com> on 2016/08/12 08:02:35 UTC

Long-running shutdown hook in forked JVM

Hi guys,

I have a long-running shutdown hook registered for the JVM(s) forked by
Surefire (org.apache.maven.plugins:maven-surefire-plugin:2.14). The hook
uploads all kinds of analysis results (collected during JUnit tests) to a
remote backend. All this upload can take up to a couple of minutes.

Now the problem is that the forked JVM is terminated before the shutdown
hook is finished, i.e., not all analysis data is uploaded.

Reading through [1], I played with the configuration option
"forkedProcessTimeoutInSeconds", however, it did not change anything.

Any ideas on how to prevent the shutdown of forked JVMs until such
(long-running) shutdown hooks are properly terminated?

Thank you in advance, Cheers,
Henrik

[1]
https://maven.apache.org/surefire/maven-surefire-plugin/examples/shutdown.html