diff --git a/samples/rest-notes-grails/build.gradle b/samples/rest-notes-grails/build.gradle index 61ec5da5..3ff00826 100644 --- a/samples/rest-notes-grails/build.gradle +++ b/samples/rest-notes-grails/build.gradle @@ -58,7 +58,7 @@ dependencies { compile "org.grails:grails-plugin-services" compile "org.grails:grails-plugin-datasource" compile "org.grails:grails-plugin-databinding" - compile "org.grails:grails-plugin-async" + compile "org.grails.plugins:async" compile "org.grails:grails-web-boot" compile "org.grails:grails-logging" compile "org.grails.plugins:cache" @@ -72,9 +72,10 @@ dependencies { profile "org.grails.profiles:rest-api" runtime "com.h2database:h2" + runtime 'org.apache.tomcat:tomcat-jdbc' testCompile "io.rest-assured:rest-assured:3.0.2" - testCompile "org.grails:grails-plugin-testing" + testCompile "org.grails:grails-test-mixins:3.3.0" testCompile "org.grails.plugins:geb" testCompile "org.grails:grails-datastore-rest-client" testCompile "org.springframework.restdocs:spring-restdocs-restassured" diff --git a/samples/rest-notes-grails/gradle.properties b/samples/rest-notes-grails/gradle.properties index d8bda96d..33272aea 100644 --- a/samples/rest-notes-grails/gradle.properties +++ b/samples/rest-notes-grails/gradle.properties @@ -1,2 +1,2 @@ -grailsVersion=3.2.6 -gradleWrapperVersion=3.4 \ No newline at end of file +grailsVersion=3.3.2 +gradleWrapperVersion=4.4 \ No newline at end of file diff --git a/samples/rest-notes-grails/gradle/wrapper/gradle-wrapper.jar b/samples/rest-notes-grails/gradle/wrapper/gradle-wrapper.jar index fd9493e7..01b8bf6b 100644 Binary files a/samples/rest-notes-grails/gradle/wrapper/gradle-wrapper.jar and b/samples/rest-notes-grails/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/rest-notes-grails/gradle/wrapper/gradle-wrapper.properties b/samples/rest-notes-grails/gradle/wrapper/gradle-wrapper.properties index ed36ab1b..933b6473 100644 --- a/samples/rest-notes-grails/gradle/wrapper/gradle-wrapper.properties +++ b/samples/rest-notes-grails/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Thu Mar 23 11:49:00 GMT 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-bin.zip diff --git a/samples/rest-notes-grails/gradlew b/samples/rest-notes-grails/gradlew index 4453ccea..cccdd3d5 100755 --- a/samples/rest-notes-grails/gradlew +++ b/samples/rest-notes-grails/gradlew @@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS="" # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" -warn ( ) { +warn () { echo "$*" } -die ( ) { +die () { echo echo "$*" echo @@ -155,7 +155,7 @@ if $cygwin ; then fi # Escape application args -save ( ) { +save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } diff --git a/samples/rest-notes-grails/gradlew.bat b/samples/rest-notes-grails/gradlew.bat index f9553162..e95643d6 100644 --- a/samples/rest-notes-grails/gradlew.bat +++ b/samples/rest-notes-grails/gradlew.bat @@ -1,84 +1,84 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/samples/rest-notes-grails/grails-app/controllers/com/example/UrlMappings.groovy b/samples/rest-notes-grails/grails-app/controllers/com/example/UrlMappings.groovy index 190e41e3..74b2c409 100644 --- a/samples/rest-notes-grails/grails-app/controllers/com/example/UrlMappings.groovy +++ b/samples/rest-notes-grails/grails-app/controllers/com/example/UrlMappings.groovy @@ -19,12 +19,7 @@ package com.example class UrlMappings { static mappings = { - delete "/$controller/$id(.$format)?"(action:"delete") - get "/$controller(.$format)?"(action:"index") - get "/$controller/$id(.$format)?"(action:"show") - post "/$controller(.$format)?"(action:"save") - put "/$controller/$id(.$format)?"(action:"update") - patch "/$controller/$id(.$format)?"(action:"patch") + '/notes'(resources: 'note') "500"(view: '/error') "404"(view: '/notFound') diff --git a/samples/rest-notes-grails/grails-app/domain/com/example/Note.groovy b/samples/rest-notes-grails/grails-app/domain/com/example/Note.groovy index 140b839c..659d0ffa 100644 --- a/samples/rest-notes-grails/grails-app/domain/com/example/Note.groovy +++ b/samples/rest-notes-grails/grails-app/domain/com/example/Note.groovy @@ -18,7 +18,7 @@ package com.example import grails.rest.Resource -@Resource(uri='/notes', formats = ['json', 'xml']) +@Resource(uri='/notes') class Note { Long id diff --git a/samples/rest-notes-grails/grails-app/domain/com/example/Tag.groovy b/samples/rest-notes-grails/grails-app/domain/com/example/Tag.groovy index b0c712c6..eb28ed66 100644 --- a/samples/rest-notes-grails/grails-app/domain/com/example/Tag.groovy +++ b/samples/rest-notes-grails/grails-app/domain/com/example/Tag.groovy @@ -18,7 +18,7 @@ package com.example import grails.rest.Resource -@Resource(uri='/tags', formats = ['json', 'xml']) +@Resource(uri='/tags') class Tag { Long id diff --git a/samples/rest-notes-grails/settings.gradle b/samples/rest-notes-grails/settings.gradle new file mode 100644 index 00000000..e69de29b