Skip to content

Commit 95bda81

Browse files
committed
Upgraded to Grails 5 - tests passing
1 parent fb715a6 commit 95bda81

File tree

11 files changed

+282
-203
lines changed

11 files changed

+282
-203
lines changed

build.gradle

Lines changed: 143 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,22 @@ buildscript {
33
maven { url "https://repo.grails.org/grails/core" }
44
}
55
dependencies {
6-
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
7-
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.0.10"
8-
classpath "org.grails.plugins:hibernate5:7.0.4"
6+
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
7+
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.3.4"
8+
classpath "org.grails.plugins:hibernate5:7.2.0"
99
}
1010
}
1111

12-
version "3.0.0"
12+
version "3.1.0"
1313
group "org.grails.plugins"
1414

15-
apply plugin:"eclipse"
16-
apply plugin: 'idea'
17-
apply plugin:"org.grails.grails-plugin"
18-
apply plugin:"org.grails.grails-plugin-publish"
19-
apply plugin:"asset-pipeline"
20-
apply plugin:"org.grails.grails-gsp"
15+
apply plugin: "eclipse"
16+
apply plugin: "idea"
17+
apply plugin: "org.grails.grails-plugin"
18+
apply plugin: "asset-pipeline"
19+
apply plugin: "org.grails.grails-gsp"
20+
apply plugin: "maven-publish"
21+
//apply plugin: "signing"
2122

