Issue Using Jooq-codegen-gradle Plugin

71 views
Skip to first unread message

Debapriya Patra

unread,
Jun 21, 2024, 12:38:08 AM6/21/24
to jOOQ User Group
Hello,

I am trying to use the Jooq official codegen gradle plugin instead of a third party plugin, but I am having issues.

I am getting below error

```
* What went wrong:
A problem occurred evaluating script.
> Could not resolve all artifacts for configuration 'classpath'.
   > Could not find org.jooq:jooq-codegen-gradle:3.18.17.
     Searched in the following locations:
       - https://plugins.gradle.org/m2/org/jooq/jooq-codegen-gradle/3.18.17/jooq-codegen-gradle-3.18.17.pom
     Required by:
         unspecified:unspecified:unspecified

* Try:
> If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
```


Here is my jooq.gradle 

```
import org.jooq.meta.jaxb.Logging

buildscript {
repositories {
gradlePluginPortal()
}
dependencies {
classpath "org.jooq:jooq-codegen-gradle:3.19.10"
}
ext {
// use jOOQ version defined in Spring Boot
jooqVersion = dependencyManagement.importedProperties['jooq.version']
}
configurations.classpath {
// Enforce the jOOQ configuration XML schema version
resolutionStrategy.eachDependency {
if (requested.group == 'org.jooq' && requested.name.startsWith('jooq')) {
useVersion jooqVersion
}
}
}
}

apply plugin: 'org.jooq.jooq-codegen'

// JOOQ dependencies
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-jooq'
jooqGenerator 'com.mysql:mysql-connector-j'
jooqGenerator 'org.slf4j:slf4j-simple'

jooqGenerator 'com.fasterxml.jackson.core:jackson-databind'
jooqGenerator "org.testcontainers:mysql"
jooqGenerator 'org.testcontainers:jdbc'
}

jooq {
version = jooqVersion
configuration {
logging = Logging.WARN
jdbc {
driver = 'com.mysql.cj.jdbc.Driver'
}
generator {
name = 'org.jooq.codegen.DefaultGenerator'
database {
name = 'org.jooq.meta.mysql.MySQLDatabase'
inputSchema = 'lmsdb'
schemata {
schema {
inputSchema = 'lmsdb'
}
}
}
generate {
records = true
immutablePojos = true
fluentSetters = true
javaTimeTypes = false
}
target {
packageName = "com.chegg.${mainPackageName}.db"
}
strategy {
name = 'org.jooq.codegen.DefaultGeneratorStrategy'
}
}
}
}
```


Lukas Eder

unread,
Jun 21, 2024, 3:48:41 AM6/21/24
to jooq...@googlegroups.com
Hi,

The answer is here:
Could not find org.jooq:jooq-codegen-gradle:3.18.17.

The plugin was first released in 3.19.0

I hope this helps.


--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/b2c622cc-604d-4622-ab69-e4a888a51a1an%40googlegroups.com.

Debapriya Patra

unread,
Jun 21, 2024, 9:41:07 AM6/21/24
to jOOQ User Group
Hi,

If you look at my gradle code, I have clearly mentioned "org.jooq:jooq-codegen-gradle:3.19.10" . So from where its picking the org.jooq:jooq-codegen-gradle:3.18.17 ?

Thanks,

Lukas Eder

unread,
Jun 21, 2024, 9:50:43 AM6/21/24
to jooq...@googlegroups.com
Well, what about this? Why did you do this?
Reply all
Reply to author
Forward
0 new messages