Liquibase changeset base path in debug issue
Answered
When I'm trying the run test in debug from IDEA it applies "out/production/resources/database/changesets/10.23.0/2changeset.xml" but for 'Run' and Gradle path looks like '/database/changesets/10.23.0/2changeset.xml' as result liquibase start reapply all migrations again and fail. Any workaround for this issue. Eclipse doesn't have such issue. Probably IDEA specific?
Please sign in to leave a comment.
I'm not sure I really understand the problem. Can you describe the steps that lead to an issue for you and the expected and the actual result you are getting?
What Run/Debug Configurations do you launch?
I believe the problem related to this
https://youtrack.jetbrains.com/issue/IDEA-175172
JIDEA has its own build dir doesn't respect gradle. As result, if you do
Liquibase scan subdirs changeset files in a new location and generated new 'path' to it. Which recognized as completely new changesets.
But it somehow applies only for 'Debug' the same configuration for 'Run' works just fine! So I can easily run a test with 'Run' but with 'Debug' migrations always will fail. IDEA just add this
Indeed if IDE's own builder is used IDE compiles modules sources and places them and resources into "out" directory. When Gradle's build and runner is used (Settings (Preferences) | Build, Execution, Deployment | Build Tools | Gradle | Runner | Delegate IDE build/run actions to gradle option is enabled) IDE places files into Gradle's "build" directory.
I'm not familiar with the Liquibase specifics and what exactly happens when you say
>Liquibase scan subdirs changeset files in a new location and generated new 'path' to it. Which recognized as completely new changesets.
But run/and debug actions use the same results of the build.
What results do you get when run it by Gradle from command line? Does it make a difference to enable Delegate IDE build/run actions to gradle option?
If issue remains, to understand what happens would help a sample roject and the steps to reproduce.
Yes if run Gradle from CLI then everything is fine. So I think I've found the source of an issue by defaults IDEA seems somehow 'Use module compile output path' instead of 'Inherit project compile output path', so if I'll choose last one the 'Debug' also works fine. Weird is that this applied only for 'Debug', And yes we don't use
Delegate IDE build/run actions to gradle for performance reasons.