title: Database name in environment variables
body: <p>My problem is as follows, I have a Spring boot application and I use Jooq for sql, I set my pom to generate the tables. Database information is set in environment variables.
  It's working fine inside Intellij but when I generate the .WAR and upload the application on the client it only works if the client database name is the same as the name in my pom.xml when the jooq code was created.
  The tables are exactly the same, the only thing that can change is the database name, so I look up the name information in the environment variables.
  My variables are all set in the properties, In debugging I can see my connection object with the variable data.</p>
  
  <p>My pom.xml is as follows:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  </code></pre>
  
  <p>http://maven.apache.org/xsd/maven-4.0.0.xsd">
      4.0.0</p>
  
  <pre><code>&lt;groupId&gt;com.speedsoft&lt;/groupId&gt;
  &lt;artifactId&gt;bedelServer&lt;/artifactId&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;!--    &lt;packaging&gt;jar&lt;/packaging&gt;--&gt;
  &lt;packaging&gt;war&lt;/packaging&gt;
  
  &lt;name&gt;BWS&lt;/name&gt;
  &lt;description&gt;BWS&lt;/description&gt;
  
  &lt;parent&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
      &lt;version&gt;2.0.1.RELEASE&lt;/version&gt;
      &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
  &lt;/parent&gt;
  
  
  &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
      &lt;maven.compiler.source&gt;1.8&lt;/maven.compiler.source&gt;
      &lt;maven.compiler.target&gt;1.8&lt;/maven.compiler.target&gt;
      &lt;java.version&gt;1.8&lt;/java.version&gt;
      &lt;quartz.version&gt;2.2.1&lt;/quartz.version&gt;
      &lt;jooq.version&gt;3.9.1&lt;/jooq.version&gt;
      &lt;logback.version&gt;1.2.3&lt;/logback.version&gt;
      &lt;logbackaccess.version&gt;1.3.0-alpha4&lt;/logbackaccess.version&gt;
      &lt;mysql.version&gt;6.0.3&lt;/mysql.version&gt;
      &lt;exec-maven-plugin&gt;1.7&lt;/exec-maven-plugin&gt;
  
      &lt;start-class&gt;com.speedsoft.bws.BwsApplication&lt;/start-class&gt;
  &lt;/properties&gt;
  
  
  
  &lt;dependencies&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-tomcat&lt;/artifactId&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-tomcat&lt;/artifactId&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.quartz-scheduler&lt;/groupId&gt;
          &lt;artifactId&gt;quartz&lt;/artifactId&gt;
          &lt;version&gt;${quartz.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.quartz-scheduler&lt;/groupId&gt;
          &lt;artifactId&gt;quartz-jobs&lt;/artifactId&gt;
          &lt;version&gt;${quartz.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-quartz&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;mysql&lt;/groupId&gt;
          &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
          &lt;version&gt;${mysql.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.jooq&lt;/groupId&gt;
          &lt;artifactId&gt;jooq&lt;/artifactId&gt;
          &lt;version&gt;${jooq.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.jooq&lt;/groupId&gt;
          &lt;artifactId&gt;jooq-meta&lt;/artifactId&gt;
          &lt;version&gt;${jooq.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.jooq&lt;/groupId&gt;
          &lt;artifactId&gt;jooq-codegen&lt;/artifactId&gt;
          &lt;version&gt;${jooq.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;ch.qos.logback&lt;/groupId&gt;
          &lt;artifactId&gt;logback-classic&lt;/artifactId&gt;
          &lt;version&gt;${logback.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
          &lt;artifactId&gt;jul-to-slf4j&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
          &lt;artifactId&gt;log4j-over-slf4j&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.data&lt;/groupId&gt;
          &lt;artifactId&gt;spring-data-commons&lt;/artifactId&gt;
          &lt;version&gt;2.0.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;ch.qos.logback&lt;/groupId&gt;
          &lt;artifactId&gt;logback-access&lt;/artifactId&gt;
          &lt;version&gt;${logbackaccess.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
          &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
          &lt;version&gt;4.5&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
          &lt;artifactId&gt;httpmime&lt;/artifactId&gt;
          &lt;version&gt;4.3.1&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
          &lt;artifactId&gt;httpcore&lt;/artifactId&gt;
          &lt;version&gt;4.4.9&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
          &lt;artifactId&gt;httpcore&lt;/artifactId&gt;
          &lt;version&gt;4.0.1&lt;/version&gt;
      &lt;/dependency&gt;
  
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.jooq&lt;/groupId&gt;
              &lt;artifactId&gt;jooq-codegen-maven&lt;/artifactId&gt;
              &lt;version&gt;3.8.3&lt;/version&gt;
  
              &lt;!-- The plugin should hook into the generate goal --&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;generate&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
  
              &lt;dependencies/&gt;
  
              &lt;configuration&gt;
                  &lt;jdbc&gt;
                      &lt;driver&gt;${jdbc.driver}&lt;/driver&gt;
                      &lt;url&gt;${jdbc.url}&lt;/url&gt;
                      &lt;user&gt;${jdbc.user}&lt;/user&gt;
                      &lt;password&gt;${jdbc.password}&lt;/password&gt;
                  &lt;/jdbc&gt;
  
                  &lt;generator&gt;
                      &lt;database&gt;
                          &lt;inputSchema&gt;bedel&lt;/inputSchema&gt;
                          &lt;name&gt;org.jooq.util.mysql.MySQLDatabase&lt;/name&gt;
                      &lt;/database&gt;
                      &lt;target&gt;
                          &lt;packageName&gt;com.speedsoft.bws.jooq.model&lt;/packageName&gt;
                          &lt;directory&gt;target/generated-sources/jooq&lt;/directory&gt;
                          &lt;encoding&gt;UTF-8&lt;/encoding&gt;
                      &lt;/target&gt;
                      &lt;generate&gt;
                      &lt;fluentSetters&gt;false&lt;/fluentSetters&gt;
                      &lt;daos&gt;false&lt;/daos&gt;
                      &lt;/generate&gt;
                  &lt;/generator&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
  
          &lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
              &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;1.5.0&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;exec&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
              &lt;configuration&gt;
                  &lt;systemProperties&gt;
                      &lt;systemProperty&gt;
                          &lt;key&gt;jdbc.driver&lt;/key&gt;
                          &lt;value&gt;${jdbc.driver}&lt;/value&gt;
                      &lt;/systemProperty&gt;
                      &lt;systemProperty&gt;
                          &lt;key&gt;jdbc.user&lt;/key&gt;
                          &lt;value&gt;${jdbc.user}&lt;/value&gt;
                      &lt;/systemProperty&gt;
                      &lt;systemProperty&gt;
                          &lt;key&gt;jdbc.password&lt;/key&gt;
                          &lt;value&gt;${jdbc.password}&lt;/value&gt;
                      &lt;/systemProperty&gt;
                      &lt;systemProperty&gt;
                          &lt;key&gt;jdbc.url&lt;/key&gt;
                          &lt;value&gt;${jdbc.url}&lt;/value&gt;
                      &lt;/systemProperty&gt;
                  &lt;/systemProperties&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  
  &lt;profiles&gt;
      &lt;profile&gt;
          &lt;id&gt;default&lt;/id&gt;
          &lt;activation&gt;
              &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
          &lt;/activation&gt;
          &lt;properties&gt;
              &lt;jdbc.user&gt;root&lt;/jdbc.user&gt;
              &lt;jdbc.password&gt;%47**¨00&lt;/jdbc.password&gt;
              &lt;jdbc.url&gt;jdbc:mysql://localhost:3306/bedel?serverTimezone=UTC&lt;/jdbc.url&gt;
              &lt;jdbc.driver&gt;com.mysql.cj.jdbc.Driver&lt;/jdbc.driver&gt;
          &lt;/properties&gt;
      &lt;/profile&gt;
  &lt;/profiles&gt;
  </code></pre>
  
  <p></p>
  
  <p>How do I have to configure my pom.xml so that when generating the .WAR it does not insert the dependency on having a database with the same name as the code generation time?</p>
  
  <p>Will I have to enter all possible names in the schemas?</p>
  
  <pre><code>&lt;schemata&gt;
    &lt;schema&gt;
      &lt;inputSchema&gt;ui&lt;/inputSchema&gt;
    &lt;/schema&gt;
    &lt;schema&gt;
      &lt;inputSchema&gt;other_schema&lt;/inputSchema&gt;
    &lt;/schema&gt;
  &lt;/schemata&gt;
  </code></pre>