Can I configure Grails with no datasource?

后端 未结 4 1406
猫巷女王i
猫巷女王i 2020-12-05 14:18

I have a Grails app that loads its data from xml files and delivers rss feeds via rome. I don\'t have any domain classes and my app has no datasource. I don\'t want Grails t

4条回答
  •  一向
    一向 (楼主)
    2020-12-05 14:32

    The following steps work for a new app (Grails 1.1.1) to run without using a datasource:

    grails create-app nodb
    cd nodb
    grails uninstall-plugin hibernate
    rm grails-app/conf/DataSource.groovy
    grails create-controller Foo
    
    grails run-app
    http://localhost:8080/nodb/foo - prints hi bar
    

    For an existing app on at least version 1.1 (think that's when hibernate was made a plugin) you should be able to just uninstall-plugin and delete the DataSource.groovy file.

提交回复
热议问题