is latest spring security version compatible in grails 2 app? - grails

is it possible to use the latest spring security plugin in grails 2 app?
http://plugins.grails.org/plugin/grails/spring-security-core

If, by latest, you mean the current Grails 3 version of the Spring Security Plugin, then I'd say the quick answer is "no", it's not compatible with a Grails 2 application.
Plugins in Grails 2 and Grails 3 differ in form, installation scripts, etc. For instance, in Grails 2 you have to install the plugin, whereas in Grails 3 you just depend on the plugin.
That said, Grails 3 plugins are basically just zip/jar files, and you could try just depending on the Grails 3 plugin, which would get you the classes on your classpath at least, but none of the setup that Spring Boot performs when using that plugin in Grails 3. Furthermore, the plugin assumes Spring Boot and newer Spring libraries exist in your application (as they would in a Grails 3 app). You'd be buying a big chuck of dependency hell.
I'm not sure why you're trying to do this, but I don't recommend it.

Related

Grails 3.2.x with Flyway

I'm finding the available information about using Flyway with later (3.2.9) versions of Grails somewhat confusing.
There is a grails-flyway plugin that was around in Grails 2 days. It has been migrated to Grails 3. The Grails Documentation 4.4.2 Automatic Database Migration has a Flyway link to org.grails.plugins:grails-flyway, the Grails Flyway plugin.
But, the Flyway documentation for Grails 3 says "Grails 3.x is based on Spring Boot comes with out-of-the-box integration for Flyway." All we have to do is include a reference to Flyway in build.gradle.
And there is an article Flyway with Grails 3 by Kris Richardson that describes how to use Flyway with Grails 3 and no mention of the grails-flyway plugin in sight. Kris does describe that it isn't quite so simple and we need to define a bean in spring resources.groovy, but I think that's more to do with automatic DB migration.
Can someone clarify the current state of play regarding using Flyway with the later (3.2+) versions of Grails? Do I need the plugin, or not?
How can I make change the automatic migration behaviour different per environment?

Grails 3.0.1 - Folders missing?

I downloaded Grails 2.4.4 and created a test project (using NetBeans) and it was successful.
I downloaded Grails 3.0.1 and created a test project (using NetBeans) NetBeans says project created successfully but it did not load the project in to project explorer.
I compared Groovy folders of 2.4.4 and 3.0.1 and noticed that few folders are missing in the installation.
I confirmed that I downloaded the correct package.
These are the folders/files missing in Grails 3.0.1
folders
conf,
doc,
plugins,
script
files
build.properties,
readme
Grails 3.0 was a complete re-write of Grails and lots of things have changed. Not the least of which is the folder and file structure. Since Grails 3.0 is based on Spring Boot and Gradle a lot of what was very Grails specific has been removed and replaced with both of these.
This blog entry gives a good amount of detail on what has changed in Grails 3.0. It even talks about directory/file structures.

What versions, if any, of the CXF server and client plugins are compatible with Grails 1.3.9?

Unfortunately we have an application running Grails 1.3.9 that is earmarked for upgrade soon. However, before resources can be put into this upgrade we need to expose some of our services as SOAP endpoints. We also need to interact with an external SOAP API.
Do versions of the following plugins exist that work with Grails 1.3.9?
cxf
cxf-client
If no such compatible versions exist, the wslite plugin looks like an attractive alternative for the cxf-client plugin. Are there any such alternatives for the cxf plugin that can help expose services to SOAP requests?
You can check in the repo to see which plugin versions exist. It would be nice to have a Grails script for this.
http://repo.grails.org/grails/plugins/org/grails/plugins/cxf/
0.7 is the last version of the SOAP provider plugin that is Grails 1.x compatible, 1.6 is the last version of the plugin.
I've upgraded to Grails 2.x in the meantime so I haven't tested these, just didn't want to leave the question hanging.

How do I configured GGTS 3.4.0 to use the internally shipped Grails runtime?

I've been using a previous version of GGTS with an externally configured Grails 2.1.1 runtime path. Upgrading to GGTS 3.4.0 I'd like to use the Grails that ships with GGTS (2.2.4), but I don't know how to configure the preferences to use the internally shipped grails version.
I skip the option to install Grails from GGTS/STS when I install it - I prefer to manage that myself. Go to Window|Preferences and then to the Grails node under the Groovy node. You can easily add as many Grails installations as you want from there, and choose which one is the default.
I found the answer. I did a brand new install and noticed that a brand new install creates a grails-2.2.4 sub-directory. The upgrade does not give you the option and I assumed it would.

Is it possible to have a grails app choose between hibernate and mongodb at runtime

I'm trying to build a Grails App. I want the user who installs this grails app on their tomcat instance be able to choose whether they want to use hibernate with an rdbms or mongodb while deploying the app.
Is it possible to have both plugins hibernate and mongodb and pick one based on a config file?
Alternately is it possible to create two builds of the grails app with exactly same code, but different a plugin, so that the user can pick either build?
The second option is your best bet. If both plugins are installed you need to use the mapWith attribute to indicate which to use, and that's a static field in your domain classes.
But if you don't install the Mongo plugin all domain classes will use Hibernate, and if you uninstall the Hibernate plugin and install the Mongo plugin, all domain classes will use Mongo. That would be very easy to script - either run grails war (for Hibernate) or grails uninstall-plugin hibernate, grails install-plugin mongodb, and grails war (for Mongo).

Resources