domaframework / doma-codegen-plugin

Generates Java, Kotlin, and SQL files from Database

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can not run `./gradlew domaCodeGenDevEntity` in terminal

hmarf opened this issue · comments

commented

I want to automatically generate an Entity. I tried ./gradlew domaCodeGenDevEntity on the terminal. I got the following error.
Do you know the solution?

$ ./gradlew domaCodeGenDevEntity 

> Task :repository:domaCodeGenDevDbMeta FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task 'domaCodeGenDevDbMeta'.
> [DOMAGEN9001] The exception was thrown. com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
  
  The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

(Supplement)
I was able to run it with a click on IntelliJ. But I can't do it on the command line.

It seems that your JDBC URL is wrong.
Try to run the following command and let me know the printed stacktrace:

$ ./gradlew domaCodeGenDevEntity --stacktrace
commented

Looking at the log, I found that the URL was wrong.
I solved this problem.
Thank you.