grails-3.1

Adding in-place plugin to grails 3 project

孤人 提交于 2019-12-19 08:18:16
问题 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. 回答1: Yes, there is. Grails 3 is based on Gradle so multi-project gradle builds solve your issue. Basically

Cannot package Grails 3 application - NoSuchMethodError

白昼怎懂夜的黑 提交于 2019-12-19 04:09:36
问题 I'm trying to package my Grails 3.1.5 application. Running grails package (or grails war ) results in the following: FAILURE: Build failed with an exception. * What went wrong: org.codehaus.groovy.runtime.DefaultGroovyMethods.each(Ljava/util/List;Lgroovy/lang/Closure;)Ljava/util/List; * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 2.205 secs | Error Command [package] error: Could not execute build

Why does Gradle downgrade my transitive dependencies in a Grails 3.1 application?

99封情书 提交于 2019-12-18 11:52:59
问题 I am having a problem with a transitive dependency of my grails-flyway plugin. org.grails.plugins:grails-flyway:0.2.1 declares a dependency to org.flywaydb:flyway-core:4.0.1 . When I include the plugin into my Grails 3.1.6 project Gradle downgrades Flyway to version 3.2.1. +--- org.grails.plugins:grails-flyway:0.2.1 | \--- org.flywaydb:flyway-core:4.0.1 -> 3.2.1 My Gradle build file looks like this buildscript { ext { grailsVersion = project.grailsVersion } repositories { maven { url "https:/

Why does Gradle downgrade my transitive dependencies in a Grails 3.1 application?

安稳与你 提交于 2019-12-18 11:51:59
问题 I am having a problem with a transitive dependency of my grails-flyway plugin. org.grails.plugins:grails-flyway:0.2.1 declares a dependency to org.flywaydb:flyway-core:4.0.1 . When I include the plugin into my Grails 3.1.6 project Gradle downgrades Flyway to version 3.2.1. +--- org.grails.plugins:grails-flyway:0.2.1 | \--- org.flywaydb:flyway-core:4.0.1 -> 3.2.1 My Gradle build file looks like this buildscript { ext { grailsVersion = project.grailsVersion } repositories { maven { url "https:/

Grails 3.1.8 controller

自作多情 提交于 2019-12-13 06:28:38
问题 I'm converting a grails 2.4.4 app to 3.1.8. In some of my controller methods sometimes (based on what happened in the service call) I'll just set a message in the flash and nothing else, this was fine in 2.4.4, the screen would be re-rendered with the flash message but in 3.1.8 nothing is rendered at all, the screen in totally blank. Seemingly if I add a statement after setting the message in the flash the screen is rendered, the statement can be anything e.g. println 'hello' or return or new

Grails 3 fontawesome setup

青春壹個敷衍的年華 提交于 2019-12-13 04:28:31
问题 i'm attempting to include fontawesome (fa) in my grails 3 project. I saw for grails2 there was a plugin for this, but the configuration and explanation for how to install this plugin didn't seem to work in grails 3. So I tried to add fa more or less manually by creating an assets/fonts/ directory, and placing the fonts in there, added the css to my stylesheets directory and referenced it from the application.css. When I run in Idea via grails run-app all the fa resources show up fine. However

How can I access GORM object properties in a GroovyScriptCommand?

妖精的绣舞 提交于 2019-12-12 19:36:21
问题 I used the Grails create-script command to create my own custom script for rendering source code artifacts based on a GORM domain object. I want to generate a command object that contains the properties of the domain object. I see the properties and methods on the GroovyScriptCommand and TemplateRenderer, but I can't tell how to get a reference to the domain object properties or how to render them in my scaffolding templates. I tried forClass(model.fullName) but it says ClassNotFounException.

combine @TestFor and @Integration Annotation grails 3

对着背影说爱祢 提交于 2019-12-12 06:35:52
问题 I migrate a large Grails 1.3.7 project to 3.1.6. Tests for Controllers are integration tests. This works fine because the tests inherit from ControllerSpec. Now i´m should be able to do something like this: @Integration @TestFor(SampleController) class SampleControllerIntSpec extends Specification { Because the TestFor Annotation allows usage of model/view/.. fields like in Unit tests. Is there a way to do something like this? Thanks in advance. 回答1: No the TestFor annotations are exclusively

How to enable webapp as distributable in grails 3+

我只是一个虾纸丫 提交于 2019-12-12 04:38:45
问题 How do i enable webapp to be distributable in grails 3+ since there is no web.xml? 回答1: step 1: go to src\main\webapp\WEB-INF location. (if not, create the path) step 2: create a folder WEB-INF step 3: create a file web.xml and paste the following code <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" metadata-complete="true" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http:/

Grails noSelection property in the select tag over rides the value

孤街醉人 提交于 2019-12-12 01:43:32
问题 I have the select tag below: <g:select name="recommendation" from="${recommendation.list()}" optionKey="id" optionValue="recommendation" value="${theAssessment.recommendation}" noSelection="['':'-- Select Assessor Recommendation --']" /> The form works as expected as when the value is null the noSelection is displayed. When I use the select tag to select the data I want to submit, this also works fine as this is persisted in the database. When I then go back to the form the noSelection over