Hi - has anyone come across an issue with Grails 5...
# questions
d
Hi - has anyone come across an issue with Grails 5 failing to run commands? I'm attempting to introduce db migrations to an existing app but whichever task I run, dbm-status, create change log etc. etc. I hit the same issue.. Error: Could not find or load main class grails.ui.command.GrailsApplicationContextCommandRunner Caused by: java.lang.ClassNotFoundException: grails.ui.command.GrailsApplicationContextCommandRunner I've seen hints that it could be to do with dev tools or the pathingJar, but even after disabling both I still the same issue.
m
Do you have the `grails-console`dependency added?
Copy code
console 'org.grails:grails-console'
d
Yes I do, one of my all time favourite tools πŸ˜‰
m
Ok πŸ‘. That is strange,
grails.ui.command.GrailsApplicationContextCommandRunner
is from
grails-console
. If I remove it from a Grails 5 app I get the same error messages as you reported when running dbm-* tasks. I would create a fresh app and confirm it works and then compare with your existing app.
m
Do you add the database-migration plugin to the build classpath? and also add grails-console as console dependency?
Maybe it’s a bug, can you create a minimal example to reproduce the error?
d
@Michael Yan yes to the classpath, and the console was defined as runtimeOnly 'org.grails.pluginsgrails console2.1.1' About to try it without the console plugin
m
No, use the org.grails:grails-console
console org.grails:grails-console
d
Is that the web based console? I'm not sure it is
This is the web based console I'm using: https://github.com/sheehan/grails-console
m
I have created a Admin Console, I am planning to create a new Web Console, because I have refactored the grails-console, with many improvements and features
Also there will be a Database Console, like H2 console but supports more Database types
πŸ‘πŸ» 1
Show Grails commands as Gradle tasks