When I stop the service the stop is not getting called but if try the same in test case where I deploy and undeploy verticle with deployment ID the stop method is executing.
EDIT:- I am creating jar file (not a shadow Jar). Below is build.gradle configuration
application{
mainClassName='io.vertx.core.Launcher'
}
def mainVerticleName = 'verticleName'
jar {
manifest {
attributes(
"Manifest-Version": "1.0",
"Main-Verticle": "$mainVerticleName",
"Main-Class": "io.vertx.core.Launcher",
"Class-Path": configurations.runtimeClasspath.collect { it.getName() }.join(' ')
)
}
}
starting application :-
java -jar api-gateway-1.0.0-SNAPSHOT.jar -Dconfig.propertyFile="<property file path>" -DlogfilePath="<log file path>"
stopping application :-
CTRL+C
Creating CustomLauncher extending Launcher class worked.
build.gradle changes :-