环境背景:jdk13、apache-maven-3.6.2、IDEA2019.2.4、springboot-2.2.0.RELEASE、jooq3.12.2
一、Error running jOOQ code generation tool
1. 异常背景:通过jooq-codegen-maven插件生成代码时报错
2. 异常详情
Failed to execute goal org.jooq:jooq-codegen-maven:3.12.2:generate (default-cli) on project jooq: Error running jOOQ code generation tool
3. 异常原因:在pom.xml文件中,通过yaml-properties-maven-plugin插件读取application.yml配置文件中内容,直接操作jooq-codegen-maven插件无效
4. 解决方法:
4.1 方法1:通过maven,执行mvn compile命令
4.1.1 查看效果
E:\jdk\jdk-13.0.1\bin\java.exe -Dmaven.multiModuleProjectDirectory=F:\IdeaProjects\jooq -Dmaven.home=E:\maven\apache-maven-3.6.2 -Dclassworlds.conf=E:\maven\apache-maven-3.6.2\bin\m2.conf "-Dmaven.ext.class.path=E:\JetBrains\IntelliJ IDEA 2019.2.3\plugins\maven\lib\maven-event-listener.jar" -Dfile.encoding=UTF-8 -classpath E:\maven\apache-maven-3.6.2\boot\plexus-classworlds-2.6.0.jar org.codehaus.classworlds.Launcher -Didea.version2019.2.4 -s E:\maven\apache-maven-3.6.2\conf\settings.xml compile
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.zsx:jooq:jar:1.0-SNAPSHOT
[WARNING] 'dependencies.dependency.scope' for org.springframework.boot:spring-boot-devtools:jar must be one of [provided, compile, runtime, test, system] but is 'true'. @ line 105, column 20
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ----------------------------< com.zsx:jooq >----------------------------
[INFO] Building jooq 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- yaml-properties-maven-plugin:1.1.3:read-project-properties (default) @ jooq ---
[INFO]
[INFO] --- jooq-codegen-maven:3.12.2:generate (default) @ jooq ---
[INFO] No <inputCatalog/> was provided. Generating ALL available catalogs instead.
[INFO] License parameters
[INFO] ----------------------------------------------------------
[INFO] Thank you for using jOOQ and jOOQ's code generator
[INFO]
[INFO] Database parameters
[INFO] ----------------------------------------------------------
[INFO] dialect : POSTGRES
[INFO] URL : jdbc:postgresql://127.0.0.1:5432/mydb11
[INFO] target dir : F:\IdeaProjects\jooq\src\main\java
[INFO] target package : com.zsx.generator.jooq
[INFO] includes : [.*]
[INFO] excludes : []
[INFO] includeExcludeColumns : false
[INFO] ----------------------------------------------------------
[INFO]
[INFO] JavaGenerator parameters
[INFO] ----------------------------------------------------------
[INFO] annotations (generated): true
[INFO] annotations (JPA: any) : false
[INFO] annotations (JPA: version):
[INFO] annotations (validation): false
[INFO] comments : true
[INFO] comments on attributes : true
[INFO] comments on catalogs : true
[INFO] comments on columns : true
[INFO] comments on keys : true
[INFO] comments on links : true
[INFO] comments on packages : true
[INFO] comments on parameters : true
[INFO] comments on queues : true
[INFO] comments on routines : true
[INFO] comments on schemas : true
[INFO] comments on sequences : true
[INFO] comments on tables : true
[INFO] comments on udts : true
[INFO] daos : false
[INFO] deprecated code : true
[INFO] global references (any): true
[INFO] global references (catalogs): true
[INFO] global references (keys): true
[INFO] global references (links): true
[INFO] global references (queues): true
[INFO] global references (routines): true
[INFO] global references (schemas): true
[INFO] global references (sequences): true
[INFO] global references (tables): true
[INFO] global references (udts): true
[INFO] indexes : true
[INFO] instance fields : true
[INFO] interfaces : false
[INFO] interfaces (immutable) : false
[INFO] javadoc : true
[INFO] keys : true
[INFO] links : true
[INFO] pojos : false
[INFO] pojos (immutable) : false
[INFO] queues : true
[INFO] records : true
[INFO] routines : true
[INFO] sequences : true
[INFO] table-valued functions : true
[INFO] tables : true
[INFO] udts : true
[INFO] relations : true
[INFO] ----------------------------------------------------------
[INFO]
[INFO] Generation remarks
[INFO] ----------------------------------------------------------
[INFO]
[INFO] ----------------------------------------------------------
[INFO] Generating catalogs : Total: 1
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jooq.tools.reflect.Reflect (file:/E:/maven/repository/org/jooq/jooq/3.12.2/jooq-3.12.2.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class)
WARNING: Please consider reporting this to the maintainers of org.jooq.tools.reflect.Reflect
WARNING: Use --illegal-access=