grails-plugin

Adding in-place plugin to grails 3 project

血红的双手。 提交于 2019-12-01 05:36:20
In grails 2.x, we were allowed to add an in place plugin by adding following in BuildConfig.groovy grails.plugin.location."my-plugin" = "../my-plugin" My question is, can we add our local plugins similarly in-place in grails3.0 as well or there is some other way to do this in grails. Actual purpose is to test the plugin whether it's working properly or not before pushing it to bintray. Yes, there is. Grails 3 is based on Gradle so multi-project gradle builds solve your issue. Basically you add dependency as: compile project(':../my-custom-plugin') and has to modify settings.gradle to include

Grails Redirect Post-Logout Using spring-security-core-3.0.6+

五迷三道 提交于 2019-11-30 21:26:29
In spring security version 3.0.6, which fixed a CRLF logout exploit ( https://jira.springsource.org/browse/SEC-1790 ) they disabled the use of the 'spring-security-redirect' parameter. Default support for the redirect parameter in logout URLs has also been removed in 3.0.6. In 3.1 it already needs to be enabled explicitly. Is there a way to turn the redirect parameter back on, so that I can dynamically redirect in my Grails Spring Security Logout Controller? LogoutContoller.groovy def user = springSecurityService.currentUser if (params.redirect) { // this needs to log the user out and then

How to implement a Groovy global AST transformation in a Grails plugin?

╄→尐↘猪︶ㄣ 提交于 2019-11-30 18:42:48
问题 I'd like to modify some of my Grails domain classes at compilation time. I initially thought this was a job for Groovy's global ASTTransformation since I don't want to annotate my domain classes (which local transformers require). What's the best way to do this? I also tried mimicking DefaultGrailsDomainClassInjector.java by creating my own class in the same package, implementing the same interfaces, but I probably just didn't know how to package it up in the right place because I never saw

How To Call A Taglib As A Function In A Domain Class

前提是你 提交于 2019-11-30 13:10:24
I need to call the Static Resources Plugin ( http://www.grails.org/Static+Resources+Plugin ) from my domain class. This works perfectly in a controller: def tstLink = resourceLinkTo(dir:"docs/${identifier}",file:originalFileName) but in a domain class I get Exception Message: No signature of method: static org.maflt.ibidem.Item.resourceLinkTo() is applicable for argument types: (java.util.LinkedHashMap) values: [[dir:docs/19e9ea9d-5fae-4a35-80a2-daedfbc7c2c2, file:2009-11-12_1552.png]] I assume this is a general problem. So how do you call a taglib as a function in a domain class? I

Is there an equivalent to the Bootstrap class in a Plugin

孤者浪人 提交于 2019-11-30 12:39:44
Is there an a way to initialise some data in a Plugin. I am modulizing my code and it would be nice to have something like the bootstrap in the Plugin but I cannot find it. Nor can I find references using the Google. BootStrap.groovy is excluded by default from a plugin zip, but you can create a MyPluginBootStrap.groovy (name doesn't matter, just can't be BootStrap) and that'll be packaged and run along with the application's BootStrap. 来源: https://stackoverflow.com/questions/2994379/is-there-an-equivalent-to-the-bootstrap-class-in-a-plugin

How do disable log4j plugin in grails?

£可爱£侵袭症+ 提交于 2019-11-30 10:36:02
It appears the Grails 2.1 log4j plugin resets the log4j configuration during initialization of the grails application (see stack trace below). at org.apache.log4j.LogManager.resetConfiguration(LogManager.java:233) at org.apache.log4j.LogManager$resetConfiguration.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112) at org.codehaus.groovy.grails.plugins.log4j

Is it possible to exclude grails plugin from production environment?

旧巷老猫 提交于 2019-11-30 09:39:53
I would like to use certain plugin in development environment, but would like to exclude this plugin from production and from generated war. What is the easiest way to accomplish this? Yes, using plugin scopes. From http://grails.org/1.1+Release+Notes : Plugins can now be scoped using either the environment or predefined build scopes: def environments = ['dev', 'test'] def scopes = [excludes:'war'] The plugins will only load in those environments and will not be packaged into the WAR file. This allows "development-only" plugins to not be packaged for production use. I don't believe that there

“Error loading plugin manager: TomcatGrailsPlugin” on Grails 2.3 Database Migration

99封情书 提交于 2019-11-30 06:29:05
问题 I use Grails 2.3 and the Grails database migration plugin (1.3.6). When I do grails dbm-update I get the following error. How can I solve this error? Error Error loading plugin manager: TomcatGrailsPlugin (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.) java.lang.ClassNotFoundException: TomcatGrailsPlugin at _GrailsBootstrap_groovy$_run_closure2.doCall(_GrailsBootstrap_groovy:40) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133) at org.codehaus

Error Failed to resolve dependencies grails

我怕爱的太早我们不能终老 提交于 2019-11-30 04:48:02
I get Error Failed to resolve dependencies error when I try to run, clean, or compile. My BuildConfig.groovy file is as follows: grails.servlet.version = "2.5" // Change depending on target container compliance (2.5 or 3.0) grails.project.class.dir = "target/classes" grails.project.test.class.dir = "target/test-classes" grails.project.test.reports.dir = "target/test-reports" grails.project.target.level = 1.6 grails.project.source.level = 1.6 //grails.project.war.file = "target/${appName}-${appVersion}.war" //Start company specific //set plugin directory (needed for having plugins in perforce)

How to install Grails plugin from source code?

家住魔仙堡 提交于 2019-11-30 01:36:06
问题 I got a source code of the plugin from a friend, but still don't know how to install it into my project. Yes, there's install-plugin command, but this plugin isn't allowed to upload to the root grails plugin directory. How can I install grails plugin from the source code? UPDATE: the plugin is developed for Grails 1.1, but my current project is Grails 1.3. Can it cause any problem? 回答1: You can package the plugin into a zip, and install from that. Open a command prompt in the root directory