Recommand · October 14, 2021 0

reference a conf file in assembly jar

I have a problem in a fat jar when I try to reference configuration files:

My plugins configs

        <!-- Delivery assembly -->

after mvn clean package I get the assembly with application.conf at the root and then folders starting with com…

then in my code I have the following:

   import com.typesafe.config.ConfigFactory

   File configurationFile= new File("application.conf")

but when I execute I have :

 2021-10-14 14:08:41 WARN  NativeCodeLoader:62 - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

 application.confException in thread "main" com.typesafe.config.ConfigException$Missing: 

 No configuration setting found for key 'app'

My first assumption was that my file path is not good, but not sure.