I created a basic Hello World app using the http4k...
# http4k
s
I created a basic Hello World app using the http4k generator. I can do a gradle clean build and a jar file is generated. When I try to run the jar file, I get an error that the jar is missing a manifest file. I added a jar tag with a manifest attribute but now I'm getting class loading errors. Anyone know what I'm missing?
d
are you using shadowjar? the problem will be the mime-type file I assume?
(if you're not using shadowjar you problaby should
s
Yes, I'm using the shadow jar. What should I check in the mime-type file?
d
if you're using shadow, you need to merge the service files
which is pretty much putting this in your gradle file:
Copy code
shadowJar {
  mergeServiceFiles()
}
I'm actually not sure if the toolbox is generating the correct output for the shadowJar option.
s
Thanks, let me check it
d
(I've located the bug in the toolbox which you hit by the way - when you selected the shadowJar option it didn't actually select it - fixing it now! 🙂 )
s
Cool, thanks
b
Another option is to use
gradle install
and then you’ll have a script you can run at
build/install/myapp/bin/myapp
I believe you get this for free with the
application
plugin
d
yeah - the shadowjar is a convienient way of bundling stuff, but it really depends on how the service is going to be started in the target environment - if it's going to be
java -jar XYZ
or a docker container where you can call a script.