title: Scala jar read external properties file
body: <p>I have written some code and exported it as a jar file. In this jar there is a file named <code>automation.properties</code> with defaults that I'm loading using</p>
  
  <pre><code>val automationPropertiesFileURL = getClass.getResource("/automation.properties")  
    if (automationPropertiesFileURL != null) {
      val source = Source.fromURL(automationPropertiesFileURL)
      config = new Properties()
      config.load(source.bufferedReader())
    }
  </code></pre>
  
  <p>But when this jar file gets added as a <code>gradle</code> dependency in <code>C:\User\abc\.gradle</code> and I want to read <code>automation.properties</code> from my current project, how can I override the location and read the file from my project and not from the jar file itself?</p>