A lot of problems stem from discrepancies between three places where Grails version and install infos are kept:
- the grails install manager that maintains workspace configuration of installed Grailses and designates one
install as the default install
- project that use project specific Grails settings stored in Eclipse settings files.
- application.properties which stores a Grails version number to be used by Grails itself.
GrailsProjectVersionFixer is attempting to detect such problems when users are importing projects, or changing workspace configuration, or changing project specific settings.
The number of branches and cases it is handling is growing out of hand and we are probably still missing some.
It seems we could greatly simplify the situation by relying only on the application.properties file to determine which Grails version to use and then ask the install manager for a matching grails install. (We may need some 'fixer logic' if a matching install isn't found, but the number of problem cases is much more limited and straightforward)
The default install would only be used when creating new applications. Imported applications would always rely on the version configured in application.properties.
When user's change the grails install in the project's properties page we would run 'grails upgrade' with the requested Grails version in order to change application.properties.
When user's change the Global default, we could still offer to upgrade/downgrade all the projects using that version.