From 6be5f76db328aacac5bb70e4da9faf155c90e79a Mon Sep 17 00:00:00 2001 From: eusorov Date: Fri, 26 Jan 2024 10:03:16 +0100 Subject: [PATCH 1/8] update grails5.3.5, gradle 7.6.1 --- build.gradle | 59 +++++++++++++----------- gradle.properties | 4 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 34 insertions(+), 31 deletions(-) diff --git a/build.gradle b/build.gradle index 4899a22..9daeb80 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,8 @@ buildscript { maven { url "https://repo.grails.org/grails/core" } } dependencies { - classpath "org.grails:grails-gradle-plugin:$grailsVersion" + classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" + classpath "io.github.gradle-nexus:publish-plugin:1.0.0" } } @@ -13,22 +14,20 @@ plugins { } //version "3.0.1" -version "3.0.1.BUILD-SNAPSHOT" +version "4.0.1.BUILD-SNAPSHOT" group "org.grails.plugins" apply plugin: "eclipse" apply plugin: "idea" apply plugin: "org.grails.grails-plugin" -apply plugin: "org.grails.grails-plugin-publish" +apply plugin: "maven-publish" +apply plugin: "io.github.gradle-nexus.publish-plugin" repositories { mavenLocal() maven { url "https://repo.grails.org/grails/core" } } -sourceCompatibility = 1.8 -targetCompatibility = 1.8 - dependencyManagement { imports { mavenBom "org.grails:grails-bom:$grailsVersion" @@ -41,24 +40,24 @@ configurations { } dependencies { - provided 'org.springframework.boot:spring-boot-starter-logging' - provided "org.springframework.boot:spring-boot-starter-actuator" - provided "org.springframework.boot:spring-boot-autoconfigure" - provided "org.springframework.boot:spring-boot-starter-tomcat" - - provided "org.grails:grails-web-boot" - provided "org.grails:grails-dependencies" - provided 'javax.servlet:javax.servlet-api:3.1.0' + implementation "org.springframework.boot:spring-boot-starter-logging" + implementation "org.springframework.boot:spring-boot-starter-actuator" + implementation "org.springframework.boot:spring-boot-starter-validation" + implementation "org.springframework.boot:spring-boot-autoconfigure" + implementation "org.springframework.boot:spring-boot-starter-tomcat" + + implementation "org.grails:grails-web-boot" + implementation 'javax.servlet:javax.servlet-api:3.1.0' profile "org.grails.profiles:plugin" - testCompile "org.grails:grails-plugin-testing" + testImplementation "org.grails:grails-gorm-testing-support" console "org.grails:grails-console" - compile "org.grails.plugins:cache:4.0.3" - compile 'org.ehcache:ehcache:3.4.0' + implementation "org.grails.plugins:cache:5.0.1" + implementation 'org.ehcache:ehcache:3.4.0' - documentation "org.codehaus.groovy:groovy-all:2.4.10" + documentation "org.codehaus.groovy:groovy-all" } @@ -66,17 +65,21 @@ bootRun { jvmArgs('-Dspring.output.ansi.enabled=always') } // enable if you wish to package this plugin as a standalone application -bootRepackage.enabled = false - -grailsPublish { - userOrg = "grails" - githubSlug = 'grails-plugins/grails-cache-ehcache' - license { - name = 'Apache-2.0' +bootJar.enabled = false + +publishing { + publications { + maven(MavenPublication) { +// userOrg = "grails" +// githubSlug = 'grails-plugins/grails-cache-ehcache' +// license { +// name = 'Apache-2.0' +// } +// title = "Grails Cache Ehcache Plugin" +// desc = "Provides an ehcache implementation of the cache plugin" +// developers = [jameskleeh: "James Kleeh"] + } } - title = "Grails Cache Ehcache Plugin" - desc = "Provides an ehcache implementation of the cache plugin" - developers = [jameskleeh: "James Kleeh"] } asciidoctor { diff --git a/gradle.properties b/gradle.properties index 5c10269..edf26a7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ -grailsVersion=3.2.8 -gradleWrapperVersion=3.0 +grailsVersion=5.3.5 +grailsGradlePluginVersion=5.3.0 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 86185e7..479c3a8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip From 99c696aba336c8721681a6c0373c8e86559d7f3b Mon Sep 17 00:00:00 2001 From: eusorov Date: Sat, 27 Jan 2024 12:06:01 +0100 Subject: [PATCH 2/8] fix "Cannot return 'Set' from method returning 'Collection'" --- .../grails/plugin/cache/ehcache/GrailsEhcacheCache.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/groovy/grails/plugin/cache/ehcache/GrailsEhcacheCache.groovy b/src/main/groovy/grails/plugin/cache/ehcache/GrailsEhcacheCache.groovy index f3df9de..91f33fe 100644 --- a/src/main/groovy/grails/plugin/cache/ehcache/GrailsEhcacheCache.groovy +++ b/src/main/groovy/grails/plugin/cache/ehcache/GrailsEhcacheCache.groovy @@ -89,7 +89,7 @@ class GrailsEhcacheCache implements GrailsCache { } @SuppressWarnings("unchecked") - Collection getAllKeys() { + Collection getAllKeys() { Set keys = [] getNativeCache().each { keys.add(it.key) From 6725d3f26641988548617f24eeb91a67d7420654 Mon Sep 17 00:00:00 2001 From: eusorov Date: Sat, 27 Jan 2024 12:06:31 +0100 Subject: [PATCH 3/8] replace logback with xml. --- grails-app/conf/logback.groovy | 28 ---------------------------- grails-app/conf/logback.xml | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 28 deletions(-) delete mode 100644 grails-app/conf/logback.groovy create mode 100644 grails-app/conf/logback.xml diff --git a/grails-app/conf/logback.groovy b/grails-app/conf/logback.groovy deleted file mode 100644 index 5b2d1e3..0000000 --- a/grails-app/conf/logback.groovy +++ /dev/null @@ -1,28 +0,0 @@ -import grails.util.BuildSettings -import grails.util.Environment - - -// See http://logback.qos.ch/manual/groovy.html for details on configuration -appender('STDOUT', ConsoleAppender) { - encoder(PatternLayoutEncoder) { - pattern = "%level %logger - %msg%n" - } -} - -root(ERROR, ['STDOUT']) - -if(Environment.current == Environment.DEVELOPMENT) { - def targetDir = BuildSettings.TARGET_DIR - if(targetDir) { - - appender("FULL_STACKTRACE", FileAppender) { - - file = "${targetDir}/stacktrace.log" - append = true - encoder(PatternLayoutEncoder) { - pattern = "%level %logger - %msg%n" - } - } - logger("StackTrace", ERROR, ['FULL_STACKTRACE'], false ) - } -} diff --git a/grails-app/conf/logback.xml b/grails-app/conf/logback.xml new file mode 100644 index 0000000..3128faa --- /dev/null +++ b/grails-app/conf/logback.xml @@ -0,0 +1,17 @@ + + + + + + + + + UTF-8 + %clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex + + + + + + + From 990d0228a0377ba6642d4a503cb77cfe9dc2518b Mon Sep 17 00:00:00 2001 From: eusorov Date: Sat, 27 Jan 2024 12:08:24 +0100 Subject: [PATCH 4/8] use maven publishing plugin, remove not supported grails-plugin-publish --- build.gradle | 50 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/build.gradle b/build.gradle index 9daeb80..e586845 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,6 @@ buildscript { } dependencies { classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" - classpath "io.github.gradle-nexus:publish-plugin:1.0.0" } } @@ -13,8 +12,8 @@ plugins { id 'org.asciidoctor.convert' version '1.5.3' } -//version "3.0.1" -version "4.0.1.BUILD-SNAPSHOT" +//version "4.0.0" +version "4.0.0.BUILD-SNAPSHOT" group "org.grails.plugins" apply plugin: "eclipse" @@ -70,14 +69,36 @@ bootJar.enabled = false publishing { publications { maven(MavenPublication) { -// userOrg = "grails" -// githubSlug = 'grails-plugins/grails-cache-ehcache' -// license { -// name = 'Apache-2.0' -// } -// title = "Grails Cache Ehcache Plugin" -// desc = "Provides an ehcache implementation of the cache plugin" -// developers = [jameskleeh: "James Kleeh"] + groupId = project.group + artifactId = 'grails-cache-ehcache' + version = project.version + + from components.java + artifact sourcesJar + artifact javadocJar + + pom { + name = 'Grails Cache Ehcache Plugin' + description = 'Provides an ehcache implementation of the cache plugin' + url = 'https://github.com/grails-plugins/grails-cache-ehcache' + licenses { + license { + name = 'The Apache License, Version 2.0' + url = 'https://www.apache.org/licenses/LICENSE-2.0.txt' + } + } + developers { + developer { + id = 'jameskleeh' + name = "James Kleeh" + } + } + scm { + connection = 'scm:git:git://github.com/grails-plugins/grails-cache-ehcache:git' + developerConnection = 'scm:git:ssh://github.com:grails-plugins/grails-cache-ehcache:git' + url = 'https://github.com/grails-plugins/grails-cache-ehcache' + } + } } } } @@ -113,3 +134,10 @@ task docs(type:Copy, dependsOn:[apidocs, asciidoctor]) { from "$buildDir/asciidoc/html5" into "$buildDir/docs" } + +tasks.withType(Test) { + testLogging { + events "passed", "skipped", "failed" + exceptionFormat 'full' + } +} From 99d261e89ebe59573771a84cdcc3e57b0519cf89 Mon Sep 17 00:00:00 2001 From: eusorov Date: Sat, 27 Jan 2024 12:14:28 +0100 Subject: [PATCH 5/8] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index de821df..72e1cb4 100644 --- a/README.md +++ b/README.md @@ -15,4 +15,4 @@ See https://grails.org/plugin/cache-ehcache and [Documentation](http://grails-pl ## Branches -The current master branch is for 3.x versions of the plugin compatible with Grails 3. There is a 1.x branch for on-going maintenance of 1.x versions of the plugin compatible with Grails 2. Please submit any pull requests to the appropriate branch. Changes to the 1.x branch will be merged into the master branch if appropriate. +The current master branch is for 4.x versions of the plugin compatible with Grails 5. There is a 1.x branch for on-going maintenance of 1.x versions of the plugin compatible with Grails 2. Please submit any pull requests to the appropriate branch. Changes to the 1.x branch will be merged into the master branch if appropriate. From 5c90f7bd0fe3a1414bf6a7893afb4da37cebf6ec Mon Sep 17 00:00:00 2001 From: eusorov Date: Sat, 27 Jan 2024 12:17:24 +0100 Subject: [PATCH 6/8] update grails 6.1 and use with java 11 --- .travis.yml | 2 +- gradle.properties | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8df2e5f..33057b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ sudo: false language: groovy jdk: -- openjdk8 +- openjdk11 before_script: - rm -rf target script: "./travis-build.sh" diff --git a/gradle.properties b/gradle.properties index edf26a7..6291591 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ -grailsVersion=5.3.5 -grailsGradlePluginVersion=5.3.0 +grailsVersion=6.1.0 +grailsGradlePluginVersion=6.1.0 From 26034647b55c72fed80bb24724501879da908353 Mon Sep 17 00:00:00 2001 From: eusorov Date: Sat, 27 Jan 2024 13:16:58 +0100 Subject: [PATCH 7/8] use xorg.grails.internal.grails-plugin-publish --- build.gradle | 44 +++++++++----------------------------------- 1 file changed, 9 insertions(+), 35 deletions(-) diff --git a/build.gradle b/build.gradle index e586845..9767b17 100644 --- a/build.gradle +++ b/build.gradle @@ -20,7 +20,7 @@ apply plugin: "eclipse" apply plugin: "idea" apply plugin: "org.grails.grails-plugin" apply plugin: "maven-publish" -apply plugin: "io.github.gradle-nexus.publish-plugin" +apply plugin:"org.grails.internal.grails-plugin-publish" repositories { mavenLocal() @@ -66,41 +66,15 @@ bootRun { // enable if you wish to package this plugin as a standalone application bootJar.enabled = false -publishing { - publications { - maven(MavenPublication) { - groupId = project.group - artifactId = 'grails-cache-ehcache' - version = project.version - - from components.java - artifact sourcesJar - artifact javadocJar - - pom { - name = 'Grails Cache Ehcache Plugin' - description = 'Provides an ehcache implementation of the cache plugin' - url = 'https://github.com/grails-plugins/grails-cache-ehcache' - licenses { - license { - name = 'The Apache License, Version 2.0' - url = 'https://www.apache.org/licenses/LICENSE-2.0.txt' - } - } - developers { - developer { - id = 'jameskleeh' - name = "James Kleeh" - } - } - scm { - connection = 'scm:git:git://github.com/grails-plugins/grails-cache-ehcache:git' - developerConnection = 'scm:git:ssh://github.com:grails-plugins/grails-cache-ehcache:git' - url = 'https://github.com/grails-plugins/grails-cache-ehcache' - } - } - } +grailsPublish { + userOrg = "grails" + githubSlug = 'grails-plugins/grails-cache-ehcache' + license { + name = 'Apache-2.0' } + title = "Grails Cache Ehcache Plugin" + desc = "Provides an ehcache implementation of the cache plugin" + developers = [jameskleeh: "James Kleeh"] } asciidoctor { From 172b7ef692943acb9fa8bb1a041db4567786f8cf Mon Sep 17 00:00:00 2001 From: eusorov Date: Sat, 27 Jan 2024 13:17:30 +0100 Subject: [PATCH 8/8] set logback to info --- grails-app/conf/logback.xml | 2 +- .../grails/plugin/cache/ehcache/CacheEhcacheGrailsPlugin.groovy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/grails-app/conf/logback.xml b/grails-app/conf/logback.xml index 3128faa..98465ce 100644 --- a/grails-app/conf/logback.xml +++ b/grails-app/conf/logback.xml @@ -11,7 +11,7 @@ - + diff --git a/src/main/groovy/grails/plugin/cache/ehcache/CacheEhcacheGrailsPlugin.groovy b/src/main/groovy/grails/plugin/cache/ehcache/CacheEhcacheGrailsPlugin.groovy index b500560..e958f26 100644 --- a/src/main/groovy/grails/plugin/cache/ehcache/CacheEhcacheGrailsPlugin.groovy +++ b/src/main/groovy/grails/plugin/cache/ehcache/CacheEhcacheGrailsPlugin.groovy @@ -7,7 +7,7 @@ import grails.plugins.Plugin class CacheEhcacheGrailsPlugin extends Plugin { // the version or versions of Grails the plugin is designed for - def grailsVersion = "3.0.0 > *" + def grailsVersion = "5.0.0 > *" def title = "Cache Ehcache" // Headline display name of the plugin