grails-3.0

Grails3 unit test for domain class with derived property

岁酱吖の 提交于 2019-12-11 12:36:55
问题 I have the following Domain class with derived property lowercaseTag . class Hashtag { String tag String lowercaseTag static mapping = { lowercaseTag formula: 'lower(tag)' } } If I run the following unit test, it will fail on the last line, because lowercaseTag property is null and by default all properties have nullable: false constraint. @TestFor(Hashtag) class HashtagSpec extends Specification { void "Test that hashtag can not be null"() { when: 'the hashtag is null' def p = new Hashtag

3.0.0.M1: SSL - Invalid keystore format

落花浮王杯 提交于 2019-12-11 03:12:45
问题 Thanks @dmahapatro, I got first aid to ssl under spring-boot circumstances here: 3.0.0.M1 how to run on https connection So I generated a keystore: keytool -genkey -keyalg RSA -alias rawi -keystore keystore.jks -storepass pass.pass -validity 365 -keysize 2048 -storetype JKS I copied keystore.jks to grails-app/conf/ Check keystore: keytool -list -keystore grails-app/conf/keystore.jks Enter keystore password: Keystore type: JKS Keystore provider: SUN Your keystore contains 1 entry rawi, 04.02

Grails 3 - where's the DataSource.groovy and about plugins

怎甘沉沦 提交于 2019-12-11 01:17:30
问题 So I downloaded Grails 3 M1 and created a project. There's no DataSource.groovy, even after the MySQL driver was added to the dependencies - I thought maybe it will see the driver and know a DataSource.groovy is needed. Secondly, plugins. I found the Grails 3 plugin page (https://github.com/grails3-plugins) How does one go about installing these? Is there a new repository? E.g. the newest Scaffolding plugin on Maven is from March 2014. Will the older plugins still work? Thanks. 回答1: Starting

Launch Grails 3 app from IntelliJ w/ auto-reloading enabled

僤鯓⒐⒋嵵緔 提交于 2019-12-10 22:46:21
问题 It looks like IntelliJ's (Ultimate EAP 15) support for Grails 3 is in the early stages yet. If I do Run -> Debug 'Grails:My App' , I'm able to launch an app from inside IntelliJ, I can set breakpoints and it works as expected. If I make changes however, I see in the console that the file is recompiled, but when I hit reload in the browser, I don't see the changes reflected there. I have to stop and restart the app in IntelliJ before I see them. Anyone know how I can get the auto-reloading

Running a Grails 3 project with in line plugins

柔情痞子 提交于 2019-12-10 18:32:42
问题 I'm almost certain this is a stupid question but I do not know the answer to it :) I'm in the process of upgrading a project of mine from Grails 2.5 to 3 and trying to get to grips with the new inline plugin structure, the old way was working fine but struggling to get the new way working. I have a directory structure as follows: / /settings.gradle /myApp #contains a grails 3 application /myPlugin1 #contains a grails 3 plugin /myPlugin2 #contains a grails 3 plugin /settings.gradle contains:

How do I import an existing Grails 3 (3.0.12) project in IntelliJ 15

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 17:30:49
问题 There's documentation on IntelliJ's website for creating a new Grails project, but importing a project is more sketchy and I cannot get it to work for me. If I tell IntelliJ to import a new project, and point it to my project directory, it does not recognize it as a Grails project. After the project imports, I can go to the Project menu, right click on the project and go to "add Framework support..." and select Groovy, but IntelliJ still does not recognize my project as a Grails project. For

Grails 3 Setup application.yml production mongodb

蹲街弑〆低调 提交于 2019-12-10 12:05:54
问题 How to set the use connectionstring which usess mongodb in production. development: grails: mongodb: connectionString: "mongodb://localhost:27017/fanfest" production: dataSource: dbCreate: update url: jdbc:h2:./prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE properties: jmxEnabled: true initialSize: 5 maxActive: 50 minIdle: 5 maxIdle: 25 maxWait: 10000 maxAge: 600000 timeBetweenEvictionRunsMillis: 5000 minEvictableIdleTimeMillis: 60000 validationQuery: SELECT 1

how can I disable reloading in a grails 3.0.0 app?

一个人想着一个人 提交于 2019-12-08 17:43:24
问题 It appears that the spring reloading causes errors with JDK 8u40 in Grails 3.0.0.M2. Can I disable the reloading in development mode? Is there a key to set in the build.gradle or in the application.yml? 回答1: Not sure if it helps in above case. I use below over grails 2.3.8 to disable auto compile. grails -Dserver.port=8090 -Dserver.env=development -Denable.jndi=true -Ddisable.auto.recompile=true run-app where disable.auto.recompile=true disables autocompile and autoreload of changes . server

Grails 3 and Java 8 time support

折月煮酒 提交于 2019-12-08 01:34:07
问题 In grails 3 application, I see that new java.time classes are persisted to database. Dynamic queries and create criteria works. However, I am wondering if there is some better way how to store these time data to database. When I look to database I see some binary data, it seems it just serialize the time objects. Is there any similar plugin as joda-time-plugin or is there any way how to configure database mapping for java.time classes? 回答1: Edit : Grails 3.1.1 has hibernate 5 so this is not

convert configuration file application.yml to application.groovy in Grails 3.x

偶尔善良 提交于 2019-12-07 05:46:37
问题 I am trying to create a simple Grails 3 project and got stuck with something really simple. So I want my data source properties to come from VM options that I set in my IntelliJ IDE. Before in Grails 2.x, I just used to do something like: environments { development{ //Database connection properties def dbserver = System.properties.getProperty('dbserver') def dbport = System.properties.getProperty('dbport') ............ dataSource { url: "jdbc:sqlserver://${dbserver}:${dbport};databaseName=$