Status of Shiro plugin with Grails 3? - grails

I have a number of Grails apps running with 2.2.5. I've been considering upgrading them to Grails 3, but I'm worried about plugin compatibility, most notably to do with the Shiro plugin which I use. From the plugin page I'm not convinced that it has been updated yet to work with Grails 3. Is there anyone out there using Shiro with a Grails 3 app successfully?

The discussions regarding Shiro Grails 3 support is on going on Github Shiro Page. As per the thread, it is not fully ready and developers are looking for help. Some of the developers were successful on developing a Shiro Plugin for Grails 3. However it lacks proper documentation and a sample demo application support.
I too had a dilemma of this when upgrading Grails 2.x to 3.x. What, I did was use the Spring-Security-Shiro plugin. It uses a hybrid approach combining Spring Security and Shiro Security, and proved to be handy.

Related

Is it possible to have different gorm versions in plugins within a grails 3 application?

I have a grails 3 application that makes heavy use of plugins. Some of these plugins provide domain classes. My application will not start unless every plugin has the same gorm version. This is an annoyance for locally developed plugins, but can be a significant problem for using third-party plugins.
There are more details in the stacktrace, but the relevant parts appear to be:
Caused by: org.grails.core.exceptions.GrailsRuntimeException: Failed to introspect class: class (my class name)
at grails.core.ArtefactHandlerAdapter.isArtefact(ArtefactHandlerAdapter.java:129)
at grails.core.DefaultGrailsApplication.addOverridableArtefact(DefaultGrailsApplication.java:772)
at org.grails.plugins.AbstractGrailsPluginManager.registerProvidedArtefacts(AbstractGrailsPluginManager.java:310)
I am currently using Grails 3.2.8 with GORM 6.1.3.RELEASE, but this happens with other non-matching versions for gorm as well.
If there is a better way to accomplish the bigger-picture goal, my big-picture goal is to use the grails ehcache plugin (currently at 3.0.0.M1) which requires gorm 6.1.x as a minimum. Per conversations on that plugin github site, there is no problem using gorm 6.1 with grails 3.2.x, though this is not the default.
Is there any way to run a grails 3 application, using plugins which provide domain objects, in which these plugins have different minor versions of gorm?
In case anyone else comes across this, the answer was basically "no".
The longer answer is "not as long as the groovy version is changing in non-backwards-compatible ways", and apparently that happens a lot.
There are some comments from Graeme here: https://github.com/grails/grails-core/issues/10693 but to summarize: you have to use the same version of gorm across plugins, and also make sure any third-party plugins you rely on are on the same version. This is only required for plugins that provide domain objects, at least!

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 and Spring Security Plugin

I've just recently started working with Grails, and I'd like to test out the Spring Security Plugin. I'm using Grails v3.0.0RC2, and I'm finding it difficult to come across accurate documentation for it with a lot of things.
I'm looking at the Grails page for the Spring Security Plugin, located at http://grails.org/plugin/spring-security-core, and it tells me to add the following to grails-app/conf/BuildConfig
plugins {
…
compile ':spring-security-core:2.0-RC4'
…
}
Now, Grails 3 has done away with the BuildConfig, and moved over to using Gradle. So I figured I could just that compile line to my "dependencies" section in build.gradle and it would work, like so:
dependencies{
...
compile:":spring-security-core:2.0-RC4"
}
However, that did not work. I get the error "Could not find :spring-security-core:2.0-RC4...".
Then I figured, 'Hey, it's a plugin, let me try prefacing it with "org.grails.plugins" like I see elsewhere in the build.gradle file:
dependencies{
...
compile:"org.grails.plugins:spring-security-core:2.0-RC4"
}
And still no go.
I have gotten it to compile by adding the dependency found on search.maven.org, like so:
dependencies{
...
compile 'org.springframework.security:spring-security-core:4.0.0.RELEASE'
}
But I don't think thats the proper way to do, because Grails documentation says I should have access to the command
grails s2-quickstart
once the plugin is installed, which I do not when I do it using the Maven repo.
I'm sure there's a simple configuration error I'm making, as I'm very new to both Grails, Spring, and Gradle, so I appreciate any help that can be provided.
The Spring Secuirty core plugin for Grails is not Grails 3 compatible. However, since Grails 3 is based on Spring Boot you can use the Spring Security Starter for Spring Boot instead.
This has been discussed on the Grails developers mailing list and going forward many Grails plugins will not be moved to Grails 3 and instead will be replaced by pure Spring solutions.
Update
Since this question was originally asked there has been a Spring Security plugin created for Grails 3.x. It can be found here: https://bintray.com/grails/plugins/spring-security-core/view
The "Spring Security Starter for Spring Boot" is a good starting point, but if you want to save yourself some time trying to figure out how to get it to work with Grails, check out this helpful blog post.
I wrote the blog post #Jamie referenced in his answer and I added a new blog post describing how to use the Gorm domain classes from Spring-Security-Core plugin from Grails 2.
dependencies {
...
compile 'org.grails.plugins:spring-security-core:3.0.4'
...
}
This is what I used and it worked for me

Clustered cache in Grails 2.4.x

I need suggestions on cache clustering for Grails at the most recent version I can get.
I've been trying to set up Terracotta with Grails 2.4.4 but I can't manage to find a compatible version of its plugin (by the way, the Terracotta plugin page says it was last updated 6 years ago). Also I can't find any recent posts on cache clustering for grails.
I'm planning on using it also for session replication. I'm using Apache Shiro for authentication/authorization. But that shouldn't matter.
Ehcache has an embedded distributed solution based on RMI. I'm gonna give it a try but I'm not sure it'll work for web sessions in grails since the documentation says to use Terracotta.

Security in grails

I'm looking for a security plugin for a grails project.
Spring security core 1.2.7.3 looks awesome but it seems that it's not under development for almost a year. Does anyone knows if that is the case?
Also are there any other good plugins?
Also i'm using mongodb and wanted to know if spring security core is compatible with mongo
Thanks!
Roy
Take a look at the plugin again. It's supported by SpringSource. If no updates, no need in them. Don't think they just forget to update.

Resources