gradle flywayMigrate failing on missing postgresql CopyManager #2355
Which version and edition of Flyway are you using?
flyway plugin 5.2.4 community edition
If this is not the latest version, can you reproduce the issue with the latest one as well?
(Many bugs are fixed in newer releases and upgrading will often resolve the issue)
this has worked perfectly in a maven POM version for years - there is nothing wrong with the SQL.
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)
gradle plugin 5.2.4
Which database are you using (type & version)?
Which operating system are you using?
What did you do?
(Please include the content causing the issue, any relevant configuration settings, the SQL statement that failed (if relevant) and the command you ran.)
What did you expect to see?
What did you see instead?
note the error:
not sure what to do!!
The text was updated successfully, but these errors were encountered:
Well, the way I see it, the issue is that the task is relying on the buildscript-scoped classloader to find the driver. I would assume this was affected by gradle 5.x upgrade and related api changes, but I am not too familiar with the gradle plugin api to state this with confidence. As I mentioned, this is a workaround and by no means a permanent solution, since I am sure this is not how it is supposed to work. Hopefully this will get fixed in 6.0 (at least it was tagged for 6).
@gregkoganvmm Thanks for investigating. That makes sense. I must admit I am not 100% sure yet what the best way forward is. In the past we basically patched additional jar file URLs in the root URLClassLoader. Starting with Java 9, this is however no longer possible, hence the code you linked to. That approach works well, except for this one case where we make direct use of driver classes in the code, as opposed to simply loading the driver via reflection like we do for all other cases.
Anything useful in the answers below? Seems like there are solutions that work through java11.