title: How to reference resource file in java maven project running in docker container
body: <p>I am trying to run a java maven (spring boot) project in a docker container to access the zoho api. </p>
  
  <p>For authentication I need a file <code>zoho-oauthtokens.properties</code> which is located in src/main/resources and which I reference from another property file called <code>oauth_configuration.properties</code> like this:
  <code>oauth_tokens_file_path=src/main/resources/zoho-oauthtokens.properties</code></p>
  
  <p>As long as I run the application in eclipse as spring application everything works fine but as soon as I run it in a docker container I get:
  <code>com.zoho.crm.library.exception.ZCRMException com.zoho.oauth.common.ZohoOAuthException. Caused by : com.zoho.oauth.common.ZohoOAuthException. Caused by : java.io.FileNotFoundException: src/main/resources/zoho-oauthtokens.properties (No such file or directory)</code></p>
  
  <p>So how do I reference the resource file correctly that it will also be found when I run it i a docker container? Any idea?</p>
  
  <p>I tried:</p>
  
  <p><code>oauth_tokens_file_path=src/main/resources/zoho-oauthtokens.properties</code></p>
  
  <p><code>oauth_tokens_file_path=classpath:/zoho-oauthtokens.properties</code></p>
  
  <p><code>oauth_tokens_file_path=/zoho-oauthtokens.properties</code></p>
  
  <p><code>oauth_tokens_file_path=zoho-oauthtokens.properties</code></p>
  
  <p>and also after placing it in the root folder of my project:
  <code>oauth_tokens_file_path=/zoho-oauthtokens.properties</code></p>
  
  <p><code>oauth_tokens_file_path=zoho-oauthtokens.properties</code></p>
  
  <p>Best, Nils</p>
  
  <p>EDIT:
  It tried more options:</p>
  
  <p><code>../../../zoho-oauthtokens.properties</code></p>
  
  <p><code>./zoho-oauthtokens.properties</code></p>
  
  <p><code>/BOOT-INF/classes/zoho-oauthtokens.properties</code></p>
  
  <p><code>BOOT-INF/classes/zoho-oauthtokens.properties</code></p>
  
  <p>Also I have inspected the jar file after the maven build. This is where the relevant files are located:</p>
  
  <p><code>BOOT-INF/classes/de/xxx/xxx/Application.class</code></p>
  
  <p><code>BOOT-INF/classes/zoho-oauthtokens.properties</code></p>
  
  <p><code>BOOT-INF/classes/oauth_configuration.properties</code></p>