hello! I’m running simple app for testing purposes...
# coroutines
d
hello! I’m running simple app for testing purposes from build systems, e.g.
Copy code
fun main() {
  val client = HttpClient(...)
  runBlocking {
    // invoke some endpoint
  }
  client.close()
}
The above works perfectly fine when executed using Gradle application plugin, e.g.
Copy code
application {
    mainClassName = "com.example.ApplicationKt"
}
but it blows up when run using Maven exec
Copy code
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.6.0</version>
    <configuration>
        <mainClass>com.example.ApplicationKt</mainClass>
    </configuration>
</plugin>
with following
Copy code
[WARNING] thread Thread[kotlinx.coroutines.DefaultExecutor,5,com.example.ApplicationKt] was interrupted but is still alive after waiting at least 14998msecs
[WARNING] thread Thread[kotlinx.coroutines.DefaultExecutor,5,com.example.ApplicationKt] 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=com.example.ApplicationKt,maxpri=10]
java.lang.IllegalThreadStateException
    at java.lang.ThreadGroup.destroy (ThreadGroup.java:776)
any ideas?