Skip to content

Commit b372c1f

Browse files
committed
upgrade to Grails 5
1 parent 68301f2 commit b372c1f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+42424
-504
lines changed

.sdkmanrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Enable auto-env through the sdkman_auto_env config
2+
# Add key=value pairs of SDKs to use below
3+
# java=17.0.13-zulu
4+
java=11.0.24-zulu
5+
gradle=7.6.4
6+
groovy=3.0.11
7+
grails=5.3.6
8+
sshoogr=0.9.25

bintray-setup.sh

-2
This file was deleted.

build.gradle

+80-57
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,110 @@
11
buildscript {
2-
ext {
3-
grailsVersion = project.grailsVersion
4-
}
52
repositories {
63
mavenLocal()
4+
maven { url "https://plugins.gradle.org/m2/" }
75
maven { url "https://repo.grails.org/grails/core" }
86
}
97
dependencies {
10-
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
8+
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
9+
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.3.4"
1110
}
1211
}
1312

14-
plugins {
15-
id "io.spring.dependency-management" version "0.5.2.RELEASE"
16-
id "com.jfrog.bintray" version "1.5"
17-
}
18-
19-
version "1.3"
13+
version projectVersion
2014
group "org.grails.plugins"
2115

16+
apply plugin:"eclipse"
17+
apply plugin:"idea"
18+
apply plugin:"org.grails.grails-plugin"
19+
apply plugin:"asset-pipeline"
20+
apply plugin:"org.grails.grails-gsp"
2221
apply plugin: 'maven-publish'
23-
apply plugin: 'eclipse'
24-
apply plugin: 'idea'
25-
apply plugin: "spring-boot"
26-
apply plugin: "org.grails.grails-plugin"
27-
apply plugin: "org.grails.grails-gsp"
28-
// Used for publishing to central repository, remove if not needed
29-
apply from:'https://raw.githubusercontent.com/grails/grails-profile-repository/master/profiles/plugin/templates/grailsCentralPublishing.gradle'
30-
apply from:'https://raw.githubusercontent.com/grails/grails-profile-repository/master/profiles/plugin/templates/bintrayPublishing.gradle'
31-
32-
ext {
33-
grailsVersion = project.grailsVersion
34-
gradleWrapperVersion = project.gradleWrapperVersion
35-
}
36-
37-
bintray {
38-
pkg {
39-
userOrg = ''
40-
name = "org.grails.plugins:$project.name"
41-
issueTrackerUrl = "https://github.com/jamescookie/$project.name/issues"
42-
vcsUrl = "https://github.com/jamescookie/$project.name"
43-
version {
44-
attributes = ['grails-plugin': "jamescookie.plugins:$project.name"]
45-
name = project.version
46-
}
47-
}
48-
}
49-
50-
sourceCompatibility = 1.7
51-
targetCompatibility = 1.7
52-
22+
apply from: layout.projectDirectory.file('gradle/publishing.gradle')
5323

5424
repositories {
5525
mavenLocal()
5626
mavenCentral()
5727
maven { url "https://repo.grails.org/grails/core" }
5828
}
5929

