Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jooq-codegen-maven plugin and JDK9 compilation error

Tags:

maven

java-9

jooq

I just upgraded my project form JDK8 to JDK9. I use JOOQ library version 3.9.5. I now see this error when I compile.

[ERROR] Failed to execute goal org.jooq:jooq-codegen-maven:3.9.5:generate (default) on project myproject-db-model: Execution default of goal org.jooq:jooq-codegen-maven:3.9.5:generate failed: A required class was missing while executing org.jooq:jooq-codegen-maven:3.9.5:generate: javax/xml/bind/JAXB
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.jooq:jooq-codegen-maven:3.9.5
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/jeanvaljean/.m2/repository/org/jooq/jooq-codegen-maven/3.9.5/jooq-codegen-maven-3.9.5.jar
[ERROR] urls[1] = file:/Users/jeanvaljean/.m2/repository/org/postgresql/postgresql/42.1.1/postgresql-42.1.1.jar
[ERROR] urls[2] = file:/Users/jeanvaljean/Workspace/MyProjects/myproject/model/dbms-strategies/target/myproject-dbms-strategies-0.2.0-SNAPSHOT.jar
[ERROR] urls[3] = file:/Users/jeanvaljean/.m2/repository/org/springframework/boot/spring-boot-starter-data-jpa/1.5.7.RELEASE/spring-boot-starter-data-jpa-1.5.7.RELEASE.jar
[ERROR] urls[4] = file:/Users/jeanvaljean/.m2/repository/org/springframework/boot/spring-boot-starter/1.5.7.RELEASE/spring-boot-starter-1.5.7.RELEASE.jar
[ERROR] urls[5] = file:/Users/jeanvaljean/.m2/repository/org/springframework/boot/spring-boot/1.5.7.RELEASE/spring-boot-1.5.7.RELEASE.jar
[ERROR] urls[6] = file:/Users/jeanvaljean/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/1.5.7.RELEASE/spring-boot-autoconfigure-1.5.7.RELEASE.jar
[ERROR] urls[7] = file:/Users/jeanvaljean/.m2/repository/org/springframework/boot/spring-boot-starter-logging/1.5.7.RELEASE/spring-boot-starter-logging-1.5.7.RELEASE.jar
[ERROR] urls[8] = file:/Users/jeanvaljean/.m2/repository/ch/qos/logback/logback-classic/1.1.11/logback-classic-1.1.11.jar
[ERROR] urls[9] = file:/Users/jeanvaljean/.m2/repository/ch/qos/logback/logback-core/1.1.11/logback-core-1.1.11.jar
[ERROR] urls[10] = file:/Users/jeanvaljean/.m2/repository/org/slf4j/log4j-over-slf4j/1.7.25/log4j-over-slf4j-1.7.25.jar
[ERROR] urls[11] = file:/Users/jeanvaljean/.m2/repository/org/yaml/snakeyaml/1.17/snakeyaml-1.17.jar
[ERROR] urls[12] = file:/Users/jeanvaljean/.m2/repository/org/springframework/boot/spring-boot-starter-aop/1.5.7.RELEASE/spring-boot-starter-aop-1.5.7.RELEASE.jar
[ERROR] urls[13] = file:/Users/jeanvaljean/.m2/repository/org/springframework/spring-aop/4.3.11.RELEASE/spring-aop-4.3.11.RELEASE.jar
[ERROR] urls[14] = file:/Users/jeanvaljean/.m2/repository/org/aspectj/aspectjweaver/1.8.10/aspectjweaver-1.8.10.jar
[ERROR] urls[15] = file:/Users/jeanvaljean/.m2/repository/org/springframework/boot/spring-boot-starter-jdbc/1.5.7.RELEASE/spring-boot-starter-jdbc-1.5.7.RELEASE.jar
[ERROR] urls[16] = file:/Users/jeanvaljean/.m2/repository/org/apache/tomcat/tomcat-jdbc/8.5.20/tomcat-jdbc-8.5.20.jar
[ERROR] urls[17] = file:/Users/jeanvaljean/.m2/repository/org/apache/tomcat/tomcat-juli/8.5.20/tomcat-juli-8.5.20.jar
[ERROR] urls[18] = file:/Users/jeanvaljean/.m2/repository/org/springframework/spring-jdbc/4.3.11.RELEASE/spring-jdbc-4.3.11.RELEASE.jar
[ERROR] urls[19] = file:/Users/jeanvaljean/.m2/repository/org/hibernate/hibernate-core/5.0.12.Final/hibernate-core-5.0.12.Final.jar
[ERROR] urls[20] = file:/Users/jeanvaljean/.m2/repository/org/jboss/logging/jboss-logging/3.3.0.Final/jboss-logging-3.3.0.Final.jar
[ERROR] urls[21] = file:/Users/jeanvaljean/.m2/repository/org/hibernate/javax/persistence/hibernate-jpa-2.1-api/1.0.0.Final/hibernate-jpa-2.1-api-1.0.0.Final.jar
[ERROR] urls[22] = file:/Users/jeanvaljean/.m2/repository/org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA.jar
[ERROR] urls[23] = file:/Users/jeanvaljean/.m2/repository/antlr/antlr/2.7.7/antlr-2.7.7.jar
[ERROR] urls[24] = file:/Users/jeanvaljean/.m2/repository/org/jboss/jandex/2.0.0.Final/jandex-2.0.0.Final.jar
[ERROR] urls[25] = file:/Users/jeanvaljean/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar
[ERROR] urls[26] = file:/Users/jeanvaljean/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar
[ERROR] urls[27] = file:/Users/jeanvaljean/.m2/repository/org/hibernate/common/hibernate-commons-annotations/5.0.1.Final/hibernate-commons-annotations-5.0.1.Final.jar
[ERROR] urls[28] = file:/Users/jeanvaljean/.m2/repository/org/hibernate/hibernate-entitymanager/5.0.12.Final/hibernate-entitymanager-5.0.12.Final.jar
[ERROR] urls[29] = file:/Users/jeanvaljean/.m2/repository/javax/transaction/javax.transaction-api/1.2/javax.transaction-api-1.2.jar
[ERROR] urls[30] = file:/Users/jeanvaljean/.m2/repository/org/springframework/data/spring-data-jpa/1.11.7.RELEASE/spring-data-jpa-1.11.7.RELEASE.jar
[ERROR] urls[31] = file:/Users/jeanvaljean/.m2/repository/org/springframework/data/spring-data-commons/1.13.7.RELEASE/spring-data-commons-1.13.7.RELEASE.jar
[ERROR] urls[32] = file:/Users/jeanvaljean/.m2/repository/org/springframework/spring-orm/4.3.11.RELEASE/spring-orm-4.3.11.RELEASE.jar
[ERROR] urls[33] = file:/Users/jeanvaljean/.m2/repository/org/springframework/spring-context/4.3.11.RELEASE/spring-context-4.3.11.RELEASE.jar
[ERROR] urls[34] = file:/Users/jeanvaljean/.m2/repository/org/springframework/spring-tx/4.3.11.RELEASE/spring-tx-4.3.11.RELEASE.jar
[ERROR] urls[35] = file:/Users/jeanvaljean/.m2/repository/org/springframework/spring-beans/4.3.11.RELEASE/spring-beans-4.3.11.RELEASE.jar
[ERROR] urls[36] = file:/Users/jeanvaljean/.m2/repository/org/springframework/spring-aspects/4.3.11.RELEASE/spring-aspects-4.3.11.RELEASE.jar
[ERROR] urls[37] = file:/Users/jeanvaljean/.m2/repository/org/jooq/jooq/3.9.5/jooq-3.9.5.jar
[ERROR] urls[38] = file:/Users/jeanvaljean/.m2/repository/org/jooq/jooq-meta/3.9.5/jooq-meta-3.9.5.jar
[ERROR] urls[39] = file:/Users/jeanvaljean/.m2/repository/org/springframework/cloud/spring-cloud-starter-hystrix/1.1.5.RELEASE/spring-cloud-starter-hystrix-1.1.5.RELEASE.jar
[ERROR] urls[40] = file:/Users/jeanvaljean/.m2/repository/org/springframework/cloud/spring-cloud-starter/1.1.1.RELEASE/spring-cloud-starter-1.1.1.RELEASE.jar
[ERROR] urls[41] = file:/Users/jeanvaljean/.m2/repository/org/springframework/cloud/spring-cloud-context/1.1.1.RELEASE/spring-cloud-context-1.1.1.RELEASE.jar
[ERROR] urls[42] = file:/Users/jeanvaljean/.m2/repository/org/springframework/security/spring-security-crypto/4.0.4.RELEASE/spring-security-crypto-4.0.4.RELEASE.jar
[ERROR] urls[43] = file:/Users/jeanvaljean/.m2/repository/org/springframework/cloud/spring-cloud-commons/1.1.1.RELEASE/spring-cloud-commons-1.1.1.RELEASE.jar
[ERROR] urls[44] = file:/Users/jeanvaljean/.m2/repository/org/springframework/security/spring-security-rsa/1.0.1.RELEASE/spring-security-rsa-1.0.1.RELEASE.jar
[ERROR] urls[45] = file:/Users/jeanvaljean/.m2/repository/org/bouncycastle/bcpkix-jdk15on/1.47/bcpkix-jdk15on-1.47.jar
[ERROR] urls[46] = file:/Users/jeanvaljean/.m2/repository/org/bouncycastle/bcprov-jdk15on/1.47/bcprov-jdk15on-1.47.jar
[ERROR] urls[47] = file:/Users/jeanvaljean/.m2/repository/org/springframework/cloud/spring-cloud-netflix-core/1.1.5.RELEASE/spring-cloud-netflix-core-1.1.5.RELEASE.jar
[ERROR] urls[48] = file:/Users/jeanvaljean/.m2/repository/org/springframework/cloud/spring-cloud-starter-archaius/1.1.5.RELEASE/spring-cloud-starter-archaius-1.1.5.RELEASE.jar
[ERROR] urls[49] = file:/Users/jeanvaljean/.m2/repository/com/netflix/archaius/archaius-core/0.7.4/archaius-core-0.7.4.jar
[ERROR] urls[50] = file:/Users/jeanvaljean/.m2/repository/commons-configuration/commons-configuration/1.8/commons-configuration-1.8.jar
[ERROR] urls[51] = file:/Users/jeanvaljean/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
[ERROR] urls[52] = file:/Users/jeanvaljean/.m2/repository/com/netflix/hystrix/hystrix-core/1.5.3/hystrix-core-1.5.3.jar
[ERROR] urls[53] = file:/Users/jeanvaljean/.m2/repository/io/reactivex/rxjava/1.1.1/rxjava-1.1.1.jar
[ERROR] urls[54] = file:/Users/jeanvaljean/.m2/repository/org/hdrhistogram/HdrHistogram/2.1.7/HdrHistogram-2.1.7.jar
[ERROR] urls[55] = file:/Users/jeanvaljean/.m2/repository/com/netflix/hystrix/hystrix-metrics-event-stream/1.5.3/hystrix-metrics-event-stream-1.5.3.jar
[ERROR] urls[56] = file:/Users/jeanvaljean/.m2/repository/com/netflix/hystrix/hystrix-javanica/1.5.3/hystrix-javanica-1.5.3.jar
[ERROR] urls[57] = file:/Users/jeanvaljean/.m2/repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar
[ERROR] urls[58] = file:/Users/jeanvaljean/.m2/repository/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar
[ERROR] urls[59] = file:/Users/jeanvaljean/.m2/repository/org/ow2/asm/asm/5.0.4/asm-5.0.4.jar
[ERROR] urls[60] = file:/Users/jeanvaljean/.m2/repository/org/springframework/boot/spring-boot-starter-web/1.5.7.RELEASE/spring-boot-starter-web-1.5.7.RELEASE.jar
[ERROR] urls[61] = file:/Users/jeanvaljean/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/1.5.7.RELEASE/spring-boot-starter-tomcat-1.5.7.RELEASE.jar
[ERROR] urls[62] = file:/Users/jeanvaljean/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/8.5.20/tomcat-embed-core-8.5.20.jar
[ERROR] urls[63] = file:/Users/jeanvaljean/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/8.5.20/tomcat-embed-el-8.5.20.jar
[ERROR] urls[64] = file:/Users/jeanvaljean/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/8.5.20/tomcat-embed-websocket-8.5.20.jar
[ERROR] urls[65] = file:/Users/jeanvaljean/.m2/repository/org/hibernate/hibernate-validator/5.3.5.Final/hibernate-validator-5.3.5.Final.jar
[ERROR] urls[66] = file:/Users/jeanvaljean/.m2/repository/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final.jar
[ERROR] urls[67] = file:/Users/jeanvaljean/.m2/repository/com/fasterxml/classmate/1.3.1/classmate-1.3.1.jar
[ERROR] urls[68] = file:/Users/jeanvaljean/.m2/repository/org/springframework/spring-web/4.3.11.RELEASE/spring-web-4.3.11.RELEASE.jar
[ERROR] urls[69] = file:/Users/jeanvaljean/.m2/repository/org/springframework/spring-webmvc/4.3.11.RELEASE/spring-webmvc-4.3.11.RELEASE.jar
[ERROR] urls[70] = file:/Users/jeanvaljean/.m2/repository/org/springframework/spring-expression/4.3.11.RELEASE/spring-expression-4.3.11.RELEASE.jar
[ERROR] urls[71] = file:/Users/jeanvaljean/.m2/repository/org/springframework/boot/spring-boot-starter-actuator/1.5.7.RELEASE/spring-boot-starter-actuator-1.5.7.RELEASE.jar
[ERROR] urls[72] = file:/Users/jeanvaljean/.m2/repository/org/springframework/boot/spring-boot-actuator/1.5.7.RELEASE/spring-boot-actuator-1.5.7.RELEASE.jar
[ERROR] urls[73] = file:/Users/jeanvaljean/.m2/repository/org/springframework/retry/spring-retry/1.2.1.RELEASE/spring-retry-1.2.1.RELEASE.jar
[ERROR] urls[74] = file:/Users/jeanvaljean/.m2/repository/org/springframework/spring-core/4.3.9.RELEASE/spring-core-4.3.9.RELEASE.jar
[ERROR] urls[75] = file:/Users/jeanvaljean/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar
[ERROR] urls[76] = file:/Users/jeanvaljean/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.8.10/jackson-databind-2.8.10.jar
[ERROR] urls[77] = file:/Users/jeanvaljean/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.8.0/jackson-annotations-2.8.0.jar
[ERROR] urls[78] = file:/Users/jeanvaljean/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.8.10/jackson-core-2.8.10.jar
[ERROR] urls[79] = file:/Users/jeanvaljean/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.8.10/jackson-datatype-jdk8-2.8.10.jar
[ERROR] urls[80] = file:/Users/jeanvaljean/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.8.10/jackson-datatype-jsr310-2.8.10.jar
[ERROR] urls[81] = file:/Users/jeanvaljean/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr353/2.8.10/jackson-datatype-jsr353-2.8.10.jar
[ERROR] urls[82] = file:/Users/jeanvaljean/.m2/repository/org/glassfish/javax.json/1.1/javax.json-1.1.jar
[ERROR] urls[83] = file:/Users/jeanvaljean/.m2/repository/javax/json/javax.json-api/1.1/javax.json-api-1.1.jar
[ERROR] urls[84] = file:/Users/jeanvaljean/.m2/repository/com/google/code/gson/gson/2.8.1/gson-2.8.1.jar
[ERROR] urls[85] = file:/Users/jeanvaljean/.m2/repository/com/jayway/jsonpath/json-path/2.2.0/json-path-2.2.0.jar
[ERROR] urls[86] = file:/Users/jeanvaljean/.m2/repository/net/minidev/json-smart/2.2.1/json-smart-2.2.1.jar
[ERROR] urls[87] = file:/Users/jeanvaljean/.m2/repository/net/minidev/accessors-smart/1.1/accessors-smart-1.1.jar
[ERROR] urls[88] = file:/Users/jeanvaljean/.m2/repository/org/springframework/boot/spring-boot-starter-log4j2/1.5.7.RELEASE/spring-boot-starter-log4j2-1.5.7.RELEASE.jar
[ERROR] urls[89] = file:/Users/jeanvaljean/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.7/log4j-slf4j-impl-2.7.jar
[ERROR] urls[90] = file:/Users/jeanvaljean/.m2/repository/org/apache/logging/log4j/log4j-api/2.7/log4j-api-2.7.jar
[ERROR] urls[91] = file:/Users/jeanvaljean/.m2/repository/org/apache/logging/log4j/log4j-core/2.7/log4j-core-2.7.jar
[ERROR] urls[92] = file:/Users/jeanvaljean/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.25/jcl-over-slf4j-1.7.25.jar
[ERROR] urls[93] = file:/Users/jeanvaljean/.m2/repository/org/slf4j/jul-to-slf4j/1.7.25/jul-to-slf4j-1.7.25.jar
[ERROR] urls[94] = file:/Users/jeanvaljean/.m2/repository/com/javax0/immutator/1.0.1/immutator-1.0.1.jar
[ERROR] urls[95] = file:/Users/jeanvaljean/.m2/repository/com/javax0/djcproxy/2.0.3/djcproxy-2.0.3.jar
[ERROR] urls[96] = file:/Users/jeanvaljean/.m2/repository/com/javax0/jscc/1.0.1/jscc-1.0.1.jar
[ERROR] urls[97] = file:/Users/jeanvaljean/.m2/repository/com/javax0/jscglib/1.0.1/jscglib-1.0.1.jar
[ERROR] urls[98] = file:/Users/jeanvaljean/.m2/repository/org/apache/httpcomponents/httpclient/4.5.3/httpclient-4.5.3.jar
[ERROR] urls[99] = file:/Users/jeanvaljean/.m2/repository/org/apache/httpcomponents/httpcore/4.4.6/httpcore-4.4.6.jar
[ERROR] urls[100] = file:/Users/jeanvaljean/.m2/repository/commons-codec/commons-codec/1.9/commons-codec-1.9.jar
[ERROR] urls[101] = file:/Users/jeanvaljean/.m2/repository/com/google/guava/guava/22.0/guava-22.0.jar
[ERROR] urls[102] = file:/Users/jeanvaljean/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar
[ERROR] urls[103] = file:/Users/jeanvaljean/.m2/repository/com/google/errorprone/error_prone_annotations/2.0.18/error_prone_annotations-2.0.18.jar
[ERROR] urls[104] = file:/Users/jeanvaljean/.m2/repository/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar
[ERROR] urls[105] = file:/Users/jeanvaljean/.m2/repository/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar
[ERROR] urls[106] = file:/Users/jeanvaljean/.m2/repository/org/jooq/jool/0.9.12/jool-0.9.12.jar
[ERROR] urls[107] = file:/Users/jeanvaljean/.m2/repository/org/jooq/joor/0.9.6/joor-0.9.6.jar
[ERROR] urls[108] = file:/Users/jeanvaljean/.m2/repository/com/github/ben-manes/caffeine/caffeine/2.3.5/caffeine-2.3.5.jar
[ERROR] urls[109] = file:/Users/jeanvaljean/.m2/repository/org/jooq/jooq-codegen/3.9.5/jooq-codegen-3.9.5.jar
[ERROR] urls[110] = file:/Users/jeanvaljean/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
[ERROR] urls[111] = file:/Users/jeanvaljean/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.jar
[ERROR] urls[112] = file:/Users/jeanvaljean/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.15/plexus-utils-1.5.15.jar
[ERROR] urls[113] = file:/Users/jeanvaljean/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: javax.xml.bind.JAXB

