File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
java/io/github/bonigarcia/wdm Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -1803,7 +1803,7 @@ protected Capabilities getMergedCapabilities() {
18031803 }
18041804
18051805 protected void addShutdownHookIfRequired () {
1806- if (!shutdownHook ) {
1806+ if (!shutdownHook && ! config (). isAvoidShutdownHook () ) {
18071807 Runtime .getRuntime ()
18081808 .addShutdownHook (new Thread ("wdm-shutdown-hook" ) {
18091809 @ Override
Original file line number Diff line number Diff line change @@ -83,6 +83,8 @@ public class Config {
8383 "wdm.avoidReadReleaseFromRepository" , Boolean .class );
8484 ConfigKey <Boolean > avoidTmpFolder = new ConfigKey <>("wdm.avoidTmpFolder" ,
8585 Boolean .class );
86+ ConfigKey <Boolean > avoidShutdownHook = new ConfigKey <>(
87+ "wdm.avoidShutdownHook" , Boolean .class );
8688 ConfigKey <Integer > timeout = new ConfigKey <>("wdm.timeout" , Integer .class );
8789 ConfigKey <Boolean > versionsPropertiesOnlineFirst = new ConfigKey <>(
8890 "wdm.versionsPropertiesOnlineFirst" , Boolean .class );
@@ -540,6 +542,15 @@ public Config setAvoidTmpFolder(boolean value) {
540542 return this ;
541543 }
542544
545+ public boolean isAvoidShutdownHook () {
546+ return resolve (avoidShutdownHook );
547+ }
548+
549+ public Config setAvoidShutdownHook (boolean value ) {
550+ this .avoidShutdownHook .setValue (value );
551+ return this ;
552+ }
553+
543554 public int getTimeout () {
544555 return resolve (timeout );
545556 }
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ wdm.avoidResolutionCache=false
99wdm.avoidFallback =false
1010wdm.avoidReadReleaseFromRepository =false
1111wdm.avoidTmpFolder =false
12+ wdm.avoidShutdownHook =false
1213wdm.timeout =30
1314wdm.resolutionCache =resolution.properties
1415wdm.ttl =86400
You can’t perform that action at this time.
0 commit comments