60-
dependencyManagement {
61-
imports {
62-
mavenBom "org.grails:grails-bom:$grailsVersion"
30+
configurations {
31+
developmentOnly
32+
runtimeClasspath {
33+
extendsFrom developmentOnly
6334
}
64-
applyMavenExclusions false
6535
}
6636

6737
dependencies {
68-
provided 'org.springframework.boot:spring-boot-starter-logging'
69-
provided "org.springframework.boot:spring-boot-starter-actuator"
70-
provided "org.springframework.boot:spring-boot-autoconfigure"
71-
provided "org.springframework.boot:spring-boot-starter-tomcat"
38+
developmentOnly("org.springframework.boot:spring-boot-devtools")
39+
compileOnly "io.micronaut:micronaut-inject-groovy"
40+
console "org.grails:grails-console"
41+
implementation "org.springframework.boot:spring-boot-starter-logging"
42+
implementation "org.springframework.boot:spring-boot-starter-validation"
43+
implementation "org.springframework.boot:spring-boot-autoconfigure"
44+
implementation "org.grails:grails-core"
45+
implementation "org.springframework.boot:spring-boot-starter-actuator"
46+
implementation "org.springframework.boot:spring-boot-starter-tomcat"
47+
implementation "org.grails:grails-web-boot"
48+
implementation "org.grails:grails-logging"
49+
implementation "org.grails:grails-plugin-rest"
50+
implementation "org.grails:grails-plugin-databinding"
51+
implementation "org.grails:grails-plugin-i18n"
52+
implementation "org.grails:grails-plugin-services"
53+
implementation "org.grails:grails-plugin-url-mappings"
54+
implementation "org.grails:grails-plugin-interceptors"
55+
implementation "org.grails.plugins:cache"
56+
implementation "org.grails.plugins:async"
57+
implementation "org.grails.plugins:scaffolding"
58+
implementation "org.grails.plugins:gsp"
59+
profile "org.grails.profiles:web-plugin"
60+
runtimeOnly "com.bertramlabs.plugins:asset-pipeline-grails:3.3.4"
61+
testImplementation "io.micronaut:micronaut-inject-groovy"
62+
testImplementation "org.grails:grails-gorm-testing-support"
63+
testImplementation "org.mockito:mockito-core"
64+
testImplementation "org.grails:grails-web-testing-support"
7265

73-
provided "org.grails:grails-web-boot"
74-
provided "org.grails:grails-dependencies"
75-
provided 'javax.servlet:javax.servlet-api:3.1.0'
66+
// quartz translator https://www.freeformatter.com/cron-expression-generator-quartz.html
67+
// Quartz scheduler
68+
// http://www.quartz-scheduler.org/api/2.3.0/index.html
69+
// http://www.quartz-scheduler.org/documentation/quartz-2.3.0/
70+
// http://www.quartz-scheduler.org/documentation/
71+
implementation("org.quartz-scheduler:quartz:2.3.2") {
72+
exclude group: 'slf4j-api', module: 'c3p0'
73+
}
74+
// Quartz
75+
// https://grails-plugins.github.io/grails-quartz/latest/
76+
implementation "org.grails.plugins:quartz:2.0.13"
7677

77-
compile "org.grails.plugins:quartz:2.0.0.M4"
78-
compile "org.grails.plugins:asset-pipeline:$grailsVersion"
78+
// for future upgrade to grails 7
79+
// implementation 'org.grails.plugins:quartz:4.0.0-SNAPSHOT'
7980

80-
testCompile "org.grails:grails-plugin-testing"
81+
}
8182

82-
console "org.grails:grails-console"
83+
bootRun {
84+
ignoreExitValue true
85+
jvmArgs(
86+
'-Dspring.output.ansi.enabled=always',
87+
'-noverify',
88+
'-XX:TieredStopAtLevel=1',
89+
'-Xmx1024m')
90+
sourceResources sourceSets.main
91+
String springProfilesActive = 'spring.profiles.active'
92+
systemProperty springProfilesActive, System.getProperty(springProfilesActive)
93+
}
94+
95+
tasks.withType(GroovyCompile) {
96+
configure(groovyOptions) {
97+
forkOptions.jvmArgs = ['-Xmx1024m']
98+
}
8399
}
84100

85-
task wrapper(type: Wrapper) {
86-
gradleVersion = gradleWrapperVersion
101+
tasks.withType(Test) {
102+
useJUnitPlatform()
103+
}
104+
// enable if you wish to package this plugin as a standalone application
105+
bootJar.enabled = false
106+
107+
108+
assets {
109+
packagePlugin = true
87110
}

gradle.properties

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1-
grailsVersion=3.0.4
2-
gradleWrapperVersion=2.9
1+
projectVersion=1.4-SNAPSHOT
2+
grailsVersion=5.3.6
3+
grailsGradlePluginVersion=5.3.1
4+
groovyVersion=3.0.11
5+
gorm.version=7.3.4
6+
org.gradle.daemon=true
7+
org.gradle.parallel=true
8+
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx1024M

gradle/publishing.gradle

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
publishing {
2+
publications {
3+
maven(MavenPublication) {
4+
versionMapping {
5+
usage('java-api') {
6+
fromResolutionOf('runtimeClasspath')
7+
}
8+
usage('java-runtime') {
9+
fromResolutionResult()
10+
}
11+
}
12+
from components.java
13+
}
14+
}
15+
}

gradle/wrapper/gradle-wrapper.jar

6.9 KB
Binary file not shown.
+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Tue Jan 05 13:31:27 GMT 2016
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip

gradlew

+68-43
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,59 @@
1-
#!/usr/bin/env bash
1+
#!/usr/bin/env sh
2+
3+
#
4+
# Copyright 2015 the original author or authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# https://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
218

319
##############################################################################
420
##
521
## Gradle start up script for UN*X
622
##
723
##############################################################################
824

9-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10-
DEFAULT_JVM_OPTS=""
25+
# Attempt to set APP_HOME
26+
# Resolve links: $0 may be a link
27+
PRG="$0"
28+
# Need this for relative symlinks.
29+
while [ -h "$PRG" ] ; do
30+
ls=`ls -ld "$PRG"`
31+
link=`expr "$ls" : '.*-> \(.*\)$'`
32+
if expr "$link" : '/.*' > /dev/null; then
33+
PRG="$link"
34+
else
35+
PRG=`dirname "$PRG"`"/$link"
36+
fi
37+
done
38+
SAVED="`pwd`"
39+
cd "`dirname \"$PRG\"`/" >/dev/null
40+
APP_HOME="`pwd -P`"
41+
cd "$SAVED" >/dev/null
1142

1243
APP_NAME="Gradle"
1344
APP_BASE_NAME=`basename "$0"`
1445

46+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48+
1549
# Use the maximum available, or set MAX_FD != -1 to use that value.
1650
MAX_FD="maximum"
1751

18-
warn ( ) {
52+
warn () {
1953
echo "$*"
2054
}
2155

22-
die ( ) {
56+
die () {
2357
echo
2458
echo "$*"
2559
echo
@@ -30,6 +64,7 @@ die ( ) {
3064
cygwin=false
3165
msys=false
3266
darwin=false
67+
nonstop=false
3368
case "`uname`" in
3469
CYGWIN* )
3570
cygwin=true
@@ -40,28 +75,14 @@ case "`uname`" in
4075
MINGW* )
4176
msys=true
4277
;;
78+
NONSTOP* )
79+
nonstop=true
80+
;;
4381
esac
4482

45-
# Attempt to set APP_HOME
46-
# Resolve links: $0 may be a link
47-
PRG="$0"
48-
# Need this for relative symlinks.
49-
while [ -h "$PRG" ] ; do
50-
ls=`ls -ld "$PRG"`
51-
link=`expr "$ls" : '.*-> \(.*\)$'`
52-
if expr "$link" : '/.*' > /dev/null; then
53-
PRG="$link"
54-
else
55-
PRG=`dirname "$PRG"`"/$link"
56-
fi
57-
done
58-
SAVED="`pwd`"
59-
cd "`dirname \"$PRG\"`/" >/dev/null
60-
APP_HOME="`pwd -P`"
61-
cd "$SAVED" >/dev/null
62-
6383
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
6484

85+
6586
# Determine the Java command to use to start the JVM.
6687
if [ -n "$JAVA_HOME" ] ; then
6788
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -85,7 +106,7 @@ location of your Java installation."
85106
fi
86107

87108
# Increase the maximum file descriptors if we can.
88-
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
109+
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
89110
MAX_FD_LIMIT=`ulimit -H -n`
90111
if [ $? -eq 0 ] ; then
91112
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -105,10 +126,11 @@ if $darwin; then
105126
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106127
fi
107128

108-
# For Cygwin, switch paths to Windows format before running java
109-
if $cygwin ; then
129+
# For Cygwin or MSYS, switch paths to Windows format before running java
130+
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
110131
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111132
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133+
112134
JAVACMD=`cygpath --unix "$JAVACMD"`
113135

114136
# We build the pattern for arguments to be converted via cygpath
@@ -134,27 +156,30 @@ if $cygwin ; then
134156
else
135157
eval `echo args$i`="\"$arg\""
136158
fi
137-
i=$((i+1))
159+
i=`expr $i + 1`
138160
done
139161
case $i in
140-
(0) set -- ;;
141-
(1) set -- "$args0" ;;
142-
(2) set -- "$args0" "$args1" ;;
143-
(3) set -- "$args0" "$args1" "$args2" ;;
144-
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145-
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146-
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147-
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148-
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149-
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
162+
0) set -- ;;
163+
1) set -- "$args0" ;;
164+
2) set -- "$args0" "$args1" ;;
165+
3) set -- "$args0" "$args1" "$args2" ;;
166+
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
167+
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
168+
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
169+
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
170+
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
171+
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150172
esac
151173
fi
152174

153-
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154-
function splitJvmOpts() {
155-
JVM_OPTS=("$@")
175+
# Escape application args
176+
save () {
177+
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
178+
echo " "
156179
}
157-
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158-
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
180+
APP_ARGS=`save "$@"`
181+
182+
# Collect all arguments for the java command, following the shell quoting and substitution rules
183+
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
159184

160-
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
185+
exec "$JAVACMD" "$@"

0 commit comments

Comments
 (0)