问题
I have a collection of applications written in Grails v1.0.5. The application does work flawlessly. But, I'm looking into the possibility of upgrading to the latest version(2.4.4). I know it is quite a huge leap starting from 1.0.5 but any pointers on where to start? Official site holds documentation only from 1.2.0(makes me feel like I'm in old age). Any help would be much appreciated.
回答1:
The safest way to upgrade an application from 1.x to 2.x would be to create an empty 2.x project, then slowly, by hand, move the following:
- Contents of application.properties into
BuildConfig.groovy
(e.g. install plugins). - Contents of
Config.groovy
andResources.groovy
(do this by hand not by copying the file) - Tests (copy files)
- Domain classes (copy files)
- Controllers (copy files)
- Services (copy files)
- Filters (copy files)
URLMappings.groovy
(by hand not by copying the file)
Depending on the size of the applications and complexity this could be very quick, or very painful. One thing to stress. Test, Test, Test.
来源:https://stackoverflow.com/questions/29163287/grails-upgrade-from-1-0-5-to-2-4-4