From 77f66aba6326578de78355583461461a2d935d3a Mon Sep 17 00:00:00 2001 From: James Fredley Date: Fri, 25 Oct 2024 13:59:01 -0400 Subject: [PATCH] dependency cleanup with grails-bom (#384) --- .github/workflows/gradle.yml | 2 +- .github/workflows/release.yml | 2 +- build.gradle | 68 +++++------------------- gradle.properties | 17 +++--- gradle/wrapper/gradle-wrapper.properties | 2 +- 5 files changed, 24 insertions(+), 67 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 206ef789..eda6d137 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -23,7 +23,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v4 with: - distribution: 'adopt' + distribution: 'liberica' java-version: 17 - name: Run Tests if: github.event_name == 'pull_request' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f5c8040d..f0242188 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v4 with: - distribution: 'adopt' + distribution: 'liberica' java-version: 17 - name: Set the current release version id: release_version diff --git a/build.gradle b/build.gradle index 33979487..4e27f001 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ buildscript { } dependencies { classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" - classpath "org.asciidoctor:asciidoctor-gradle-jvm:4.0.3" + classpath "org.asciidoctor:asciidoctor-gradle-jvm:$asciidoctorJvmVersion" } } @@ -24,82 +24,42 @@ repositories { mavenCentral() } -dependencyManagement { - imports { - mavenBom "org.grails:grails-bom:$grailsVersion" - } - applyMavenExclusions false -} - configurations { documentation - - configureEach { - resolutionStrategy.eachDependency { DependencyResolveDetails details -> - if ((details.requested.group == 'org.codehaus.groovy' || details.requested.group == 'org.apache.groovy') && details.requested.name != 'groovy-bom') { - details.useTarget(group: 'org.apache.groovy', name: details.requested.name, version: "$groovyVersion") - details.because "The dependency coordinates are changed in Apache Groovy 4, plus ensure version" - } - - if (details.requested.group == "io.micronaut" && details.requested.name == "micronaut-inject-groovy") { - details.useVersion("4.6.1") - } - } - } } dependencies { - api "org.liquibase:liquibase-core:$liquibaseHibernate5Version" + implementation platform("org.grails:grails-bom:$grailsVersion") + api "org.liquibase:liquibase-core:$liquibaseHibernate5Version" api("org.liquibase.ext:liquibase-hibernate5:$liquibaseHibernate5Version") { exclude group: 'org.hibernate', module: 'hibernate-core' exclude group: 'org.hibernate', module: 'hibernate-entitymanager' exclude group: 'org.hibernate', module: 'hibernate-envers' - exclude group: 'org.liquibase', module: 'liquibase-core' - exclude group: 'org.liquibase', module: 'liquibase-test-harness' exclude group: 'com.h2database', module: 'h2' } - api "jakarta.annotation:jakarta.annotation-api:$jakartaAnnotationApiVersion" - api 'org.apache.commons:commons-lang3:3.17.0' - - compileOnly "org.hibernate:hibernate-core-jakarta:$hibernate5Version" + api "org.apache.commons:commons-lang3" compileOnly "org.springframework.boot:spring-boot-starter-logging" - compileOnly "org.springframework.boot:spring-boot-starter-actuator" compileOnly "org.springframework.boot:spring-boot-autoconfigure" - compileOnly "org.springframework.boot:spring-boot-starter-tomcat" - - compileOnly "org.grails:grails-web-boot" - compileOnly "org.grails:grails-dependencies" - compileOnly "jakarta.servlet:jakarta.servlet-api:$servletApiVersion" - compileOnly "org.grails.plugins:hibernate5:$gormVersion" - testImplementation "io.micronaut:micronaut-inject-groovy:$micronautVersion" - testImplementation "io.micronaut:micronaut-inject:$micronautVersion" - testImplementation "org.liquibase.ext:liquibase-hibernate5:$liquibaseHibernate5Version" - testImplementation "org.liquibase:liquibase-core:$liquibaseHibernate5Version" - + compileOnly "org.grails.plugins:hibernate5" + compileOnly "org.apache.groovy:groovy-sql" + compileOnly "org.apache.groovy:groovy-xml" testImplementation "org.springframework.boot:spring-boot-starter-tomcat" - testImplementation "org.hibernate:hibernate-core-jakarta:$hibernate5Version" - testImplementation "org.grails.plugins:hibernate5:$gormVersion" - + testImplementation "org.grails.plugins:hibernate5" testImplementation "org.grails:grails-gorm-testing-support" - testImplementation "org.mockito:mockito-core" testImplementation "org.grails:grails-web-testing-support" testImplementation "com.h2database:h2:$h2Version" - - documentation "org.apache.groovy:groovy:$groovyVersion" - documentation "org.apache.groovy:groovy-ant:$groovyVersion" - documentation "org.apache.groovy:groovy-templates:$groovyVersion" - documentation "com.github.javaparser:javaparser-core:$javaParserCoreVersion" - + documentation "org.apache.groovy:groovy" + documentation "org.apache.groovy:groovy-ant" + documentation "org.apache.groovy:groovy-templates" + documentation "com.github.javaparser:javaparser-core" } -java { - toolchain { - languageVersion = JavaLanguageVersion.of(17) - } +compileJava { + options.release = 17 } grailsPublish { diff --git a/gradle.properties b/gradle.properties index 78f97786..a2882c2b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,15 +1,12 @@ +projectVersion=6.0.0-SNAPSHOT + +asciidoctorJvmVersion=4.0.3 grailsVersion=7.0.0-SNAPSHOT grailsGradlePluginVersion=7.0.0-SNAPSHOT -groovyVersion=4.0.22 -liquibaseHibernate5Version=4.27.0 -projectVersion=6.0.0-SNAPSHOT -hibernate5Version=5.6.15.Final -servletApiVersion=6.0.0 +groovyVersion=4.0.23 +# Tests are built for this version h2Version=1.4.200 -jakartaAnnotationApiVersion=3.0.0 -micronautVersion=4.6.5 -gormVersion=9.0.0-SNAPSHOT -javaParserCoreVersion=3.26.2 +liquibaseHibernate5Version=4.27.0 websiteUrl=https://grails-plugins.github.io/grails-database-migration issueTrackerUrl=https://github.com/grails-plugins/grails-database-migration/issues @@ -17,4 +14,4 @@ vcsUrl=https://github.com/grails-plugins/grails-database-migration org.gradle.parallel=true org.gradle.caching=true -org.gradle.daemon=true +org.gradle.daemon=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9355b415..df97d72b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME