jklingsporn / vertx-jooq

A jOOQ-CodeGenerator to create vertx-ified DAOs and POJOs.
MIT License
385 stars 53 forks source link

Using the gradle code from the examples fails, workaround included #164

Closed doctorpangloss closed 3 years ago

doctorpangloss commented 4 years ago

People receiving errors can go straight to the workaround below.

It's a great package! However it errors out with

Execution failed for task ':framework:jooqGenerate'.
> The <generator/> tag is mandatory. For details, see http://www.jooq.org/xsd/jooq-codegen-3.13.0.xsd

Also you need to add

classpath 'org.glassfish.jaxb:jaxb-runtime:2.3.0'
classpath 'javax.activation:activation:1.1'

to the buildscript's dependencies.

doctorpangloss commented 4 years ago

You should use this style of example instead, it works finally:

buildscript {
    ext {
        vertx_jooq_version = '5.2.0'
        postgresql_version = '42.2.16'
    }
    repositories {
        mavenLocal()
        mavenCentral()
    }
    dependencies {
        classpath "io.github.jklingsporn:vertx-jooq-generate:$vertx_jooq_version"
        classpath "org.postgresql:postgresql:$postgresql_version"
    }
}

import org.jooq.codegen.GenerationTool
import org.jooq.meta.jaxb.*

def configuration = new Configuration()
        configuration
                .withJdbc(new Jdbc()
                        .withDriver('org.postgresql.Driver')
                        .withUrl('jdbc:postgresql://host:5432/databasename')
                        .withUser('username')
                        .withPassword('password'))
                .withGenerator(new Generator()
                        .withName('io.github.jklingsporn.vertx.jooq.generate.classic.ClassicReactiveVertxGenerator')
                        .withDatabase(new Database()
                                .withName('org.jooq.meta.postgres.PostgresDatabase')
                                .withInputSchema('public')
                                .withIncludeTables(true)
                                .withIncludeRoutines(true)
                                .withIncludePackages(false)
                                .withIncludeUDTs(true)
                                .withIncludeSequences(true)
                                .withExcludes('schema_version')
                                .withIncludes('.*'))
                        .withGenerate(new Generate()
                                .withDeprecated(false)
                                .withRecords(false)
                                .withInterfaces(true)
                                .withFluentSetters(true)
                                .withPojos(true)
                                .withDaos(true))
                        .withTarget(new Target()
                                .withPackageName('package.name')
                                .withDirectory("$projectDir/src/generated/java"))
                        .withStrategy(new Strategy()
                                .withName('io.github.jklingsporn.vertx.jooq.generate.VertxGeneratorStrategy')))

        GenerationTool.generate(configuration)
jklingsporn commented 4 years ago

Thanks! As I am a maven user, this is very helpful.

Benjamin Berman notifications@github.com schrieb am So., 6. Sept. 2020, 03:29:

You should use this style of example instead:

def configuration = new Configuration() configuration .withJdbc(new Jdbc() .withDriver('org.postgresql.Driver') .withUrl('jdbc:postgresql://host:5432/databasename') .withUser('username') .withPassword('password')) .withGenerator(new Generator() .withName('io.github.jklingsporn.vertx.jooq.generate.classic.ClassicReactiveVertxGenerator') .withDatabase(new Database() .withName('org.jooq.meta.postgres.PostgresDatabase') .withInputSchema('public') .withIncludeTables(true) .withIncludeRoutines(true) .withIncludePackages(false) .withIncludeUDTs(true) .withIncludeSequences(true) .withExcludes('schema_version') .withIncludes('.*')) .withGenerate(new Generate() .withDeprecated(false) .withRecords(false) .withInterfaces(true) .withFluentSetters(true) .withPojos(true) .withDaos(true)) .withTarget(new Target() .withPackageName('package.name') .withDirectory("$projectDir/src/generated/java")) .withStrategy(new Strategy() .withName('io.github.jklingsporn.vertx.jooq.generate.VertxGeneratorStrategy')))

    GenerationTool.generate(configuration)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jklingsporn/vertx-jooq/issues/164#issuecomment-687684905, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQLZXSXPMWKNVYRNHQYL6LSELQXBANCNFSM4Q3TZG5A .

debiasej commented 4 years ago

The @doctorpangloss example works like a charm. It should be in the vertx-jooq-rx-reactive readme to better understanding.