Gradle plugin depends on testClasses
See original GitHub issueCurrently the Gradle-plugin adds in Java-projects a dependency on testClasses:
flyway-gradle-plugin/src/main/groovy/org/flywaydb/gradle/task/AbstractFlywayTask.groovy:
AbstractFlywayTask() {
group = 'Flyway'
project.afterEvaluate {
if (isJavaProject()) {
this.dependsOn(project.tasks.testClasses)
}
}
extension = project.flyway
}
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:
> gradle compileJava
FAILURE: Build failed with an exception.
* What went wrong:
Circular dependency between the following tasks:
:classes
\--- :compileJava
\--- :generateJooq
\--- :flywayMigrate
\--- :testClasses
\--- :compileTestJava
\--- :classes (*)
BUILD FAILED
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
Issue Analytics
- State:
- Created 9 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
The Java Plugin - Gradle User Manual
Depends on: build , and buildNeeded tasks in all projects that are dependencies in the testRuntimeClasspath configuration. Performs a full build of the...
Read more >Multi-project test dependencies with gradle - Stack Overflow
Problem is that dependency testCompile project(':core').sourceSets.test.output actually means: "depend on classes generated by gradle build task".
Read more >Separate Gradle Tasks for Unit and Integration Tests - Inspeerity
Since now you can move all your integration tests to proper folder, and all of them will have all dependencies which are defined...
Read more >5. Add Gradle Plugin with Dependencies - Spring Cloud
To add a Gradle plugin with dependencies, you can use code similar to the following ... Specifies a rule that should be added...
Read more >Gradle: sub-project test dependencies in multi-project builds
I'am currently working on a project where we try to move an ant based build to gradle. One task is to make the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Actually, it appears to be more subtle. Perhaps
flywayClean
should have no dependencies at all, andflywayMigrate
should depend on[processResources, processTestResources]
?In my project I ended up with the following, because I do happen to have the migration scripts in
src/main/resources/db/migration
:Fixed as part of #979