How to add or install plugins in grails-3.0.4 which i have used in grails-2.4.4 while upgrading application

谁都会走 提交于 2019-12-11 03:31:34

问题


1) How to add or install plugins in 3.0.4 like in 2.4.4 we can install by specifying in BuildConfig.groovy?

2) How to create new plugins and copy source code to new plugins from original plugins as documentation saying to do for up-gradation of plugins in grails-3.x?


回答1:


  1. You add your plugins into the dependencies block in your build.gradle. You find plugins here - as stated on the plugin page.
  2. Follow the instructions in the Upgrading from Grails 2.x - Reference Documentation



回答2:


In a nutshell, migrating involves:

  1. Creating a brand new Grails 3 app/plugin.
  2. Copying the source from the Grails 2 project over to the new project. By source I mean controllers, domains, services, and other Grails artefacts, NOT configuration such as Config.groovy, BuildConfig.groovy, etc.
  3. Reconfiguring the new project according to the changes made in Grails 3. This includes going from Config.groovy to application.yml, setting up the dependencies on Grails 3 versions of the plugins, relocating BootStrap.groovy, etc. As @cfrick mentioned, the Upgrading from Grails 2.x - Reference Documentation is your friend.
  4. Fix all the compile time and runtime errors. Most likely you will have a lot of them.

An indiscriminate copy like cp -rf OldProjectPath NewProjectPath will not work. I recommend checking for Grails 3 versions of your plugins to see how many have been ported. That will tell you if this is the right time to migrate.



来源:https://stackoverflow.com/questions/31806809/how-to-add-or-install-plugins-in-grails-3-0-4-which-i-have-used-in-grails-2-4-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!