title: Command line arguments not working for sbt-assembly jars
body: <p>I am trying to pass command line arguments to my JAR created with <code>sbt-assembly</code>. Neither of these <code>-Dconfig.file=application.conf</code> nor <code>-Dconfig.trace=loads</code></p>
  
  <p>My exact command is</p>
  
  <p><code>java -jar googleScraper-assembly-0.0.1.jar -Dconfig.trace=loads -Dconfig.resource=application.conf</code></p>
  
  <p>This is my build.sbt</p>
  
  <pre><code>lazy val googleScraper = project.in(file("google-data-scraper"))
    .settings(commonSettings:_*)
    .settings(
      version := "0.0.1",
      assemblyMergeStrategy in assembly := {
        case m if m.toLowerCase.endsWith("manifest.mf") =&gt; MergeStrategy.discard
        case m if m.toLowerCase.matches("meta-inf.*\\.sf$") =&gt; MergeStrategy.discard
        case "log4j.properties" =&gt; MergeStrategy.discard
        case m if m.toLowerCase.startsWith("meta-inf/services/") =&gt; MergeStrategy.filterDistinctLines
        case "reference.conf" =&gt; MergeStrategy.concat
        case "application.conf" =&gt; MergeStrategy.concat
        case _ =&gt; MergeStrategy.first
      },
      libraryDependencies ++= Seq(
        "com.typesafe" % "config" % "1.3.0",
        "com.typesafe.play" % "play_2.11" % "2.3.9",
        "com.typesafe.play" % "play-ws_2.11" % "2.3.9",
        "com.ning" % "async-http-client" % "1.8.15"
      ),
      fork in run := true
    )
    .dependsOn("util")
    .dependsOn("core")
  </code></pre>
  
  <p><strong>Edit</strong></p>
  
  <p>So turns out that putting the argument before the -jar makes a different. This now works:</p>
  
  <p><code>java -Dconfig.trace=loads -Dconfig.resource=blah.conf -jar googleScraper-assembly-0.0.1.jar</code></p>
  
  <p>but it now the loading indicates that the app is trying to load the new config from within the JAR. How can I make it load it completely externally (absolute path didn't work)?</p>