Closed altinukshini closed 6 years ago
P.S. is there a way we can update the mvn artifact here (https://mvnrepository.com/artifact/org.flywaydb/flyway-ant/4.2.0) to require flyway 5.1.4 instead of 4.2.0. How can we do that?
org.flywaydb:flyway-ant:4.2.0
is the old version of the Flyway Ant plugin. You have to use cz.net21.flyway.ant:flyway-ant:1.1.4
using the newest Flyway version (currently 5.1.4).
Updated to cz.net21.flyway.ant
.
Any idea what dependencies I'm missing here:
Caused by: org.flywaydb.core.api.FlywayException: Unable to instantiate class org.flywaydb.core.internal.util.logging.javautil.JavaUtilLogCreator : org.flywaydb.core.internal.util.logging.javautil.JavaUtilLogCreator
...
Caused by: java.lang.ClassNotFoundException: org.flywaydb.core.internal.util.logging.javautil.JavaUtilLogCreator
This is my ant config:
<path id="flyway.lib.path">
<fileset dir="framework/base/lib" includes="flyway*.jar"/>
</path>
<taskdef resource="org/flywaydb/ant/antlib.xml" uri="antlib:org.flywaydb.ant" classpathref="flyway.lib.path"/>
<path id="flyway.classpath">
<fileset dir="framework/entity/lib/jdbc" includes="postgresql-*.jar" />
</path>
The class org.flywaydb.core.internal.util.logging.javautil.JavaUtilLogCreator
was already removed from the actual flyway-core
source, but it's still included and used by the version 5.1.4.
Are you sure the version 5.1.4 is on you classpath?
Maybe are you using the actual state of the flyway-core build directly from the source code?
Nope, this is my only ivy dependency <dependency org="cz.net21.flyway.ant" name="flyway-ant" rev="1.1.4" conf="flyway-ant->default" />
conf <conf name="flyway-ant" description="Downloads Flyway Ant"/>
This downloads also flyway-core-5.1.4.jar
automatically, and I don't have any other flyway-core*
jar files in the same dir or anywhere elese in my project.
That's strange. Could you tell me the exact structure of your project in execution? Where are the libs and how is the Ant script setup?
Maybe this helps best: https://github.com/apache/ofbiz/tree/release14.12 I've set the flyway paths, taskdef and properties right under the <project ...> tag.
<path id="flyway.lib.path">
<!-- include all jars from the Flyway AntLib distribution -->
<fileset dir="framework/base/lib" includes="flyway*.jar"/>
</path>
<path id="flyway.classpath">
<fileset dir="framework/entity/lib/jdbc" includes="postgresql-42.2.4.jar" />
</path>
<taskdef uri="antlib:org.flywaydb.ant" resource="org/flywaydb/ant/antlib.xml"
classpathref="flyway.lib.path"/>
<property name="flyway.locations" value="filesystem:./sql" />
<property name="flyway.baselineVersion" value="1"/>
<property name="flyway.baselineOnMigrate" value="true" />
<property name="flyway.mixed" value="true" />
<property name="flyway.password" value="PASSWORD"/>
<property name="flyway.user" value="USERNAME"/>
<property name="flyway.url" value="jdbc:postgresql://127.0.0.1:5432/DATABASE"/>
<target name="flyway-build">
<flyway:repair />
<flyway:migrate />
<flyway:info />
</target>
FYI Any older version exc 1.0.0
throws Flyway Error: org.flywaydb.core.api.FlywayException: Unable to instantiate JDBC driver: org.postgresql.Driver => Check whether the jar file is present
with the same configuration.
I will take a look at this.
I have found the classpath problem and just commited a hotfix.
Could you build it by yourself from the source mvn clean package
and try it out?
I will release a new version with the bugfix later.
I confirm this fixed the issue! Thank you so much for the quick fix.
I thank you for the report and patience! The new release will come soon (propably today).
Is there a way to use the licensed flyway version with this plugin?