jklingsporn / vertx-jooq

A jOOQ-CodeGenerator to create vertx-ified DAOs and POJOs.
MIT License
385 stars 53 forks source link

Code generation fails after upgrade from 5.1.1 to 5.1.2 (vertx-jooq-classic-reactive) #159

Closed Dudeplayz closed 4 years ago

Dudeplayz commented 4 years ago

After I upgraded from 5.1.1 to 5.1.2 the code generation fails. If I change it back, everything works again. The StackTrace is appended at the end.

Versions:

vertx-jooq-classic-reactive : 5.1.2
jooq : 3.13.2
vertx : 3.9.1
postgres : 42.2.14
StackTrace ``` Failed to execute goal org.jooq:jooq-codegen-maven:3.13.2:generate (default) on project bita-backend: Error running jOOQ code generation tool: Error generating code for catalog: Error generating code for schema bita: character to be escaped is missing -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jooq:jooq-codegen-maven:3.13.2:generate (default) on project bita-backend: Error running jOOQ code generation tool at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:566) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) at org.codehaus.classworlds.Launcher.main (Launcher.java:47) Caused by: org.apache.maven.plugin.MojoExecutionException: Error running jOOQ code generation tool at org.jooq.codegen.maven.Plugin.execute (Plugin.java:210) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:566) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) at org.codehaus.classworlds.Launcher.main (Launcher.java:47) Caused by: org.jooq.codegen.GeneratorException: Error generating code for catalog at org.jooq.codegen.JavaGenerator.generate (JavaGenerator.java:399) at org.jooq.codegen.GenerationTool.run0 (GenerationTool.java:845) at org.jooq.codegen.GenerationTool.run (GenerationTool.java:222) at org.jooq.codegen.GenerationTool.generate (GenerationTool.java:217) at org.jooq.codegen.maven.Plugin.execute (Plugin.java:207) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:566) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) at org.codehaus.classworlds.Launcher.main (Launcher.java:47) Caused by: org.jooq.codegen.GeneratorException: Error generating code for schema bita at org.jooq.codegen.JavaGenerator.generate (JavaGenerator.java:478) at org.jooq.codegen.JavaGenerator.generate (JavaGenerator.java:394) at org.jooq.codegen.GenerationTool.run0 (GenerationTool.java:845) at org.jooq.codegen.GenerationTool.run (GenerationTool.java:222) at org.jooq.codegen.GenerationTool.generate (GenerationTool.java:217) at org.jooq.codegen.maven.Plugin.execute (Plugin.java:207) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:566) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) at org.codehaus.classworlds.Launcher.main (Launcher.java:47) Caused by: java.lang.IllegalArgumentException: character to be escaped is missing at java.util.regex.Matcher.appendExpandedReplacement (Matcher.java:1020) at java.util.regex.Matcher.appendReplacement (Matcher.java:998) at java.util.regex.Matcher.replaceAll (Matcher.java:1182) at java.lang.String.replaceAll (String.java:2126) at io.github.jklingsporn.vertx.jooq.generate.builder.ComponentBasedVertxGenerator.generateTargetFile (ComponentBasedVertxGenerator.java:232) at io.github.jklingsporn.vertx.jooq.generate.builder.VertxGeneratorBuilder$ExecutionStepImpl.lambda$withPostgresReactiveDriver$22 (VertxGeneratorBuilder.java:291) at io.github.jklingsporn.vertx.jooq.generate.builder.DelegatingVertxGenerator.lambda$writeExtraData$0 (DelegatingVertxGenerator.java:99) at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:195) at java.util.ArrayList$ArrayListSpliterator.forEachRemaining (ArrayList.java:1654) at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:484) at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential (ReduceOps.java:913) at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.collect (ReferencePipeline.java:578) at io.github.jklingsporn.vertx.jooq.generate.builder.DelegatingVertxGenerator.writeExtraData (DelegatingVertxGenerator.java:99) at io.github.jklingsporn.vertx.jooq.generate.VertxGenerator.writeExtraData (VertxGenerator.java:242) at io.github.jklingsporn.vertx.jooq.generate.VertxGenerator.generateDaos (VertxGenerator.java:238) at org.jooq.codegen.JavaGenerator.generate (JavaGenerator.java:531) at org.jooq.codegen.JavaGenerator.generate (JavaGenerator.java:473) at org.jooq.codegen.JavaGenerator.generate (JavaGenerator.java:394) at org.jooq.codegen.GenerationTool.run0 (GenerationTool.java:845) at org.jooq.codegen.GenerationTool.run (GenerationTool.java:222) at org.jooq.codegen.GenerationTool.generate (GenerationTool.java:217) at org.jooq.codegen.maven.Plugin.execute (Plugin.java:207) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:566) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) at org.codehaus.classworlds.Launcher.main (Launcher.java:47) ```
jklingsporn commented 4 years ago

This is a regression from https://github.com/jklingsporn/vertx-jooq/issues/151. Can you share some further information about your configuration? Especially how your package name for the generated classes should look like.

Dudeplayz commented 4 years ago

Hey, sorry for the late reply, and thanks for the fast response. I think you mean the maven configuration:

Used maven config (groupId blackened) ```xml 4.0.0 bita-backend ${backend.version} jar Bita-Backend ... bita-parent 0.0.1-SNAPSHOT 42.2.14 3.13.2 5.1.1 ... bita-core ${core.version} io.vertx vertx-pg-client org.jooq jooq ${jooq.version} io.github.jklingsporn vertx-jooq-classic-reactive ${vertx-jooq.version} org.codehaus.mojo build-helper-maven-plugin 3.1.0 generate-sources add-source src/jooq/java jooq-generate org.postgresql.Driver src/jooq/java ...backend.db org.codehaus.mojo properties-maven-plugin 1.0.0 initialize read-project-properties pom.properties org.jooq jooq-codegen-maven ${jooq.version} generate org.postgresql postgresql ${postgres.version} io.github.jklingsporn vertx-jooq-generate ${vertx-jooq.version} ${jooq.driver} ${postgres.url} ${postgres.user} ${postgres.password} io.github.jklingsporn.vertx.jooq.generate.classic.ClassicReactiveVertxGenerator org.jooq.meta.postgres.PostgresDatabase .* bita bita security security false ${jooq-generated.package} ${jooq-generated.dir} true true true io.github.jklingsporn.vertx.jooq.generate.VertxGeneratorStrategy ```
jklingsporn commented 4 years ago

To me <jooq-generated.package>...backend.db</jooq-generated.package> looks weird.

Dudeplayz commented 4 years ago

I blackened the groupId, its something like <jooq-generated.package>a.b.c.backend.db</jooq-generated.package>.

ernieKovak commented 4 years ago

We see the same thing. Here's how we set the pkg name: `

com.company.project.domain2.jooq ${basedir}/src/main/java

`

yuxinqi-chan commented 4 years ago

https://github.com/jklingsporn/vertx-jooq/blob/6364c2304aeb0b365e054aacb21e7bb895df4905/vertx-jooq-generate/src/main/java/io/github/jklingsporn/vertx/jooq/generate/builder/ComponentBasedVertxGenerator.java#L237 In my case,it works after i changed File.separator toMatcher.quoteReplacement(File.separator)

Dudeplayz commented 4 years ago

@yufield how have you fixed this? I need to use 5.2.0, but can't because the RowMapper generation fails...

jklingsporn commented 4 years ago

Should be fixed in 5.2.1. However I cannot test this as it appears to be a windows problem. Can anyone confirm it is fixed?

Dudeplayz commented 4 years ago

I have done a short check and it seems to work. Thank you 👍.