Has anyone seen this before and know what I'm doin...
# http4k
k
Has anyone seen this before and know what I'm doing wrong here? Happy to provide a reproducible example
main.kt
file if it's useful.
d
It could be that your Shadow jar is missing the mime.types file from the core JAR
There are options you can send to shadow to merge the jars
k
Thank you! Looks like I needed to add
mergeServiceFiles()
inside of my
shadowJar { ... }
block
👍 1
d
Np 🙃
j
I had the same problem (came here for that) will check if the solution works for me
also works for me. is this somewhere documented? i was unable to find solutions in the net. would be great to have a gradle guide on the http4k site. i mean its great documentation so this is missing maybe? or what are you guys using for packaging
d
Sure, we can stick it into the faq, and I'll see if I can improve the error. TBH it is a pretty common problem with shadow jarring any app.
By default we tend to use the gradle application plugin, or more recently use Google Jib for K8S
k
Jib looks like a really nice way to structure things. Having a "preferred" way to deploy http4k applications would be great.
d
Its a very clever idea (and simple really) - by spitting external dependencies into separate layers you can leverage really small download times for deployments/new pods as generally your app code is only a few kB of layer. Definitely worth checking out.
But of course that only works for K8s and similar - CF and heroku mostly use standard distribution zips afaik
Tweaked the message. Anyone with this problem will receive this message now in the stack:
Copy code
Could not find 'myfile.txt' inside META-INF. If using Shadow JAR, add mergeServiceFiles() to the configuration
👍 2