I have a postgres:13.5-alpine
database running and set up jOOQ like so:
versions
plugin_jooq=7.1.1
lib_jooq=3.16.6
gradle
plugins {
id 'nu.studer.jooq' version "${plugin_jooq}"
}
dependencies {
api "org.postgresql:postgresql"
implementation "org.jooq:jooq:${lib_jooq}"
implementation "org.jooq:jooq-meta:${lib_jooq}"
implementation "org.jooq:jooq-codegen:${lib_jooq}"
}
jooq {
version = "${lib_jooq}"
edition = nu.studer.gradle.jooq.JooqEdition.OSS
configurations {
mydb {
generateSchemaSourceOnCompilation = true
generationTool {
logging = org.jooq.meta.jaxb.Logging.WARN
jdbc {
driver = 'org.postgresql.Driver'
url = 'jdbc:postgresql://localhost:5432/mydb'
user = '<username>'
password = '<password>'
properties {
property {
key = 'PAGE_SIZE'
value = 2048
}
}
}
generator {
name = 'org.jooq.codegen.DefaultGenerator'
database {
name = 'org.jooq.meta.postgres.PostgresDatabase'
inputSchema = 'public'
includes = '.*'
excludes = ''
}
target {
directory = 'build/generated/sources/'
packageName = 'my.app.jooq'
}
}
}
}
}
}
build.dependsOn generateMydbJooq
when I run codegen, I get
org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 927; cvc-complex-type.2.4.a:
Invalid content was found starting with element
'{"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":includeExcludePackageRoutines}'.
One of '{
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":properties,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":regexFlags,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":includeTables,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":includeEmbeddables,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":includeRoutines,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":includeTriggerRoutines,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":includePackages,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":includePackageRoutines,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":includePackageUDTs,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":includePackageConstants,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":includeUDTs,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":includeDomains,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":includeSequences,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":includeIndexes,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":includePrimaryKeys,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":includeUniqueKeys,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":includeForeignKeys,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":includeCheckConstraints,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":includeSystemIndexes,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":includeSystemCheckConstraints,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":includeInvisibleColumns,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":recordVersionFields,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":recordTimestampFields,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":syntheticObjects,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":syntheticIdentities,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":syntheticPrimaryKeys,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":overridePrimaryKeys,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":dateAsTimestamp,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":ignoreProcedureReturnValues,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":unsignedTypes,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":integerDisplayWidths,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":inputCatalog,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":outputCatalog,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":outputCatalogToDefault,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":inputSchema,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":outputSchema,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":outputSchemaToDefault,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":catalogs,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":schemata,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":schemaVersionProvider,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":catalogVersionProvider,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":orderProvider,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":embeddables,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":embeddablePrimaryKeys,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":embeddableUniqueKeys,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":embeddableDomains,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":customTypes,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":enumTypes,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":forcedTypes,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":forceIntegerTypesOnZeroScaleDecimals,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":tableValuedFunctions,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":logSlowQueriesAfterSeconds,
"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":logSlowResultsAfterSeconds
}' is expected.
org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 3351; cvc-complex-type.2.4.a: Invalid content was found starting with element
'{"http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd":visibilityModifier}'.
One of '{...}' is expected.
How do I resolve this?
UPDATE
Trying to apply @LukasEder's suggestion. Added the buildscript but error persists. Spun up some dependency tree, and these are the only dependencies mentioning jooq:
+--- project :my-app
| +--- org.jooq:jooq:3.16.6 -> 3.14.15
| | +--- org.reactivestreams:reactive-streams:1.0.2 -> 1.0.3
| | \--- javax.xml.bind:jaxb-api:2.3.1
| | \--- javax.activation:javax.activation-api:1.2.0
| +--- org.jooq:jooq-meta:3.16.6 -> 3.14.15
| | \--- org.jooq:jooq:3.14.15 (*)
| \--- org.jooq:jooq-codegen:3.16.6 -> 3.14.15
| +--- org.jooq:jooq:3.14.15 (*)
| \--- org.jooq:jooq-meta:3.14.15 (*)
UPDATE
Downgrade to 3.14.15 did not resolve this.
The third party code generation plugin you're using seems to be wired towards an older XSD version for your configuration objects. This can have various reasons, not sure why you're running into this, but as per the documentation here: https://github.com/etiennestuder/gradle-jooq-plugin#enforcing-the-jooq-configuration-xml-schema-version
You can enforce an XSD version like this: