New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gradle plugin depends on testClasses #775
Comments
The reason for this chicken and egg situation is the support for Java migrations. You can work around this, by moving the DB migration to a separate module. Your main module then depends on this one and can then generate your classes based on a fully migrated schema. |
Thanks for your answer. I assume that by "module" you mean "project". Please correct me if I am mistaken. I had tried what you suggested but had one problem: one of my requirements is that the code-generation only be executed when the Flyway-plugin actually performs some migration. I had implemented that feature thus in build.gradle:
This does not work as given when the Flyway-migrations are in a separate project. It is not clear to me how to do this in that case. My knowledge of Gradle does not cover this case. I would appreciate any tips you might have to fix this. Thank you. |
Deferring this change until 4.0 as it breaks existing configurations |
For a workaround you can put this in your buildfile:
@axelfontaine For now how about a property like |
Actually, it appears to be more subtle. Perhaps In my project I ended up with the following, because I do happen to have the migration scripts in
|
Your workaround worked like a charm. Thanks @konrad-garus ! |
Fixed as part of #979 |
Currently the Gradle-plugin adds in Java-projects a dependency on testClasses:
In my application, I migrate the schema with Flyway and then, based on the up-to-date schema, generate Java-code which is then compiled. This however results in a circular dependency:
I have tried everything of which I can think to fix this, from manually removing the dependency to putting the Flyway-migrations into a subproject. I have come to the conclusion that the only feasible solution is to alter the plugin itself to remove the added dependency. Could you please therefore do so? Thank you.
Best regards
The text was updated successfully, but these errors were encountered: