Grails without gorm - grails

I'm trying to create a grails app that has no database/hibernate/gorm/datasource configuration. In Rails, I can create a new app with the '--skip-active-record' command which will let me create controllers/models/etc without any database concerns.
I'm needing this because my controller just makes a couple rest calls and returns a result so there's no need for the database.
Is this possible? I saw Can I configure Grails with no datasource? but it seems to not work with Grails 2.3. I get this message: "To remove a plugin, delete it from BuildConfig.groovy and/or application.properties."
Is this possible? Thanks

The uninstall-plugin and install-plugin commands were deprecated in 2.2 and removed in 2.3.
To remove a plugin, delete it from BuildConfig.groovy and/or application.properties.
So you can just remove the hibernate plugin entry from BuildConfig.groovy. You probably also need to remove the cache plugin, and you should remove the database-migration plugin since you won't need it.

Related

Does Spock plugin support in grails 3.0.5

I am new to use this spock plugin.So want to know about spock which version is supported by Grails 3.0.5. Actually using groovy 2.4.4 version.
Please help me out.
Why you want to know spock version? It is bundled in the grails so no need to configure it. Just create new test using some of grails commands like grails create-unit-test or create domain or controller and test for it will be created.
Basic dependencies for spock tests are added when creating new application/plugin (testCompile "org.grails:grails-plugin-testing"). In your case grails will use this spock: org.spockframework:spock-core:1.0-groovy-2.4 but again you don't need to worry about.

Grails 3.1.0.M2 Database Reverse Engineering

Need of help.
I am new to Grails,
My question is How to do db-reverse-engineer.?
I did it in Grails 2.5.1 but I am struggling with Grails 3.1.0.M2 version.
Thanks in advance.
There's no plugin for Grails 3. I started to convert the older one but it's more work than I was expecting because it has to work with Hibernate 4, and the old plugin only works with Hibernate 3.
But the generated files wouldn't be any different in Grails 3 than in Grails 2 since GORM has stayed rather consistent. Since the plugin is only used at build time, and often only once or at most a few times, I recommend that you configure a Grails 2 app with the same database config settings and using the plugin there, then moving the generated files to your Grails 3 app.

Grails 3 does not have wrapper?

Does Grails 3.0.x no longer have the ability to create wrappers anymore?
The documentation doesn't seem to have the Grails wrapper section anymore.
Is there an alternative way which we can use the gradle wrapper to execute grails commands such as create-controller?
Does Grails 3.0.x no longer have the ability to create wrappers
anymore?
No.
Is there an alternative way which we can use the gradle wrapper to
execute grails commands such as create-controller?
Not for commands like create-controller, no.
We may re-introduce grailsw. File a feature request at https://github.com/grails/grails-core/issues if you would like to track that.
The Grails wrapper is back as of Grails 3.2.3:
http://docs.grails.org/3.2.x/guide/introduction.html#whatsNewGrailsWrapper
I have an app created with Grails 3.1.x, then upgraded to Grails 3.2.6, but the files such as 'grailsw' did not appear in my project root, and I'm not sure how to get them added via some command in the project.
When I create a new app using Grails 3.2.6, the new files are in the project root (grailsw, grailsw.bat, grails-wrapper.jar). I assume they can be copied over to an app like mine: a quick test of this worked for me.

Grails: Unable to generate views

This is a very basic thing and I have no idea why am not able to do this. I am using Grails 2.3.5
I have a domain class com.trail.AuditTrail and I want it scaffolded views. So, here are the steps I followed:
ran grails create-controller com.trail.AuditTrail, this returned a message saying it generated:
grails-app/controller/trail/AuditTrailController
grails-app/views/auditTrail (just the folder!)
It also created AuditTrailControllerSpec.groovy.
Then I added the line static scaffold = true in the Controller.
Then ran generate-views to create the views, but nothing got created !
IMPORTANT: In fact grails says that there is no command called as generate-views. When I did grails help it didn't list generate-views. So, I thought may be 2.3.5 doesn't have the command and tried generate-all. This too failed. To my surprise, grails help didn't show up generate-all too !
Then I found this bug: https://jira.grails.org/browse/GRAILS-10530. So, I tried clean, refresh-dependencies, compile and then generate-all. But still the same problem.
I thought my local grails setup is messed up. So, asked my colleague. He too sees the same problems.
My problem is I am not able to create the default template GSPs out of the domain.
Scaffolding functionality was extracted from Grails core in 2.3, so you need to install scaffolding plugin for Grails 2.3.5 to be able to use generate-all, generate-views GANT scripts.
P.S. I suggest you to switch to Grails 2.3.6 or 2.3.7. For more details take a look at this article http://www.gopivotal.com/security/cve-2014-0053
for that right click on action then click on generate view

How do I remove DbdocController?

I've installed Grails 2.1.2 and created a project.
When I run my project, the default page lists the following under Available Controllers:
grails.plugin.databasemigration.DbdocController
Not wanting to have to deal with this controller (which apparently doesn't work by default), I decided to try and get rid of it. Of course, the first thing I find is that there is no such controller under my project's controllers directory.
Having read that this controller is related to the database-migration plugin, I promptly uninstall this plugin using the grails uninstall-plugin command. This is successful according to Grails, but the controller is still there. The next thing I tried was to delete this plugin from my project's plugins directory, but I find that there is no such directory in my project.
How would I get rid of this virtual controller?
If you don't need database migrations (this is unlikely) then you can uninstall the plugin by removing it from your BuildConfig.groovy. There's no other way to remove the controller. Note that it's disabled by default in prod, so there's no need to remove it.

Resources