0

I have a maven multiple module project and I use IntelliJ for development (importing the POM). The project structure is:

project

  • entities-module (JPA entities)
  • query-module (jOOP codegen maven plugin using JPADatabase)
  • app-module(app logic module)

The problem I'm having is that IntelliJ is not running jOOQ codegen plugin (I'm using Intellij build logic, not delegating to Maven goals).

What I'm doing right now is to do a build from Maven, to force jOOQ code gen and then work from IntelliJ. But this is error prone and I would like to avoid it.

Following the corresponding snippets of my POM:

pom.xml/project/build/pluginManagement/plugins:

        <plugin>
          <groupId>org.jooq</groupId>
          <artifactId>jooq-codegen-maven</artifactId>
          <version>${jooq.version}</version>
          <dependencies>
            <dependency>
              <groupId>org.springframework.boot</groupId>
              <artifactId>spring-boot-starter-data-jpa</artifactId>
              <version>${spring-boot.version}</version>
            </dependency>
            <dependency>
              <groupId>org.jooq</groupId>
              <artifactId>jooq-meta-extensions</artifactId>
              <version>${jooq.version}</version>
            </dependency>
            <dependency>
              <groupId>org.jooq</groupId>
              <artifactId>jooq-meta-extensions-hibernate</artifactId>
              <version>${jooq.version}</version>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <id>jooq-codegen</id>
              <phase>generate-sources</phase>
              <goals>
                <goal>generate</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <generator>
              <database>
                <name>org.jooq.meta.extensions.jpa.JPADatabase</name>
                <properties>
                </properties>
              </database>
            </generator>
          </configuration>
        </plugin>

pom.xml/project/build/plugins:

      <plugin>
        <groupId>org.jooq</groupId>
        <artifactId>jooq-codegen-maven</artifactId>
        <dependencies>
          <dependency>
            <groupId>org.foo</groupId>
            <artifactId>foo-lib</artifactId>
            <version>${project.version}</version>
          </dependency>
        </dependencies>
        <configuration>
          <generator>
            <database>
              <properties>
                <property>
                  <key>packages</key>
                  <value>
                    org.foo.data
                  </value>
                </property>
              </properties>
            </database>
            <target>
              <packageName>org.foo.data</packageName>
              <directory>target/generated-sources/jooq</directory>
            </target>
          </generator>
        </configuration>
      </plugin>
  • Intellij does not know about jOOQ. You could delegate the build to Maven. – Simon Martinelli Aug 31 '21 at 06:37
  • 1
    This vaguely reminds me of a Maven issue, I've seen. Does it work if you move the `` into the ``? – Lukas Eder Aug 31 '21 at 08:24
  • Does invoking [this action](https://monosnap.com/file/alwoLrpTktwlWORO1NpfpfUljMSGsM) help? Can you provide a sample project to check this? Thanks. – Andrey Aug 31 '21 at 10:49
  • Lukas, your suggestion of into does not make a difference. Thanks. Andrey, clicking on the action you pointed out does not generate the jOOQ DSL classes. Thanks. Following is a simple project showing the problem: https://github.com/tucu00/jooq-codegen-mvn-intellij Thanks in advance – Alejandro Abdelnur Sep 06 '21 at 21:22
  • I guess IntelliJ would need a plugin for recognizing jOOQ codegen maven plugin configuration. – Alejandro Abdelnur Sep 07 '21 at 20:38

0 Answers0