In the build section I have

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.0.2</version>
            </plugin>
        </plugins>
    </pluginManagement>

    <resources>
        <resource>
            <directory>src/main/resources</directory>
            <excludes>
                <exclude>**/database.properties</exclude>
            </excludes>
        </resource>
    </resources>

    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>properties-maven-plugin</artifactId>
            <version>1.0.0</version>
            <executions>
                <execution>
                    <phase>validate</phase>
                    <goals>
                        <goal>read-project-properties</goal>
                    </goals>
                    <configuration>
                        <files>
                            <file>src/main/resources/database.properties</file>
                        </files>
                    </configuration>
                </execution>
            </executions>
        </plugin>

        <plugin>
            <groupId>org.flywaydb</groupId>
            <artifactId>flyway-maven-plugin</artifactId>
            <version>${flyway.version}</version>

            <!-- Note that we're executing the Flyway plugin in the "generate-sources" phase -->
            <executions>
                <execution>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>migrate</goal>
                    </goals>
                </execution>
            </executions>

            <!-- Note that we need to prefix the db/migration path with filesystem: to prevent Flyway
                 from looking for our migration scripts only on the classpath -->
            <configuration>
                <driver>${db.driver}</driver>
                <url>${db.url}</url>
                <user>${db.username}</user>
                <password>${db.password}</password>
                <locations>
                    <location>filesystem:src/main/resources/db/migration</location>
                </locations>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.jooq</groupId>
            <artifactId>jooq-codegen-maven</artifactId>
            <version>${org.jooq.version}</version>

            <!-- The plugin should hook into the generate goal -->
            <executions>
                <execution>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
                <!--<execution>-->
                <!--<goals>-->
                <!--<goal>generate</goal>-->
                <!--</goals>-->
                <!--</execution>-->
            </executions>

            <dependencies>
                <dependency>
                    <groupId>org.postgresql</groupId>
                    <artifactId>postgresql</artifactId>
                    <version>${postgresql.version}</version>
                </dependency>
            </dependencies>

            <configuration>
                <jdbc>
                    <driver>${db.driver}</driver>
                    <url>${db.url}</url>
                    <user>${db.username}</user>
                    <password>${db.password}</password>
                </jdbc>

                <generator>
                    <name>org.jooq.util.JavaGenerator</name>
                    <strategy>
                        <name>com.myproject.dbms.jooq.conf.RemoveColumnPrefixDatabaseStrategy</name>
                    </strategy>

                    <database>
                        <name>org.jooq.util.postgres.PostgresDatabase</name>
                        <!--force generating id'sfor everything in public schema, that has an 'id' field-->
                        <includes>.*</includes>
                        <excludes></excludes>

                        <schemata>
                            <schema>
                                <inputSchema>commons</inputSchema>
                            </schema>
                        </schemata>

                        <unsignedTypes>false</unsignedTypes>

                        <customTypes>
                            <customType>
                                <name>Json</name>
                                <type>com.google.gson.JsonElement</type>
                                <binding>com.myproject.dbms.jooq.databinding.PostgresJSONGsonBinding</binding>
                            </customType>
                        </customTypes>
                        <forcedTypes>
                            <forcedType>
                                <name>Json</name>
                                <types>json</types>
                            </forcedType>
                            <forcedType>
                                <name>NUMERIC(8,2)</name>
                                <expression>shop.localized_money.lm_amount</expression>
                                <types>.*</types>
                            </forcedType>
                        </forcedTypes>

                      <generate>
                        <!--<javaTimeTypes/>-->
                        <deprecated>false</deprecated>
                        <relations>true</relations>
                        <generatedAnnotation>false</generatedAnnotation>
                        <instanceFields>true</instanceFields>
                        <records>true</records>
                        <interfaces>false</interfaces>
                        <pojos>true</pojos>
                        <immutablePojos>false</immutablePojos>
                        <daos>false</daos>
                        <jpaAnnotations>true</jpaAnnotations>
                        <springAnnotations>true</springAnnotations>
                        <validationAnnotations>true</validationAnnotations>
                        <globalObjectReferences>true</globalObjectReferences>
                        <fluentSetters>true</fluentSetters>
                        <pojosEqualsAndHashCode>true</pojosEqualsAndHashCode>
                        <globalUDTReferences>true</globalUDTReferences>
                    </generate>

                    <target>
                        <packageName>com.myproject.model.jooq</packageName>
                        <!--<directory>src/main/java</directory>-->
                    </target>
                </generator>
            </configuration>
        </plugin>
    </plugins>
