Writing this for users who have future issues like me. Libraries that are built on the Typesafe config typically use their own reference.conf
files and refer to certain configuration keys. When building a fat JAR using the Gradle shadowJAR
plugin, these files aren't included.
Dependencies like Spray and Akka throw errors when the fat JAR attempts to run. Errors look like:
Exception in thread "main" com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'spray'
Exception in thread "main" com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'akka'
How to fix this? Check the answer below.