Can’t resolve image ‘VERSION_3_17’ in jOOQ generated code – Java, SQL and jOOQ.

on

|

views

and

comments

[ad_1]

Beginning with jOOQ 3.16 and #12601, there could also be a compilation error with a message like this in your jOOQ generated code:

[ERROR] …/DefaultCatalog.java:[53,73] can not discover image
[ERROR] image: variable VERSION_3_17
[ERROR] location: class org.jooq.Constants

Usually, this error is combined with different compilation errors in generated code. Its objective is to assist troubleshoot these different compilation errors. This error is attributable to a mismatch between two jOOQ artifacts which might be being utilized by customers, together with:

  • org.jooq:jooq (the runtime library)
  • org.jooq:jooq-codegen (the code technology library)

That is additionally documented within the Javadoc of mentioned generated code:

/**
 * A reference to the three.17 minor launch of the code generator. If this
 * would not compile, it is as a result of the runtime library makes use of an older minor
 * launch, specifically: 3.17. You possibly can flip off the technology of this reference
 * by specifying /configuration/generator/generate/jooqVersionReference
 */
personal static last String REQUIRE_RUNTIME_JOOQ_VERSION = 
    Constants.VERSION_3_17;

Identical to with the JDK that has a runtime (the JDK or JRE) and a code generator (the compiler), customers should ensure that the runtime model is all the time >= the code technology model.

In the event you see the above error, you may need a configuration like this, in your maven or gradle construct:

<!-- A runtime dependency. -->
<dependency>
    <groupId>org.jooq</groupId>
    <artifactId>jooq</artifactId>
    <model>3.16.9</model>
</dependency>

<!-- After which, afterward: -->
<plugin>
    <groupId>org.jooq</groupId>
    <artifactId>jooq-codegen-maven</artifactId>
    <model>3.17.3</model>
</plugin>

The three.17 model of the code generator will produce code that may be consumed solely by the runtime library 3.17 or newer. Whereas it’s completely tremendous to make use of an older code generator with a more moderen runtime:

  • org.jooq:jooq:3.17.3
  • org.jooq:jooq-codegen:3.16.9

The above configuration is just not supported:

  • org.jooq:jooq:3.16.9
  • org.jooq:jooq-codegen:3.17.3

In different phrases:

  • Generated code is ahead appropriate, however not backward appropriate.
  • The runtime API (which is utilized by generated code) is backward appropriate, however not ahead appropriate.

Nevertheless, if doable, the advice is to all the time match the code technology library and the runtime library to keep away from another hassle.

Turning off the function

If this code technology function bothers you, you’ll be able to all the time flip it off by specifying:

<configuration>
  <generator>
    <generate>
      <jooqVersionReference>false</jooqVersionReference>
    </generate>
  </generator>
</configuration>

[ad_2]

Supply hyperlink

Share this
Tags

Must-read

Google Presents 3 Suggestions For Checking Technical web optimization Points

Google printed a video providing three ideas for utilizing search console to establish technical points that may be inflicting indexing or rating issues. Three...

A easy snapshot reveals how computational pictures can shock and alarm us

Whereas Tessa Coates was making an attempt on wedding ceremony clothes final month, she posted a seemingly easy snapshot of herself on Instagram...

Recent articles

More like this

LEAVE A REPLY

Please enter your comment!
Please enter your name here