当前位置:   article > 正文

用gradle + ant + mybatisGenerate +postgresql自动生成与到的问题_at org.mybatis.generator.ant.generatoranttask.exec

at org.mybatis.generator.ant.generatoranttask.execute(generatoranttask.java:
  1. Working Directory: E:\ResourceForBeijingr\ProjectTechTest
  2. Gradle User Home: E:\java_environment\gradle\repository
  3. Gradle Distribution: Local installation at E:\java_environment\gradle\gradle-3.4.1
  4. Gradle Version: 3.4.1
  5. Java Home: C:\Program Files\Java\jdk1.8.0_102
  6. JVM Arguments: None
  7. Program Arguments: None
  8. Build Scans Enabled: true
  9. Offline Mode Enabled: false
  10. Gradle Tasks: mybatisGenerate
  11. :mybatisGenerate
  12. [ant:mbgenerator] java.lang.RuntimeException: Exception getting JDBC Driver
  13. [ant:mbgenerator] at org.mybatis.generator.internal.db.ConnectionFactory.getDriver(ConnectionFactory.java:85)
  14. [ant:mbgenerator] at org.mybatis.generator.internal.db.ConnectionFactory.getConnection(ConnectionFactory.java:54)
  15. [ant:mbgenerator] at org.mybatis.generator.config.Context.getConnection(Context.java:526)
  16. [ant:mbgenerator] at org.mybatis.generator.config.Context.introspectTables(Context.java:436)
  17. [ant:mbgenerator] at org.mybatis.generator.api.MyBatisGenerator.generate(MyBatisGenerator.java:222)
  18. [ant:mbgenerator] at org.mybatis.generator.ant.GeneratorAntTask.execute(GeneratorAntTask.java:149)
  19. [ant:mbgenerator] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
  20. [ant:mbgenerator] at sun.reflect.GeneratedMethodAccessor455.invoke(Unknown Source)
  21. [ant:mbgenerator] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  22. [ant:mbgenerator] at java.lang.reflect.Method.invoke(Method.java:498)
  23. [ant:mbgenerator] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
  24. [ant:mbgenerator] at groovy.util.AntBuilder.performTask(AntBuilder.java:327)
  25. [ant:mbgenerator] at groovy.util.AntBuilder.nodeCompleted(AntBuilder.java:272)
  26. [ant:mbgenerator] at org.gradle.api.internal.project.ant.BasicAntBuilder.nodeCompleted(BasicAntBuilder.java:78)
  27. [ant:mbgenerator] at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:154)
  28. [ant:mbgenerator] at groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:207)
  29. [ant:mbgenerator] at org.gradle.api.internal.project.ant.BasicAntBuilder.doInvokeMethod(BasicAntBuilder.java:103)
  30. [ant:mbgenerator] at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:67)
  31. [ant:mbgenerator] at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
  32. [ant:mbgenerator] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
  33. [ant:mbgenerator] at build_1v43w45px9fvranqj367p24qs$_run_closure5$_closure13.doCall(E:\ResourceForBeijingr\ProjectTechTest\build.gradle:149)
  34. [ant:mbgenerator] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  35. [ant:mbgenerator] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  36. [ant:mbgenerator] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  37. [ant:mbgenerator] at java.lang.reflect.Method.invoke(Method.java:498)
  38. [ant:mbgenerator] at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
  39. [ant:mbgenerator] at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
  40. [ant:mbgenerator] at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
  41. [ant:mbgenerator] at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
  42. [ant:mbgenerator] at groovy.lang.Closure.call(Closure.java:414)
  43. [ant:mbgenerator] at groovy.lang.Closure.call(Closure.java:430)
  44. [ant:mbgenerator] at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:596)
  45. [ant:mbgenerator] at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:577)
  46. [ant:mbgenerator] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:95)
  47. [ant:mbgenerator] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:76)
  48. [ant:mbgenerator] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:55)
  49. [ant:mbgenerator] at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
  50. [ant:mbgenerator] at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
  51. [ant:mbgenerator] at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
  52. [ant:mbgenerator] at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:46)
  53. [ant:mbgenerator] at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
  54. [ant:mbgenerator] at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
  55. [ant:mbgenerator] at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
  56. [ant:mbgenerator] at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
  57. [ant:mbgenerator] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:236)
  58. [ant:mbgenerator] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:228)
  59. [ant:mbgenerator] at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
  60. [ant:mbgenerator] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
  61. [ant:mbgenerator] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61)
  62. [ant:mbgenerator] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:228)
  63. [ant:mbgenerator] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215)
  64. [ant:mbgenerator] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:77)
  65. [ant:mbgenerator] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:58)
  66. [ant:mbgenerator] at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:32)
  67. [ant:mbgenerator] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:113)
  68. [ant:mbgenerator] at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
  69. [ant:mbgenerator] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
  70. [ant:mbgenerator] at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
  71. [ant:mbgenerator] at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
  72. [ant:mbgenerator] at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
  73. [ant:mbgenerator] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
  74. [ant:mbgenerator] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
  75. [ant:mbgenerator] at org.gradle.initialization.DefaultGradleLauncher$RunTasksAction.execute(DefaultGradleLauncher.java:256)
  76. [ant:mbgenerator] at org.gradle.initialization.DefaultGradleLauncher$RunTasksAction.execute(DefaultGradleLauncher.java:253)
  77. [ant:mbgenerator] at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
  78. [ant:mbgenerator] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
  79. [ant:mbgenerator] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56)
  80. [ant:mbgenerator] at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:175)
  81. [ant:mbgenerator] at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:119)
  82. [ant:mbgenerator] at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:102)
  83. [ant:mbgenerator] at org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:71)
  84. [ant:mbgenerator] at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:50)
  85. [ant:mbgenerator] at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
  86. [ant:mbgenerator] at org.gradle.tooling.internal.provider.runner.RunAsBuildOperationBuildActionRunner$1.execute(RunAsBuildOperationBuildActionRunner.java:43)
  87. [ant:mbgenerator] at org.gradle.tooling.internal.provider.runner.RunAsBuildOperationBuildActionRunner$1.execute(RunAsBuildOperationBuildActionRunner.java:40)
  88. [ant:mbgenerator] at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
  89. [ant:mbgenerator] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
  90. [ant:mbgenerator] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56)
  91. [ant:mbgenerator] at org.gradle.tooling.internal.provider.runner.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40)
  92. [ant:mbgenerator] at org.gradle.tooling.internal.provider.runner.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:75)
  93. [ant:mbgenerator] at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
  94. [ant:mbgenerator] at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41)
  95. [ant:mbgenerator] at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
  96. [ant:mbgenerator] at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)
  97. [ant:mbgenerator] at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49)
  98. [ant:mbgenerator] at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:49)
  99. [ant:mbgenerator] at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:31)
  100. [ant:mbgenerator] at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
  101. [ant:mbgenerator] at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
  102. [ant:mbgenerator] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
  103. [ant:mbgenerator] at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:47)
  104. [ant:mbgenerator] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
  105. [ant:mbgenerator] at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
  106. [ant:mbgenerator] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
  107. [ant:mbgenerator] at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
  108. [ant:mbgenerator] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
  109. [ant:mbgenerator] at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
  110. [ant:mbgenerator] at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
  111. [ant:mbgenerator] at org.gradle.util.Swapper.swap(Swapper.java:38)
  112. [ant:mbgenerator] at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
  113. [ant:mbgenerator] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
  114. [ant:mbgenerator] at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
  115. [ant:mbgenerator] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
  116. [ant:mbgenerator] at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
  117. [ant:mbgenerator] at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
  118. [ant:mbgenerator] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
  119. [ant:mbgenerator] at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
  120. [ant:mbgenerator] at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
  121. [ant:mbgenerator] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
  122. [ant:mbgenerator] at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
  123. [ant:mbgenerator] at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
  124. [ant:mbgenerator] at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
  125. [ant:mbgenerator] at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
  126. [ant:mbgenerator] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  127. [ant:mbgenerator] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  128. [ant:mbgenerator] at java.lang.Thread.run(Thread.java:745)
  129. [ant:mbgenerator] Caused by: java.lang.ClassNotFoundException: org.postgresql.Driver
  130. [ant:mbgenerator] at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1388)
  131. [ant:mbgenerator] at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1337)
  132. [ant:mbgenerator] at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1089)
  133. [ant:mbgenerator] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  134. [ant:mbgenerator] at java.lang.Class.forName0(Native Method)
  135. [ant:mbgenerator] at java.lang.Class.forName(Class.java:348)
  136. [ant:mbgenerator] at org.mybatis.generator.internal.ObjectFactory.internalClassForName(ObjectFactory.java:150)
  137. [ant:mbgenerator] at org.mybatis.generator.internal.ObjectFactory.externalClassForName(ObjectFactory.java:121)
  138. [ant:mbgenerator] at org.mybatis.generator.internal.db.ConnectionFactory.getDriver(ConnectionFactory.java:82)
  139. [ant:mbgenerator] ... 115 more
  140. :mybatisGenerate FAILED
  141. FAILURE: Build failed with an exception.
  142. * Where:
  143. Build file 'E:\ResourceForBeijingr\ProjectTechTest\build.gradle' line: 149
  144. * What went wrong:
  145. Execution failed for task ':mybatisGenerate'.
  146. > Exception getting JDBC Driver
  147. * Try:
  148. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
  149. BUILD FAILED
  150. Total time: 0.253 secs

错误原因:

原来是我copy数据库驱动org.postgresql.Driver的时候,后面多跟了一个空格,ant执行generator-core代码时多了个空格才导致驱动找不到。


声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/307483
推荐阅读
相关标签
  

闽ICP备14008679号