Closed virtualdogbert closed 4 years ago
Here is the link to the example app: Example App
to reproduce the issue just load it into Intellij, and click the Gradle refresh button.
So trying to get this running on staging and I realized why I need the system properties available for dbmUpdate, it has to do with how we deal with the external config. We are using the external config plugin and we set one of the candidates to a system property.
Hey @virtualdogbert I found a work around (not sure if it's the best solution) but I just removed the by-task configuration in the build.gradle and changed to:
/*
// getting rid of the by-task pass system properties configuration
[bootRun, test, integrationTest, dbmUpdate, runScript, console].each { runTask ->
...
}
*/
// The run task added by the application plugin
// is also of type JavaExec.
tasks.withType(JavaExec) {
// Assign all Java system properties from
// the command line to the JavaExec task.
systemProperties System.properties
}
Now dbmUpdate task (and the other ones) receives the system properties
I didn't realize we worked around it that way. I think we found that we didn't actually need the properties as they were only used for really old migrations, which we had culled from the list anyway.
In either case thanks for posting, just in case anyone else runs into this issue this would be a valid workaround.
Task List
Steps to Reproduce
This adds access to the system properties to each of those tasks.
Expected Behaviour
There should be no errors when refreshing gradle, and I should be able to run dbmUpdate, with it having access to the system properties(used in bootStrap for licencing check).
Actual Behaviour
I get the following error
I can run fine if I remove dbmUpdate, but then that task won't get the system properties needed to run.
I think this is probably related to Gradle 5, which comes with Grails 4.
Environment Information
Example Application
I'll try to get a sample app later today and add the link in the comments.