Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Liquibase dependency of jooq-meta-extensions-liquibase to 4.x #11659

Closed
mshima opened this issue Mar 16, 2021 · 4 comments
Closed

Upgrade Liquibase dependency of jooq-meta-extensions-liquibase to 4.x #11659

mshima opened this issue Mar 16, 2021 · 4 comments

Comments

@mshima
Copy link

mshima commented Mar 16, 2021

Description

Executing jooq-meta-extensions-liquibase with liquibase 4.x fails:

Error:  Failed to execute goal org.jooq:jooq-codegen-maven:3.14.8:generate (jooq-codegen) on project jhipster: Execution jooq-codegen of goal org.jooq:jooq-codegen-maven:3.14.8:generate failed: An API incompatibility was encountered while executing org.jooq:jooq-codegen-maven:3.14.8:generate: java.lang.NoSuchMethodError: liquibase.resource.FileSystemResourceAccessor: method 'void <init>()' not found

The problem seems that liquibase 3 FileSystemResourceAccessor had an empty constructor:
https://github.com/liquibase/liquibase/blob/46fc9ce9ba08806d9ad943983cc99f4f9160aeb7/liquibase-core/src/main/java/liquibase/resource/FileSystemResourceAccessor.java#L24-L28

While liquibase 4 FileSystemResourceAccessor have only a varargs constructor:
https://github.com/liquibase/liquibase/blob/7e12c779a78005663611532212649876d5387b04/liquibase-core/src/main/java/liquibase/resource/FileSystemResourceAccessor.java#L31-L43

My guess is that this is a compiler issue and probably FileSystemResourceAccessor will have to be instantiated dynamically, with FileSystemResourceAccessor.class.newInstance();

Steps to reproduce the problem

Generate a new project with jhipster and start it.
Using jhipster local installation:

mkdir jooq-liquibase
cd jooq-liquibase
npm install jhipster/generator-jhipster-jooq#main
npx jhipster/generator-jhipster@main jdl default --blueprints jooq --skip-jhipster-dependencies --build maven
./mvnw -P-webapp

Using jhipster global installation

mkdir jooq-liquibase
cd jooq-liquibase
npm install -g jhipster/generator-jhipster-jooq#main
npm install -g jhipster/generator-jhipster#main
jhipster jdl default --blueprints jooq --skip-jhipster-dependencies --build maven
./mvnw -P-webapp

Log using maven:
https://github.com/jhipster/generator-jhipster-jooq/runs/2117755090?check_suite_focus=true

Log using Gradle:
https://github.com/jhipster/generator-jhipster-jooq/runs/2123282020?check_suite_focus=true

Archives available at: https://github.com/jhipster/generator-jhipster-jooq/actions/runs/658961829
Maven app archive: https://github.com/jhipster/generator-jhipster-jooq/suites/2273735691/artifacts/47464376
Gradle app archive: https://github.com/jhipster/generator-jhipster-jooq/suites/2273735691/artifacts/47464375

Versions

  • jOOQ: 3.14.8
  • Java: 11
  • Database (include vendor): any
  • OS: linux
  • JDBC Driver (include name if inofficial driver): any
@lukaseder
Copy link
Member

lukaseder commented Mar 17, 2021

Thanks a lot for your report. I think we can bump the required liquibase version to 4 in the next minor release jOOQ 3.15 3.16, fixing this. Good to know that we'll have to watch out for backwards compatibility issues in this liquibase dependency...

@lukaseder
Copy link
Member

Unfortunately, 3.15.0 has shipped without this. I'll look into this now for 3.16.0

@lukaseder lukaseder changed the title jooq-meta-extensions-liquibase is broken with liquibase 4.x Upgrade Liquibase dependency of jooq-meta-extensions-liquibase to 4.x Jul 20, 2021
@lukaseder
Copy link
Member

Using this hack, we can continue supporting Liquibase 3.x:

FileSystemResourceAccessor fsra;

try {
    fsra = new FileSystemResourceAccessor();
}

// [#11659] Continue supporting Liquibase 3.x
catch (NoSuchMethodError e) {
    fsra = FileSystemResourceAccessor.class.getConstructor().newInstance();
}

An important reminder to keep an eye out for such binary incompatible changes...

@lukaseder
Copy link
Member

These things have changed in a weird way between Liquibase 3 and 4, see #13031.

I'll unsupport Liquibase 3, I guess

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants