Coder Social home page Coder Social logo

Comments (9)

adrianskrobaczrevolut avatar adrianskrobaczrevolut commented on June 19, 2024 1

Thanks for the repo it was helpful 👍 I did some digging and I found what is the problem. Current implementation of the plugin assumes that the Java plugin will be applied before the jooq plugin and seems like it's not the case for this project. What bothers me is that we actually have the test case for Java project compilation here, that passes but when I copy exact same setup as a standalone project it fails the same way your reporo exmple 🤔 I'll do some more digging later maybe I'll be able to reproduce the problem with the test somehow, but anyways I'll fix the problem in the next release. Unfortunately until that you will have to stick to the workaround you proposed or to older version or in the more complex setups with subprojects it seems to work just fine. Thanks for raising the issue and I'll keep you posted here once I fix it 👍

from jooq-plugin.

rnorth avatar rnorth commented on June 19, 2024 1

Great, thanks so much! I’ll give it a try and let you know.

from jooq-plugin.

adrianskrobaczrevolut avatar adrianskrobaczrevolut commented on June 19, 2024 1

@victorlopezsalazar that's actually to be expected 😅 That's because versions >0.3.2 use configuration options introduced in flyway 6.x.x. I don't plan on downgrading flyway version used by plugin, but maybe we can sort this out somehow by using map properties instead of FluentConfiguration#defaultSchema, so it's more backwards friendly, but let's track that in this issue: #10

from jooq-plugin.

rnorth avatar rnorth commented on June 19, 2024 1

I’ve upgraded to 0.3.4 and removed the workarounds, and it seems to work perfectly! Thanks for solving the problem @adrianskrobaczrevolut!

from jooq-plugin.

adrianskrobaczrevolut avatar adrianskrobaczrevolut commented on June 19, 2024

Hey @rnorth 🙂
That's actually very interesting, because >0.2.5 are the versions where I actually fixed the ugly way we used to configure source sets 😅 b12e666#diff-83a8e2a543bc56687e2b75ec62457ef6R93
One thing that crosses my mind is that on previous versions the plugin was automatically applying the java plugin now it's not doing that anymore(click) and let users apply either that or Kotlin plugin depending on needs. Could you try explicitly applying java plugin to the project ? If that doesn't help it would be really helpful if you could post some simple setup that reproduces the problem.

from jooq-plugin.

rnorth avatar rnorth commented on June 19, 2024

Ah, maybe I've hit an edge case against the new way of doing things then!

I'll create an example repository: unfortunately I already have the java plugin applied, so it must be some other nuance.

Thanks for getting back to me quickly!

from jooq-plugin.

rnorth avatar rnorth commented on June 19, 2024

Quick repository to demonstrate this:

https://github.com/rnorth/jooq-plugin-issue9-repro

  • Master branch uses v0.3.3 of the plugin along with manually-added sourcesets. Compiles OK.
  • This branch uses v0.3.3 without the manual sourcesets. Compilation of code in main fails.
  • This branch downgrades the plugin to v0.2.5 and removes the manual sourcesets. Compiles OK.

I hope this helps - if you spot anything I'm doing wrong please do let me know.

from jooq-plugin.

adrianskrobaczrevolut avatar adrianskrobaczrevolut commented on June 19, 2024

@rnorth @victorlopezsalazar should be now fixed in latest 0.3.4 version. Let me know if it works for you guys 🙂

from jooq-plugin.

victorlopezsalazar avatar victorlopezsalazar commented on June 19, 2024

In my case going from 0.3.2 to 0.3.4, I got the following stacktrace:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':generateJooqClasses'.
   ...

Caused by: java.lang.NoSuchMethodError: org.flywaydb.core.api.configuration.FluentConfiguration.defaultSchema(Ljava/lang/String;)Lorg/flywaydb/core/api/configuration/FluentConfiguration;
        at com.revolut.jooq.GenerateJooqClassesTask.migrateDb(GenerateJooqClassesTask.kt:165)
        at com.revolut.jooq.GenerateJooqClassesTask.access$migrateDb(GenerateJooqClassesTask.kt:23)
        at com.revolut.jooq.GenerateJooqClassesTask$generateClasses$$inlined$use$lambda$1.execute(GenerateJooqClassesTask.kt:153)
        at com.revolut.jooq.GenerateJooqClassesTask$generateClasses$$inlined$use$lambda$1.execute(GenerateJooqClassesTask.kt:23)
        at com.revolut.jooq.Docker.runInContainer(Docker.kt:38)
        at com.revolut.jooq.GenerateJooqClassesTask.generateClasses(GenerateJooqClassesTask.kt:152)

the config for the task is the following:

generateJooqClasses {
    schemas = ["my_schema"]
    basePackageName = "package"
    customizeGenerator {
        generate = new Generate()
                    .withRelations(true)
                    .withDeprecated(false)
                    .withRecords(true)
                    .withImmutablePojos(true)
                    .withFluentSetters(true)
                    .withJavaTimeTypes(false)
                    .withPojosEqualsAndHashCode(true)
    }
}

worth to mention that I also have the configuration to replace the flyway version enabled:

resolutionStrategy {
            dependencySubstitution {
                substitute(module("org.flywaydb:flyway-core"))
                        .with(module("org.flywaydb:flyway-core:5.2.4"))
            }
        }

I will play around with configs later when I got a little time to do it.

from jooq-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.