Skip to content
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

dbm-gorm-diff fails on multiproject build #282

Open
snimavat opened this issue Mar 13, 2022 · 1 comment
Open

dbm-gorm-diff fails on multiproject build #282

snimavat opened this issue Mar 13, 2022 · 1 comment

Comments

@snimavat
Copy link
Contributor

snimavat commented Mar 13, 2022

In a multiproject build - dbm-gorm-diff - fails

grails {
    plugins {
        implementation project(':my-plugin')
    }
}

When dbm-gorm-diff is run in application
Grails tries to run dbm-gorm in plugin also, and fails

> Task :my-plugin:dbmGormDiff FAILED

Will fail to generate diff

@davebrown1975
Copy link

You can configure the dbm* tasks in build.gradle to skip execution in your other modules:

// To prevent database migration tasks running against each plugin and run against the main app only
gradle.taskGraph.whenReady {graph ->
    graph.getAllTasks().each {Task task ->
        // Database migration plugin ignore these tasks, else it will fail
        def isPluginDbm = (task.path =~ /:+.+:+dbm/)        
        if (isPluginDbm) {
            task.enabled = false
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants