title: Unable to use external configuration with Quarkus
body: <p>I am having trouble to use external configuration properties for my Quarkus application.</p>
  <p>I want to override the database properties. The application.properties inside the project has properties for dev and test, not for prod. The values for prod are inside the external application.properties.</p>
  <p>I read the official guide (<a href="https://quarkus.io/guides/config#overriding-properties-at-runtime" rel="nofollow noreferrer">https://quarkus.io/guides/config#overriding-properties-at-runtime</a>) and tried to place an application.properties file in a folder next to the runner-jar called config. That didn't work. But just passing the properties on the command line didn't work either.</p>
  <pre><code>C:.
  │   0.1.0-SNAPSHOT-runner.jar
  │   0.1.0-SNAPSHOT.jar.original
  │
  ├───config
  │       application.properties
  </code></pre>
  <p>Internal:</p>
  <pre><code>%dev.quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/postgres
  %dev.quarkus.datasource.username=postgres
  %dev.quarkus.datasource.password=postgres
  %dev.quarkus.datasource.db-kind=postgresql
  %dev.quarkus.hibernate-orm.database.generation=none
  
  %test.quarkus.datasource.jdbc.url=jdbc:h2:mem:test
  %test.quarkus.datasource.username=sa
  %test.quarkus.datasource.password=
  %test.quarkus.datasource.db-kind=h2
  %test.quarkus.hibernate-orm.database.generation=none
  </code></pre>
  <p>External:</p>
  <pre><code>quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/postgres
  quarkus.datasource.username=postgres
  quarkus.datasource.password=postgres
  quarkus.datasource.db-kind=postgresql
  quarkus.hibernate-orm.database.generation=none
  </code></pre>
  <p>With <code>java -jar .\0.1.0-SNAPSHOT-runner.jar</code> I get the following error:</p>
  <pre><code>2020-07-24 16:58:16,666 ERROR [io.qua.application] (main) Failed to start application: java.lang.IllegalArgumentException: Parameter 'dataSource' may not be null
          at org.wildfly.common.Assert.checkNotNullParamChecked(Assert.java:71)
          at org.wildfly.common.Assert.checkNotNullParam(Assert.java:49)
          at org.wildfly.security.auth.realm.jdbc.QueryConfiguration.&lt;init&gt;(QueryConfiguration.java:40)
          at org.wildfly.security.auth.realm.jdbc.QueryBuilder.buildQuery(QueryBuilder.java:76)
          at org.wildfly.security.auth.realm.jdbc.JdbcSecurityRealmBuilder.build(JdbcSecurityRealmBuilder.java:51)
          at io.quarkus.elytron.security.jdbc.JdbcRecorder.createRealm(JdbcRecorder.java:42)
          at io.quarkus.deployment.steps.ElytronSecurityJdbcProcessor$configureJdbcRealmAuthConfig-173765586.deploy_0(ElytronSecurityJdbcProcessor$configureJdbcRealmAuthConfig-173765586.zig:76)
          at io.quarkus.deployment.steps.ElytronSecurityJdbcProcessor$configureJdbcRealmAuthConfig-173765586.deploy(ElytronSecurityJdbcProcessor$configureJdbcRealmAuthConfig-173765586.zig:36)
          at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:524)
          at io.quarkus.runtime.Application.start(Application.java:90)
          at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:91)
          at io.quarkus.runtime.Quarkus.run(Quarkus.java:61)
          at io.quarkus.runtime.Quarkus.run(Quarkus.java:38)
          at io.quarkus.runtime.Quarkus.run(Quarkus.java:106)
          at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:29)
  
  2020-07-24 16:58:16,730 ERROR [io.qua.run.Application] (main) Error running Quarkus application: java.lang.RuntimeException: Failed to start quarkus
          at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:649)
          at io.quarkus.runtime.Application.start(Application.java:90)
          at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:91)
          at io.quarkus.runtime.Quarkus.run(Quarkus.java:61)
          at io.quarkus.runtime.Quarkus.run(Quarkus.java:38)
          at io.quarkus.runtime.Quarkus.run(Quarkus.java:106)
          at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:29)
  Caused by: java.lang.IllegalArgumentException: Parameter 'dataSource' may not be null
          at org.wildfly.common.Assert.checkNotNullParamChecked(Assert.java:71)
          at org.wildfly.common.Assert.checkNotNullParam(Assert.java:49)
          at org.wildfly.security.auth.realm.jdbc.QueryConfiguration.&lt;init&gt;(QueryConfiguration.java:40)
          at org.wildfly.security.auth.realm.jdbc.QueryBuilder.buildQuery(QueryBuilder.java:76)
          at org.wildfly.security.auth.realm.jdbc.JdbcSecurityRealmBuilder.build(JdbcSecurityRealmBuilder.java:51)
          at io.quarkus.elytron.security.jdbc.JdbcRecorder.createRealm(JdbcRecorder.java:42)
          at io.quarkus.deployment.steps.ElytronSecurityJdbcProcessor$configureJdbcRealmAuthConfig-173765586.deploy_0(ElytronSecurityJdbcProcessor$configureJdbcRealmAuthConfig-173765586.zig:76)
          at io.quarkus.deployment.steps.ElytronSecurityJdbcProcessor$configureJdbcRealmAuthConfig-173765586.deploy(ElytronSecurityJdbcProcessor$configureJdbcRealmAuthConfig-173765586.zig:36)
          at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:524)
          ... 6 more
  </code></pre>
  <p>With <code>java -Dquarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/postgres -Dquarkus.datasource.username=postgres -Dquarkus.datasource.password=postgres -Dquarkus.datasource.db-kind=postgresql -jar .\0.1.0-SNAPSHOT-runner.jar</code> I get this:</p>
  <pre><code>Error: Could not find or load main class .datasource.jdbc.url=jdbc:postgresql:..localhost:5432.postgres
  Caused by: java.lang.ClassNotFoundException: /datasource/jdbc/url=jdbc:postgresql://localhost:5432/postgres
  </code></pre>
  <p>I could only find two similar threads (<a href="https://stackoverflow.com/questions/55043399/how-can-i-override-properties-in-quarkus">How can I override properties in Quarkus?</a> and <a href="https://github.com/quarkusio/quarkus/issues/1218" rel="nofollow noreferrer">https://github.com/quarkusio/quarkus/issues/1218</a>). Both mention the method with the application.properties in the config folder. Since this does not work for me and I cannot find any new information, I am somewhat lost ...</p>
  <p>I would be grateful for any help!</p>