Grails 3 - where's the DataSource.groovy and about plugins

怎甘沉沦 提交于 2019-12-11 01:17:30

问题


So I downloaded Grails 3 M1 and created a project. There's no DataSource.groovy, even after the MySQL driver was added to the dependencies - I thought maybe it will see the driver and know a DataSource.groovy is needed.

Secondly, plugins. I found the Grails 3 plugin page (https://github.com/grails3-plugins) How does one go about installing these? Is there a new repository? E.g. the newest Scaffolding plugin on Maven is from March 2014. Will the older plugins still work?

Thanks.


回答1:


Starting with Grails 3 the configuration is now done with either a application.yml or application.groovy depending on what you prefer.

The configuration is no longer split up in multiple files like it has been done previously.

For more information: http://grails.github.io/grails-doc/3.0.x/guide/conf.html#environments

And for your second question. Most of the plugins should still work with the new Grails version. Updated versions will probably be available on the official plugins page soon.




回答2:


It is quite useful this official GRAILS 3.x documentation about config files no more present in release 3 and new files needed.

EDIT: I try to extend the answer as suggested:

"Some files that were previously created by Grails 2.x are no longer created. These have either been removed or an appropriate replacement added. The following table lists files no longer in use: (see table below)"




回答3:


Grails documentation for 3 still points to Grails 2.x

The DataSource.groovy no longer exists. I use application.yml for my datasource mods

For example:

environments:
    development:
          grails:
             mongo:
              host:localhost
              port:27017
              databaseName:zoom 


来源:https://stackoverflow.com/questions/28405392/grails-3-wheres-the-datasource-groovy-and-about-plugins

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