Home > OS >  Plugin org.jooq.pro:jooq-codegen-maven or one of its dependencies could not be resolved
Plugin org.jooq.pro:jooq-codegen-maven or one of its dependencies could not be resolved

Time:11-02

I'm setting up the free trial of jOOQ's commercial edition with the below dependencies:

<dependency> 
    <groupId>org.jooq.pro-java-8</groupId> 
    <artifactId>jooq</artifactId> 
    <version>3.15.3</version> 
</dependency> 
<dependency> 
    <groupId>org.jooq.pro-java-8</groupId> 
    <artifactId>jooq-meta</artifactId> 
    <version>3.15.3</version> 
</dependency> 
<dependency> 
    <groupId>org.jooq.pro-java-8</groupId> 
    <artifactId>jooq-codegen</artifactId> 
    <version>3.15.3</version> 
</dependency>

And the code generator plugin:

<plugin>
    <groupId>org.jooq.pro-java-8</groupId> 
    <artifactId>jooq-codegen-maven</artifactId>
    <version>3.15.3</version> 
</plugin>

However, I'm getting the following error:

[ERROR] Plugin org.jooq.pro-java-8:jooq-codegen-maven:3.15.3 or one of its dependencies could not be resolved: Could not find artifact org.jooq.pro-java-8:jooq-codegen-maven:jar:3.15.3 in central (https://repo.maven.apache.org/maven2)

What could be the reason?

(Note, I'm asking this question to to document the jOOQ commercial edition specific answer here on Stack Overflow, as this has been a common support request from users, and as this is encouraged by Stack Overflow).

CodePudding user response:

The most common reasons why a commercial jOOQ artifact cannot be resolved are:

Maven Central

As of jOOQ 3.15, the commercial edition is not published to Maven Central, but available only from the jOOQ website: https://www.jooq.org/download/versions. The distribution can be downloaded as a ZIP file, which contains scripts to publish the artifacts in a local repository (via mvn install or mvn deploy)

Maven groupId per edition

The groupId is incorrect for the free trial. These are the current Maven groupId values for each artifact, as documented also here:

  • org.jooq for the Open Source Edition
  • org.jooq.pro for commercial editions with the latest Java support (Java 17 for jOOQ 3.15)
  • org.jooq.pro-java-11 for commercial editions with Java 11 support
  • org.jooq.pro-java-8 for commercial editions with Java 8 support
  • org.jooq.pro-java-6 for commercial editions with Java 6 support (until jOOQ 3.14)
  • org.jooq.trial for the free trial edition with the latest Java support (Java 17 for jOOQ 3.15)
  • org.jooq.trial-java-11 for the free trial edition with Java 11 support
  • org.jooq.trial-java-8 for the free trial edition with Java 8 support

Spring Boot

Spring Boot offers starters that depend on the jOOQ Open Source Edition. If you're using Spring Boot with a commercial edition of jOOQ, you must make sure the Open Source Edition isn't included by the starter.

One way to achieve that is to exclude it explicitly from the Maven dependency of the starter, as documented also in this blog post:

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-jooq</artifactId>
 
  <!-- Exclude the jOOQ Open Source Edition -->
  <exclusions>
    <exclusion>
      <groupId>org.jooq</groupId>
      <artifactId>jooq</artifactId>
    </exclusion>
  </exclusions>
</dependency>
  • Related