2223
repositories {
2324
maven { url "https://repo.grails.org/grails/core" }
@@ -32,41 +33,44 @@ configurations {
3233

3334
dependencies {
3435
developmentOnly("org.springframework.boot:spring-boot-devtools")
35-
compile "org.springframework.boot:spring-boot-starter-logging"
36-
compile "org.springframework.boot:spring-boot-autoconfigure"
37-
compile "org.grails:grails-core"
38-
compile "org.springframework.boot:spring-boot-starter-actuator"
39-
compile "org.springframework.boot:spring-boot-starter-tomcat"
40-
compile "org.grails:grails-web-boot"
41-
compile "org.grails:grails-logging"
42-
compile "org.grails:grails-plugin-rest"
43-
compile "org.grails:grails-plugin-databinding"
44-
compile "org.grails:grails-plugin-i18n"
45-
compile "org.grails:grails-plugin-services"
46-
compile "org.grails:grails-plugin-url-mappings"
47-
compile "org.grails:grails-plugin-interceptors"
48-
compile "org.grails.plugins:cache"
49-
compile "org.grails.plugins:async"
50-
compile "org.grails.plugins:scaffolding"
51-
compile "org.grails.plugins:hibernate5"
52-
compile "org.hibernate:hibernate-core:5.4.18.Final"
53-
compile "org.grails.plugins:mongodb"
54-
compile "org.grails.plugins:gsp"
55-
compile "org.grails.plugins:mail:3.0.0"
56-
// This is needed for the quartz-plugin on grails 4.0.x, https://github.com/grails-plugins/grails-quartz/issues/107#issuecomment-575951471
57-
compile("org.quartz-scheduler:quartz:2.2.3") {
58-
exclude group: 'slf4j-api', module: 'c3p0'
59-
}
60-
compile ('org.grails.plugins:quartz:2.0.13')
6136
compileOnly "io.micronaut:micronaut-inject-groovy"
6237
console "org.grails:grails-console"
38+
implementation "org.springframework.boot:spring-boot-starter-logging"
39+
implementation "org.springframework.boot:spring-boot-starter-validation"
40+
implementation "org.springframework.boot:spring-boot-autoconfigure"
41+
implementation "org.grails:grails-core"
42+
implementation "org.springframework.boot:spring-boot-starter-actuator"
43+
implementation "org.springframework.boot:spring-boot-starter-tomcat"
44+
implementation "org.grails:grails-web-boot"
45+
implementation "org.grails:grails-logging"
46+
implementation "org.grails:grails-plugin-rest"
47+
implementation "org.grails:grails-plugin-databinding"
48+
implementation "org.grails:grails-plugin-i18n"
49+
implementation "org.grails:grails-plugin-services"
50+
implementation "org.grails:grails-plugin-url-mappings"
51+
implementation "org.grails:grails-plugin-interceptors"
52+
implementation "org.grails.plugins:cache"
53+
implementation "org.grails.plugins:async"
54+
implementation "org.grails.plugins:scaffolding"
55+
implementation "org.grails.plugins:hibernate5"
56+
implementation "org.hibernate:hibernate-core:5.6.3.Final"
57+
implementation "org.grails.plugins:gsp"
58+
implementation "org.grails.plugins:mail:3.0.0"
59+
// This is needed for the quartz-plugin on grails >= 4.0.x, https://github.com/grails-plugins/grails-quartz/issues/107#issuecomment-575951471
60+
implementation("org.quartz-scheduler:quartz:2.2.3") {
61+
exclude group: 'slf4j-api', module: 'c3p0'
62+
}
63+
implementation ('org.grails.plugins:quartz:2.0.13')
6364
profile "org.grails.profiles:web-plugin"
64-
runtime "org.apache.tomcat:tomcat-jdbc"
65-
runtime "com.bertramlabs.plugins:asset-pipeline-grails:3.0.10"
66-
testCompile "io.micronaut:micronaut-inject-groovy"
67-
testCompile "org.grails:grails-gorm-testing-support"
68-
testCompile "org.mockito:mockito-core"
69-
testCompile "org.grails:grails-web-testing-support"
65+
runtimeOnly "com.bertramlabs.plugins:asset-pipeline-grails:3.3.4"
66+
runtimeOnly "org.glassfish.web:el-impl:2.2.1-b05"
67+
runtimeOnly "com.h2database:h2"
68+
runtimeOnly "org.apache.tomcat:tomcat-jdbc"
69+
runtimeOnly "javax.xml.bind:jaxb-api:2.3.1"
70+
testImplementation "io.micronaut:micronaut-inject-groovy"
71+
testImplementation "org.grails:grails-gorm-testing-support"
72+
testImplementation "org.mockito:mockito-core"
73+
testImplementation "org.grails:grails-web-testing-support"
7074
}
7175

7276
bootRun {
@@ -87,36 +91,107 @@ tasks.withType(GroovyCompile) {
8791
forkOptions.jvmArgs = ['-Xmx1024m']
8892
}
8993
}
94+
95+
tasks.withType(Test) {
96+
useJUnitPlatform()
97+
}
98+
9099
// enable if you wish to package this plugin as a standalone application
91100
bootJar.enabled = false
92-
grailsPublish {
93-
userOrg = 'kefirsf'
94-
license {
95-
name = 'Apache-2.0'
96-
}
97-
websiteUrl = 'https://grails.org/plugins.html#plugin/asynchronous-mail'
98-
issueTrackerUrl = 'https://github.com/kefirfromperm/grails-asynchronous-mail/issues'
99-
vcsUrl = 'https://github.com/kefirfromperm/grails-asynchronous-mail.git'
100-
title = "Grails Asynchronous Mail plugin"
101-
desc = "The plugin realises asynchronous mail sending. It stores messages in a DB and sends them asynchronously by a quartz job."
102-
developers = [
103-
kefirfromperm:"Vitalii Samolovskikh",
104-
stokito:"Sergey Ponomarev",
105-
ilopmar:"Iván López",
106-
burtbeckwith:"Burt Beckwith",
107-
puneetbehl:"Puneet Behl",
108-
aberbenni:"Alessandro Berbenni",
109-
dpcasady:"Danny Casady",
110-
SAgrawal14:"Shashank Agrawal",
111-
visheshd:"Vishesh",
112-
'micke-a':"Mikael Andersson",
113-
pgdoval:"Pablo González Doval",
114-
Uniqen:"Magnus Dalin",
115-
demon101:"Demon",
116-
matrei:"Mattias Reichel"
117-
]
101+
jar {
102+
enabled = true
103+
archiveClassifier = ''
118104
}
119105

120106
assets {
121107
packagePlugin = true
122108
}
109+
110+
publishing {
111+
publications {
112+
maven(MavenPublication) {
113+
groupId = project.group
114+
artifactId = 'asynchronous-mail'
115+
version = project.version
116+
117+
from components.java
118+
artifact sourcesJar
119+
artifact javadocJar
120+
121+
pom {
122+
name = 'Grails Asynchronous Mail Plugin'
123+
description = 'The plugin realises asynchronous mail sending. It stores messages in a DB and sends them asynchronously by a quartz job.'
124+
url = 'https://github.com/matrei/grails-asynchronous-mail'
125+
licenses {
126+
license {
127+
name = 'The Apache License, Version 2.0'
128+
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
129+
}
130+
}
131+
developers {
132+
developer {
133+
id = 'kefirfromperm'
134+
name = 'Vitalii Samolovskikh'
135+
}
136+
developer {
137+
id = 'stokito'
138+
name = 'Sergey Ponomarev'
139+
}
140+
developer {
141+
id = 'ilopmar'
142+
name = 'Iván López'
143+
}
144+
developer {
145+
id = 'burtbeckwith'
146+
name = 'Burt Beckwith'
147+
}
148+
developer {
149+
id = 'puneetbehl'
150+
name = 'Puneet Behl'
151+
}
152+
developer {
153+
id = 'aberbenni'
154+
name = 'Alessandro Berbenni'
155+
}
156+
developer {
157+
id = 'dpcasady'
158+
name = 'Danny Casady'
159+
}
160+
developer {
161+
id = 'SAgrawal14'
162+
name = 'Shashank Agrawal'
163+
}
164+
developer {
165+
id = 'visheshd'
166+
name = 'Vishesh'
167+
}
168+
developer {
169+
id = 'micke-a'
170+
name = 'Mikael Andersson'
171+
}
172+
developer {
173+
id = 'pgdoval'
174+
name = 'Pablo González Doval'
175+
}
176+
developer {
177+
id = 'Uniqen'
178+
name = 'Magnus Dalin'
179+
}
180+
developer {
181+
id = 'demon101'
182+
name = 'Demon'
183+
}
184+
developer {
185+
id = 'matrei'
186+
name = 'Mattias Reichel'
187+
}
188+
}
189+
scm {
190+
connection = 'scm:git:git://github.com/matrei/grails-asynchronous-mail.git'
191+
developerConnection = 'scm:git:ssh://github.com:matrei/grails-asynchronous-mail.git'
192+
url = 'https://github.com/matrei/grails-asynchronous-mail'
193+
}
194+
}
195+
}
196+
}
197+
}

gradle.properties

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
grailsVersion=4.0.6
2-
gormVersion=7.0.8.RELEASE
1+
grailsVersion=5.1.1
2+
grailsGradlePluginVersion=5.1.0
3+
groovyVersion=3.0.7
4+
gorm.version=7.1.2
35
org.gradle.daemon=true
46
org.gradle.parallel=true
57
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx1024M

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip

grails-app/conf/application.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,7 @@ grails:
8686
scriptlet: html
8787
taglib: none
8888
staticparts: none
89-
management:
90-
endpoints:
91-
jmx:
92-
unique-names: true
93-
9489
---
95-
9690
environments:
9791
test:
9892
quartz:
@@ -108,5 +102,5 @@ environments:
108102
driverClassName: org.h2.Driver
109103
username: sa
110104
password: ''
111-
dbCreate: create-drop
112-
url: jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
105+
dbCreate: update
106+
url: jdbc:h2:mem:testDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE

grails-app/conf/logback.groovy

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,40 @@
11
import grails.util.BuildSettings
22
import grails.util.Environment
3+
import org.springframework.boot.logging.logback.ColorConverter
4+
import org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter
35

6+
import java.nio.charset.StandardCharsets
7+
8+
conversionRule 'clr', ColorConverter
9+
conversionRule 'wex', WhitespaceThrowableProxyConverter
410

511
// See http://logback.qos.ch/manual/groovy.html for details on configuration
612
appender('STDOUT', ConsoleAppender) {
713
encoder(PatternLayoutEncoder) {
8-
pattern = "%level %logger - %msg%n"
14+
charset = StandardCharsets.UTF_8
15+
16+
pattern =
17+
'%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} ' + // Date
18+
'%clr(%5p) ' + // Log level
19+
'%clr(---){faint} %clr([%15.15t]){faint} ' + // Thread
20+
'%clr(%-40.40logger{39}){cyan} %clr(:){faint} ' + // Logger
21+
'%m%n%wex' // Message
922
}
1023
}
1124

12-
root(ERROR, ['STDOUT'])
13-
14-
if(Environment.current == Environment.DEVELOPMENT) {
15-
def targetDir = BuildSettings.TARGET_DIR
16-
if(targetDir) {
17-
18-
appender("FULL_STACKTRACE", FileAppender) {
19-
20-
file = "${targetDir}/stacktrace.log"
21-
append = true
22-
encoder(PatternLayoutEncoder) {
23-
pattern = "%level %logger - %msg%n"
24-
}
25+
def targetDir = BuildSettings.TARGET_DIR
26+
if (Environment.isDevelopmentMode() && targetDir != null) {
27+
appender("FULL_STACKTRACE", FileAppender) {
28+
file = "${targetDir}/stacktrace.log"
29+
append = true
30+
encoder(PatternLayoutEncoder) {
31+
charset = StandardCharsets.UTF_8
32+
pattern = "%level %logger - %msg%n"
2533
}
26-
logger("StackTrace", ERROR, ['FULL_STACKTRACE'], false )
2734
}
35+
logger("StackTrace", ERROR, ['FULL_STACKTRACE'], false)
2836
}
37+
root(ERROR, ['STDOUT'])
2938

3039
// Enable Asynchronous Mail plugin logging
3140
logger('grails.app.jobs.grails.plugin.asyncmail', TRACE, ['STDOUT'], false)

0 commit comments

Comments
 (0)