Some jOOQ API is generated by a closed source code generator (e.g. to produce the Record1 - Record22 types and all relevant methods on them). This API is annotated using @javax.annotation.Generated for documentation purposes, mostly to prevent manual edits.
The annotation is part of the java.xml.ws.annotation module. Referencing it adds a dependency on that module, which we otherwise do not use:
https://docs.oracle.com/javase/9/docs/api/java.xml.ws.annotation-summary.html
Since we do not use the annotation for any processing, and since jOOQ 3.12 will be the first modularised release (see #6612), we'll stop using this annotation.
Since someone else might have a dependency on jOOQ using this annotation, this issue is marked as an "Incompatible change".
Fixed on commercial branch. Checkin on OSS branch will follow soon, once #6612 is implemented.
Hello, is a backport scheduled for 3.11 ?
@quen2404 This is an incompatible change - since some people may have relied on this annotation being present, so chances are quite slim to introduce this change in a patch release. What's your use-case for having this backported?
Since 3.12 has not been released yet, people migrating to JDK 11 with 3.11 will see their generated code fail to compile: http://openjdk.java.net/jeps/320
The problem can be worked around by adding a manual dependency on the javax.annotation package in the pom.xml file, like this:
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
@guss77 Wow you are a lifesaver! I gave you a heart but it wasn't enough. Thanks a bunch! I'm new to java dependencies and this helped a lot :).
@skamensky Please also note that in the meantime jOOQ 3.12 has been released. So we recommend upgrading.
@knutwannheden Yes but for some reason on Maven in IntelliJ it doesn't show up as an option. The latest release showing up there is 3.11.12
Here's where I add Maven dependencies/packages

Here's what's showing up

You might be querying a company cache? It's been deployed to Maven central:
https://search.maven.org/search?q=g:org.jooq%20AND%20a:jooq&core=gav
You were right :). I was using https://repo1.maven.org/maven2 but the correct repo was https://oss.sonatype.org/content/repositories/releases/. I have it now.
On Maven Central you will also find jOOQ 3.12.3: https://repo1.maven.org/maven2/org/jooq/jooq/3.12.3/.
I'm still seeing this annotation in generated code in jOOQ 3.12.3. Is there an option I should be setting to disable it? Here's what it looks like in Indexes.java in my generated code tree:
@Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.12.3",
"schema version:public_26674f9fab42cfb343bf03d00d59f4a4"
},
date = "2019-12-09T15:22:50.476Z",
comments = "This class is generated by jOOQ"
)
It's no big deal to add the annotation API dependency to my build, but my understanding from reading this issue's history is that with jOOQ 3.12.3, I shouldn't have to do so.
I'm using nu.studer:gradle-jooq-plugin:3.0.3 to run the jOOQ code generator, in case that's relevant. It's configured to use jOOQ 3.12.3.
Thanks for your message, @sgrimm. This issue is about removing the annotation from jOOQ code (i.e. jOOQ's internals, including e.g. jOOQ-meta, which contains generated code for all the vendor specific INFORMATION_SCHEMA tables).
In order to remove it from your own code, use <generatedAnnotation/>. Apparently, this documentation is missing from the manual, we'll add it soon: https://github.com/jOOQ/jOOQ/issues/9646
You can find the complete code generation configuration schema here: https://www.jooq.org/xsd/jooq-codegen-3.12.0.xsd
It works the same way with Etienne Studer's gradle plugin.
@sgrimm It's no big deal to add the annotation API dependency to my build, but my understanding from reading this issue's history is that with jOOQ 3.12.3, I shouldn't have to do so.
In fact, you really shouldn't have to do so. Since 3.12, the correct annotation should be produced from whatever JDK you're using to generate your code. Are you using the same JDK to generate jOOQ code as you're using to compile it?
Most helpful comment
Since 3.12 has not been released yet, people migrating to JDK 11 with 3.11 will see their generated code fail to compile: http://openjdk.java.net/jeps/320
The problem can be worked around by adding a manual dependency on the
javax.annotationpackage in the pom.xml file, like this: