1. Setup the environment for grail 2.5.x
2. Create a new project using 2.5.x with the same name as your old project.
3. You may refer this link http://grails.github.io/grails-doc/2.4.4/guide/upgradingFrom23.html
4. Once you have create the new project, hit the command “grails install-templates”
5. This is because there is a change in the web.xml ( sitemesh has been removed from the xml )
<bean id="grailsApplication" class="org.codehaus.groovy.grails.commons.GrailsApplicationFactoryBean">
<description>Grails application factory bean</description>
<property name="grailsDescriptor" value="/WEB-INF/grails.xml" />
<property name="grailsResourceLoader" ref="grailsResourceLoader" />
</bean>
The striked out line has been removed.
8. If you were using the Holder classes i. e
The following deprecated classes have been removed from Grails 2.4.x:
• org.codehaus.groovy.grails.commons.ApplicationHolder
• org.codehaus.groovy.grails.commons.ConfigurationHolder
• org.codehaus.groovy.grails.plugins.PluginManagerHolder
• org.codehaus.groovy.grails.web.context.ServletContextHolder
• org.codehaus.groovy.grails.compiler.support.GrailsResourceLoaderHolder
If you or any plugins you have installed are using these classes you will get a compilation error. The problem can be rectified by updating to new plugins and using grails.util.Holders instead.
11. You now have to generate a token if its not present initially generateToken(url);
12. In your gsp layout file use <r:layoutResources/>. This should come after the plugin are added.
Example:
<g:javascript library="jquery" plugin="jquery"/>
<r:layoutResources/>
13. Here is the plugins which I used in my BuildConfig.groovy
plugins {
build ":tomcat:7.0.55"
compile ':scaffolding:2.1.1'
compile ':cache:1.1.8'
runtime ':resources:1.2.8'
runtime ":hibernate:3.6.10.18"//":hibernate4:4.3.5.4" // or ":hibernate:3.6.10.16"
runtime ":jquery:1.11.1"
compile ":remote-pagination:0.4.8"
compile ":spring-security-core:1.2.7.4"
compile ":spring-security-ldap:1.0.6"
// Uncomment these (or add new ones) to enable additional resources capabilities
//runtime ":zipped-resources:1.0.1"
//runtime ":cached-resources:1.1"
//runtime ":yui-minify-resources:0.1.5"
}
2. Create a new project using 2.5.x with the same name as your old project.
3. You may refer this link http://grails.github.io/grails-doc/2.4.4/guide/upgradingFrom23.html
4. Once you have create the new project, hit the command “grails install-templates”
5. This is because there is a change in the web.xml ( sitemesh has been removed from the xml )
6.
Now if you have some changes in your xml which were made, then compare
your old with the new one and merge the changes ( src/templates/war )
7. Main thing is the applicationContext.xml compare and merge the changes. In this<bean id="grailsApplication" class="org.codehaus.groovy.grails.commons.GrailsApplicationFactoryBean">
<description>Grails application factory bean</description>
<property name="grailsDescriptor" value="/WEB-INF/grails.xml" />
</bean>
The striked out line has been removed.
8. If you were using the Holder classes i. e
The following deprecated classes have been removed from Grails 2.4.x:
• org.codehaus.groovy.grails.commons.ApplicationHolder
• org.codehaus.groovy.grails.commons.ConfigurationHolder
• org.codehaus.groovy.grails.plugins.PluginManagerHolder
• org.codehaus.groovy.grails.web.context.ServletContextHolder
• org.codehaus.groovy.grails.compiler.support.GrailsResourceLoaderHolder
If you or any plugins you have installed are using these classes you will get a compilation error. The problem can be rectified by updating to new plugins and using grails.util.Holders instead.
9. If you were using spring security for login, the SynchronizerToken class has been changed to SynchronizerTokensHolder.
10.
This is the link to code
https://github.com/gramant/grails-core-old/blob/master/grails-web/src/main/groovy/org/codehaus/groovy/grails/web/servlet/mvc/SynchronizerTokensHolder.groovy11. You now have to generate a token if its not present initially generateToken(url);
12. In your gsp layout file use <r:layoutResources/>. This should come after the plugin are added.
Example:
<g:javascript library="jquery" plugin="jquery"/>
<r:layoutResources/>
13. Here is the plugins which I used in my BuildConfig.groovy
plugins {
build ":tomcat:7.0.55"
compile ':scaffolding:2.1.1'
compile ':cache:1.1.8'
runtime ':resources:1.2.8'
runtime ":hibernate:3.6.10.18"//":hibernate4:4.3.5.4" // or ":hibernate:3.6.10.16"
runtime ":jquery:1.11.1"
compile ":remote-pagination:0.4.8"
compile ":spring-security-core:1.2.7.4"
compile ":spring-security-ldap:1.0.6"
// Uncomment these (or add new ones) to enable additional resources capabilities
//runtime ":zipped-resources:1.0.1"
//runtime ":cached-resources:1.1"
//runtime ":yui-minify-resources:0.1.5"
}