title: How to fix maven warning about thread group still running when using GCSUtil to write files?
body: <p>I wrote a simple <a href="https://bitbucket.org/jlewi/dataflow/src/b2e666896b763e5b8293da899885ecdea31d45af/dataflow/src/main/java/dataflow/GCSRunningThreads.java?at=master" rel="nofollow">program</a> to write a text file to GCS using <a href="https://github.com/GoogleCloudPlatform/DataflowJavaSDK/blob/master/sdk/src/main/java/com/google/cloud/dataflow/sdk/util/GcsUtil.java" rel="nofollow">GCSUtil</a></p>
  
  <p>I run the program using mvn:exec</p>
  
  <pre><code>mvn exec:java -Dexec.mainClass="dataflow.GCSRunningThreads" -Dexec.args=--output=gs://my-bucket/tmp/hello_world
  </code></pre>
  
  <p>Maven exits with the following error</p>
  
  <pre><code>[WARNING] thread Thread[pool-1-thread-1,5,dataflow.GCSRunningThreads] was interrupted but is still alive after waiting at least 15000msecs
  [WARNING] thread Thread[pool-1-thread-1,5,dataflow.GCSRunningThreads] will linger despite being asked to die via interruption
  [WARNING] NOTE: 1 thread(s) did not finish despite being asked to  via interruption. This is not a problem with exec:java, it is a problem with the running code. Although not serious, it should be remedied.
  [WARNING] Couldn't destroy threadgroup org.codehaus.mojo.exec.ExecJavaMojo$IsolatedThreadGroup[name=dataflow.GCSRunningThreads,maxpri=10]
  java.lang.IllegalThreadStateException
      at java.lang.ThreadGroup.destroy(ThreadGroup.java:775)
      at org.codehaus.mojo.exec.ExecJavaMojo.execute(ExecJavaMojo.java:328)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
  [INFO] ------------------------------------------------------------------------
  </code></pre>
  
  <p>How can I fix this?</p>