grails-plugin

grails override redirect controller method

那年仲夏 提交于 2019-12-03 16:12:11
I am trying to override the default controller redirect method and cannot seem to get the following bit of code to work. I have created a plugin and I'm trying to use the "doWithDynamicMethods" to replace the redirect. def doWithDynamicMethods = {ctx -> application.controllerClasses.each() { controllerClass -> replaceRedirectMethod(controllerClass) } } void replaceRedirectMethod(controllerClass) { def oldRedirect = controllerClass.metaClass.pickMethod("redirect", [Map] as Class[]) controllerClass.metaClass.redirect = { Map args, Map params -> // never seems to get here } } Do I have the

How do I publish a grails 3 plugin to my local nexus repo?

怎甘沉沦 提交于 2019-12-03 12:58:47
Running grails publish-plugin doesn't seem to do anything, and the only documentation I could find was about publishing to bintray. [edit:] I can publish the plugin via gradle publish , but wondered if there was a grails-y way to do it, and wonder what grails publish-plugin actually does :/ Charlotte Tan I figured it out with help from Ryan Vanderwerf at http://rvanderwerf.blogspot.com/2015/07/how-to-publish-grails-3-plugin.html who writes that there are a bunch of spring-boot dependencies that don't have versions in them and that causes gradle to freak out. To workaround it, strip out all

Grails Resources Plugin and AJAX loaded javascript

本秂侑毒 提交于 2019-12-03 11:22:09
问题 I added the resources plug-in in a grails 1.3.7 application and everything works fine except javascript that is loaded asynchronously. So if I have a template that contains a <r:script> // javascript here </r:script> and load it via ajax the js code does not execute, and I get this error: It looks like you are missing some calls to the r:layoutResources tag which makes sense because the page has already been rendered and there is no r:layoutResources to handle the newly added r:script js code

Grails 2.3.4 - Error executing script Clean: _GrailsClasspath_groovy$_run_closure1

£可爱£侵袭症+ 提交于 2019-12-03 10:52:24
问题 I am using eclipse kepler and after shutting down my computer and turning it on again I am getting this error message: grails run-app --stacktrace |Loading Grails 2.3.4 |Configuring classpath . |Environment set to development .Error | Error executing script RunApp: _GrailsClasspath_groovy$_run_closure1 (NOTE: Stac k trace has been filtered. Use --verbose to see entire trace.) java.lang.NoClassDefFoundError: _GrailsClasspath_groovy$_run_closure1 at _GrailsClasspath_groovy.run(_GrailsClasspath

Grails Problem with custom error messages

北战南征 提交于 2019-12-03 02:16:35
I am currently trying to specify custom error messages in grails for the default constraints but so far all I get back is the default error message. I know that I have to edit the grails-app/i18n/messages.properties file If I change the following default error codes message, it will correctly display the new error message default.blank.message=Property [{0}] of class [{1}] cannot be blank However, this is not what I am trying to do. I need more granular error reporting and have more than one field that can be blank etc. What I would like to be able to do would be, display custom messages for

Grails Resources Plugin and AJAX loaded javascript

陌路散爱 提交于 2019-12-03 01:49:08
I added the resources plug-in in a grails 1.3.7 application and everything works fine except javascript that is loaded asynchronously. So if I have a template that contains a <r:script> // javascript here </r:script> and load it via ajax the js code does not execute, and I get this error: It looks like you are missing some calls to the r:layoutResources tag which makes sense because the page has already been rendered and there is no r:layoutResources to handle the newly added r:script js code. The only workaround I've found is to add render r.layoutResources(disposition:"defer") after the

Share config between two grails apps that share a common plugin

不想你离开。 提交于 2019-12-02 20:11:45
问题 We will have two apps that both need to use the same services/utilities/code/configuration. We are using grailsApplication.config.* to configure things like URLs to external services. These are different depending on whether the app is running in dev/test/qa/staging/prod, so we have used the environments section in Config.groovy. We'll need the same URLs/environments configured for both applications. In order to avoid duplication, we are trying to build a plugin that will hold all the shared

Grails Fixture plugin keeps saying build-test-data plugin is not installed

痞子三分冷 提交于 2019-12-02 17:19:43
问题 I have the following dependency declaration in BuildConfig.groovy : plugins { test ':build-test-data:2.2.1' test ':fixtures:1.3' } I've already run refresh-dependencies on both the terminal, and my IDE (Eclipse) but every time I run the test I get: grails.plugin.fixtures.exception.FixtureException: build feature is unavailable as build-test-data plugin is not installed at grails.plugin.fixtures.builder.FixtureBuilder.assertBuildTestDataPluginInstalledIfNeeded(FixtureBuilder.groovy:135) at

Share config between two grails apps that share a common plugin

不问归期 提交于 2019-12-02 07:41:28
We will have two apps that both need to use the same services/utilities/code/configuration. We are using grailsApplication.config.* to configure things like URLs to external services. These are different depending on whether the app is running in dev/test/qa/staging/prod, so we have used the environments section in Config.groovy. We'll need the same URLs/environments configured for both applications. In order to avoid duplication, we are trying to build a plugin that will hold all the shared stuff. This works for services and such, but Grails plugins do not include Config.groovy, resources

Grails: disable Spring Security Core on certain paths

岁酱吖の 提交于 2019-12-02 03:57:11
How do I set up Spring Security Core in a way that calls to a certain pattern (such as /api/**) are not filtered? grails.plugins.springsecurity.filterChain.chainMap = [ '/api/**': '', '/**': 'JOINED_FILTERS', ] doesn't work, since it will try to resolve the bean ''. Is there anything other than the nasty workaround with 'JOINED_FILTERS,-filter1,-filter2,...' How are static resources being excluded from Spring Security? You need to add the anonymous filter to your filter chain. If you followed the grails spring security rest configuration tutorial you probably got the following code: grails