diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 1310803..5c19ae9 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -2,18 +2,18 @@ name: Java CI on: push: branches: - - 2.0.x + - '[1-9]+.[0-9]+.x' - master pull_request: branches: - - 2.0.x + - '[1-9]+.[0-9]+.x' - master jobs: build: runs-on: ubuntu-latest strategy: matrix: - java: ['8'] + java: ['11'] env: WORKSPACE: ${{ github.workspace }} GRADLE_OPTS: -Xmx1500m -Dfile.encoding=UTF-8 @@ -30,10 +30,10 @@ jobs: with: java-version: ${{ matrix.java }} - name: Run Assemble - if: success() && github.event_name == 'push' && matrix.java == '8' + if: success() && github.event_name == 'push' && matrix.java == '11' run: ./gradlew assemble - name: Publish to repo.grails.org - if: success() && github.event_name == 'push' && matrix.java == '8' + if: success() && github.event_name == 'push' && matrix.java == '11' env: ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} diff --git a/.github/workflows/release-notes.yml b/.github/workflows/release-notes.yml index 5d4be3a..6b0fd5b 100644 --- a/.github/workflows/release-notes.yml +++ b/.github/workflows/release-notes.yml @@ -5,7 +5,7 @@ on: push: branches: - master - - 2.0.x + - '[1-9]+.[0-9]+.x' workflow_dispatch: jobs: release_notes: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5836388..2b7f543 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: ['8'] + java: ['11'] env: GIT_USER_NAME: puneetbehl GIT_USER_EMAIL: behlp@objectcomputing.com diff --git a/.travis.yml b/.travis.yml index dabc55a..747dbf7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ cache: directories: - $HOME/.gradle jdk: -- openjdk8 +- openjdk11 script: ./travis-build.sh env: global: diff --git a/gradle.properties b/gradle.properties index 3cb2681..9b5d114 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -projectVersion=3.1.0-SNAPSHOT +projectVersion=4.0.0-SNAPSHOT diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 622ab64..3994438 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle b/settings.gradle index e432a09..eac0444 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,4 +1,3 @@ include 'starter' include 'wrapper' - -project(":wrapper").name = "grails5_3_4-wrapper" +project(":wrapper").name = "grails6-wrapper" diff --git a/starter/build.gradle b/starter/build.gradle index 05450f7..12d8ed4 100644 --- a/starter/build.gradle +++ b/starter/build.gradle @@ -7,5 +7,5 @@ jar { } } -sourceCompatibility = 1.8 -targetCompatibility = 1.8 +sourceCompatibility = JavaVersion.VERSION_11 +targetCompatibility = JavaVersion.VERSION_11 diff --git a/starter/src/main/java/grails/init/Start.java b/starter/src/main/java/grails/init/Start.java index c9d5d71..d1cac59 100644 --- a/starter/src/main/java/grails/init/Start.java +++ b/starter/src/main/java/grails/init/Start.java @@ -21,7 +21,7 @@ public class Start { - private static final String PROJECT_NAME = "grails5_3_4-wrapper"; + private static final String PROJECT_NAME = "grails6-wrapper"; private static final String WRAPPER_PATH = "/org/grails/" + PROJECT_NAME; private static final String DEFAULT_GRAILS_CORE_ARTIFACTORY_BASE_URL = "https://repo.grails.org/grails/core"; private static final File WRAPPER_DIR = new File(System.getProperty("user.home") + "/.grails/wrapper"); diff --git a/wrapper/build.gradle b/wrapper/build.gradle index 421672d..3b5e573 100644 --- a/wrapper/build.gradle +++ b/wrapper/build.gradle @@ -14,9 +14,9 @@ buildscript { } } dependencies { - classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVerison" - classpath 'io.spring.gradle:dependency-management-plugin:1.0.11.RELEASE' - classpath "io.github.gradle-nexus:publish-plugin:1.1.0" + classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" + classpath 'io.spring.gradle:dependency-management-plugin:1.1.6' + classpath "io.github.gradle-nexus:publish-plugin:2.0.0" classpath "com.bmuschko:gradle-nexus-plugin:2.3.1" } } @@ -25,7 +25,7 @@ group 'org.grails' version project.projectVersion ext.pomInfo = { - delegate.name 'Grails 5 Wrapper' + delegate.name 'Grails 6 Wrapper' delegate.description 'The Grails Wrapper Project' delegate.url 'https://github.com/grails/grails-wrapper' @@ -74,10 +74,17 @@ ext { configurations { groovyDoc.extendsFrom runtimeClasspath + + all { + resolutionStrategy.dependencySubstitution { + //update fields plugin used by scaffolding + substitute(module("org.codehaus.plexus:plexus-sec-dispatcher:2.0")).with(module("org.sonatype.plexus:plexus-sec-dispatcher:1.4")) + } + } } -sourceCompatibility = 1.8 -targetCompatibility = 1.8 +sourceCompatibility = JavaVersion.VERSION_11 +targetCompatibility = JavaVersion.VERSION_11 repositories { mavenCentral() @@ -106,6 +113,8 @@ jar { manifest { attributes 'Main-Class': 'grails.init.RunCommand' } + + duplicatesStrategy = DuplicatesStrategy.INCLUDE } task sourcesJar(type: Jar) { diff --git a/wrapper/gradle.properties b/wrapper/gradle.properties index abfbc69..9a11c9e 100644 --- a/wrapper/gradle.properties +++ b/wrapper/gradle.properties @@ -1,5 +1,5 @@ -grailsVersion=5.0.0 -grailsGradlePluginVerison=5.0.0 -groovyVersion=3.0.5 -springBootVersion=2.5.0 -micronautInjectGroovyVersion=3.8.8 +grailsVersion=6.0.0 +grailsGradlePluginVersion=6.0.0 +groovyVersion=3.0.21 +springBootVersion=2.7.12 +micronautInjectGroovyVersion=3.10.4 diff --git a/wrapper/src/main/groovy/grails/init/RunCommand.groovy b/wrapper/src/main/groovy/grails/init/RunCommand.groovy index ac2c01f..8e9f88a 100644 --- a/wrapper/src/main/groovy/grails/init/RunCommand.groovy +++ b/wrapper/src/main/groovy/grails/init/RunCommand.groovy @@ -1,8 +1,9 @@ package grails.init -import org.springframework.boot.cli.compiler.grape.AetherGrapeEngine -import org.springframework.boot.cli.compiler.grape.AetherGrapeEngineFactory + import org.springframework.boot.cli.compiler.grape.DependencyResolutionContext +import org.springframework.boot.cli.compiler.grape.MavenResolverGrapeEngine +import org.springframework.boot.cli.compiler.grape.MavenResolverGrapeEngineFactory import org.springframework.boot.cli.compiler.grape.RepositoryConfiguration /** @@ -10,19 +11,27 @@ import org.springframework.boot.cli.compiler.grape.RepositoryConfiguration */ class RunCommand { + static final String DEFAULT_GRAILS_SHELL_VERSION = '6.1.2' + static void main(String[] args) { Properties props = new Properties() String grailsVersion + String grailsShellVersion String groovyVersion try { props.load(new FileInputStream("gradle.properties")) grailsVersion = props.getProperty("grailsVersion") + grailsShellVersion = props.getProperty("grailsShellVersion") groovyVersion = props.getProperty("groovyVersion") } catch (IOException e) { throw new RuntimeException("Could not determine grails version due to missing properties file") } + if(!grailsShellVersion) { + grailsShellVersion = DEFAULT_GRAILS_SHELL_VERSION + } + GroovyClassLoader groovyClassLoader = new GroovyClassLoader(RunCommand.classLoader) List repositoryConfigurations = [new RepositoryConfiguration("grailsCentral", new URI("https://repo.grails.org/grails/core"), true)] @@ -30,8 +39,14 @@ class RunCommand { repositoryConfigurations.add(new RepositoryConfiguration("JFrog OSS snapshot repo", new URI("https://oss.jfrog.org/oss-snapshot-local"), true)) } - AetherGrapeEngine grapeEngine = AetherGrapeEngineFactory.create(groovyClassLoader, repositoryConfigurations, new DependencyResolutionContext(), false) - grapeEngine.grab([:], [group: "org.grails", module: "grails-shell", version: grailsVersion]) + MavenResolverGrapeEngine grapeEngine = MavenResolverGrapeEngineFactory.create(groovyClassLoader, repositoryConfigurations, new DependencyResolutionContext(), false) + try { + grapeEngine.grab([:], [group: "org.grails", module: "grails-shell", version: grailsVersion]) + } + catch(dependencyResolutionException){ + // Try grails shell version from gradle.properties or default + grapeEngine.grab([:], [group: "org.grails", module: "grails-shell", version: grailsShellVersion]) + } ClassLoader previousClassLoader = Thread.currentThread().contextClassLoader Thread.currentThread().setContextClassLoader(groovyClassLoader)