</build>

Any idea? May it be an old transitive dependency in the jOOQ plugin? Maybe this page may help.

like image 874
JeanValjean Avatar asked Sep 21 '17 22:09

JeanValjean


2 Answers

Apparently the jooq-codegen-maven plugin uses the JAXB API, which is found in the Java EE module java.xml.bind. However, Java EE modules are not resolved by default (and also deprecated), which explains why the JVM complains that it can't find JAXBException.

To clarify: It's the JVM running the Maven process that is missing the dependency, not the compilation it launches!

The short term fix is to add the dependency manually with --add-modules to the JVM executing the plugin:

  • If the plugin allows forking (i.e. it can be executed in another JVM than the one running the Maven process), you might be able to add --add-modules java.xml.bind to it in your POM. A quick search suggest that that might not be possible.
  • Otherwise you need to configure the JVM running the Maven process, which you can do with the poorly documented .mvn/jvm.config file. Simply add such a file to the directory from which you launch the build (likely the one containing your POM) and put --add-modules java.xml.bind in there. (Unfortunate side effect: You can no longer build with Java 8.)

For a little more details on the second approach, check this newsletter that I wrote.

like image 127
Nicolai Parlog Avatar answered Nov 20 '22 06:11

Nicolai Parlog


Version 3.10.0 - September 29, 2017

Just to mark this up to the date, you can now use JOOQ library version 3.10.0.

..is the first release that is formally integration tested with Java 9 along with the existing integration tests for Java 6/7 and for Java 8. To use jOOQ with Java 9 use the Java 8 distribution which has not yet been modularised, but contains Automatic-Module-Name specification to be forward compatible with future, modularised jOOQ distributions.

<plugin>
    <groupId>org.jooq</groupId>
    <artifactId>jooq-codegen-maven</artifactId>
    <version>3.10.0</version>
    ...
</plugin>
like image 26
Naman Avatar answered Nov 20 '22 06:11

Naman