title: FlywayDB is unable to find Postgresql Driver
body: <p>I am trying to get Flyway setup within a Spigot/Bukkit MC plugin. Currently everytime I execute our SQL code, I get the error 
  `</p>
  
  <pre><code>[10:37:14 WARN]: org.flywaydb.core.api.FlywayException: Unable to instantiate JDBC driver: org.postgresql.Driver =&gt; Check whether the jar file is present
  [10:37:14 WARN]:        at org.flywaydb.core.internal.jdbc.DriverDataSource.&lt;init&gt;(DriverDataSource.java:180)
  [10:37:14 WARN]:        at org.flywaydb.core.internal.jdbc.DriverDataSource.&lt;init&gt;(DriverDataSource.java:144)
  [10:37:14 WARN]:        at org.flywaydb.core.api.configuration.ClassicConfiguration.setDataSource(ClassicConfiguration.java:1341)
  [10:37:14 WARN]:        at org.flywaydb.core.api.configuration.FluentConfiguration.dataSource(FluentConfiguration.java:803)
  [10:37:14 WARN]:        at com.mclockup.core.database.SqlWrapper.&lt;init&gt;(SqlWrapper.java:42)
  [10:37:14 WARN]:        at com.mclockup.core.database.SqlWrapper.initialize(SqlWrapper.java:78)
  [10:37:14 WARN]:        at com.mclockup.core.LockupCore.onEnable(LockupCore.java:22)
  [10:37:14 WARN]:        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263)
  [10:37:14 WARN]:        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:337)
  [10:37:14 WARN]:        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:435)
  [10:37:14 WARN]:        at org.bukkit.craftbukkit.v1_15_R1.CraftServer.enablePlugin(CraftServer.java:470)
  [10:37:14 WARN]:        at org.bukkit.craftbukkit.v1_15_R1.CraftServer.enablePlugins(CraftServer.java:384)
  [10:37:14 WARN]:        at org.bukkit.craftbukkit.v1_15_R1.CraftServer.reload(CraftServer.java:884)
  [10:37:14 WARN]:        at org.bukkit.Bukkit.reload(Bukkit.java:654)
  [10:37:14 WARN]:        at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:54)
  [10:37:14 WARN]:        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159)
  [10:37:14 WARN]:        at org.bukkit.craftbukkit.v1_15_R1.CraftServer.dispatchCommand(CraftServer.java:752)
  [10:37:14 WARN]:        at org.bukkit.craftbukkit.v1_15_R1.CraftServer.dispatchServerCommand(CraftServer.java:714)
  [10:37:14 WARN]:        at net.minecraft.server.v1_15_R1.DedicatedServer.handleCommandQueue(DedicatedServer.java:469)
  [10:37:14 WARN]:        at net.minecraft.server.v1_15_R1.DedicatedServer.b(DedicatedServer.java:431)
  [10:37:14 WARN]:        at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:1112)
  [10:37:14 WARN]:        at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:934)
  [10:37:14 WARN]:        at java.lang.Thread.run(Thread.java:748)
  [10:37:14 WARN]: Caused by: org.flywaydb.core.api.FlywayException: Unable to instantiate class org.postgresql.Driver : org.postgresql.Driver
  [10:37:14 WARN]:        at org.flywaydb.core.internal.util.ClassUtils.instantiate(ClassUtils.java:59)
  [10:37:14 WARN]:        at org.flywaydb.core.internal.jdbc.DriverDataSource.&lt;init&gt;(DriverDataSource.java:176)
  [10:37:14 WARN]:        ... 22 more
  [10:37:14 WARN]: Caused by: java.lang.ClassNotFoundException: org.postgresql.Driver
  [10:37:14 WARN]:        at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
  [10:37:14 WARN]:        at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
  [10:37:14 WARN]:        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
  [10:37:14 WARN]:        at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
  [10:37:14 WARN]:        at java.lang.Class.forName0(Native Method)
  [10:37:14 WARN]:        at java.lang.Class.forName(Class.java:348)
  [10:37:14 WARN]:        at org.flywaydb.core.internal.util.ClassUtils.instantiate(ClassUtils.java:57)
  [10:37:14 WARN]:        ... 23 more
  </code></pre>
  
  <p>`
  I don't think this is a dependency issue since I've included Flyway &amp; postgresql in my build.gradle</p>
  
  <pre><code>
      plugins {
          id 'java'
          id 'maven-publish'
          id 'signing'
      }
  
      group = 'com.mclockup'
      version = '1.0.0-SNAPSHOT'
      description = 'Core functionality used everywhere in Lockup'
  
      archivesBaseName = 'core'
      sourceCompatibility = '1.8'
  
      repositories {
          mavenLocal()
          mavenCentral()
      }
  
      dependencies {
          // Spigot
          implementation group: 'org.spigotmc', name: 'spigot-api', version: '1.15.2-R0.1-SNAPSHOT'
  
          // Postgres
          compile group: 'org.postgresql', name: 'postgresql', version: '42.2.12'
  
          // Flyway
          compile group: 'org.flywaydb', name: 'flyway-core', version: '6.4.1'
  
          // MyBatis
          compile group: 'org.mybatis', name: 'mybatis', version: '3.5.4'
  
          // Log4J
          compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.13.2'
          compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.13.2'
      }
  
      jar {
          from {
              configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
          }
      }
  
      javadoc {
          options.links += "https://hub.spigotmc.org/javadocs/spigot/"
      }
  
      task sourcesJar(type: Jar) {
          from sourceSets.main.allJava
          archiveClassifier.set("sources")
      }
  
      task javadocJar(type: Jar, dependsOn: javadoc) {
          classifier 'javadoc'
          from javadoc.destinationDir
      }
  
  </code></pre>
  
  <p>And it errors here on our 2nd line</p>
  
  <pre><code>
      Flyway flyway = Flyway.configure()
              .dataSource(getJdbcString(), DATABASE_USERNAME, DATABASE_PASSWORD)
              .load();
      flyway.migrate();
  
  </code></pre>
  
  <p>I can confirm the jdbcstring &amp; username/password are correct as I was able to make a connection via DriverManager, but Flyway just can't seem to find the driver. Plus I can see the driver in my output jar, where its located in blah.jar\org\postgresql\Driver.class</p>
  
  <p>I appreciate any help!! Thank you</p>