From e83d867f8d8bd7ef530a33bbcb61059fe3f79c7a Mon Sep 17 00:00:00 2001 From: Remko Popma Date: Sun, 27 Aug 2023 06:19:07 +0900 Subject: [PATCH] [BUILD][DOC] (picocli-spring-boot-starter) stay up-to-date with recent Spring 3 versions --- dependencies.gradle | 57 +++++++++++------------- picocli-spring-boot-starter/README.md | 2 +- picocli-spring-boot-starter/build.gradle | 20 +++++++-- 3 files changed, 45 insertions(+), 34 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index c5c5ff49b..5fb826a90 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,12 +1,6 @@ // This file works around dependabot issue https://github.com/dependabot/dependabot-core/issues/1618 // See https://www.sameerkulkarni.de/posts/dependabot-with-gradle/ -// Spring Boot 3.0 requires Java 17 as a minimum version -boolean useSpring3 = JavaVersion.current().majorVersion.compareTo("17") >= 0; -logger.quiet("dependencies.gradle: JavaVersion=${JavaVersion.current()}") -logger.quiet("dependencies.gradle: JavaVersion.majorVersion=${JavaVersion.current().majorVersion}") -logger.quiet("dependencies.gradle: useSpring3=${useSpring3}") - ext { // PICOCLI VERSION @@ -31,35 +25,38 @@ ext { junitDepVersion = "4.11" junitVersion = "4.13.2" log4j2Version = "2.20.0" - springBootVersion = useSpring3 ? "3.1.2" : "2.7.11" // Spring Boot 3.0 requires Java 17 as a minimum version + springBootVersion = "3.1.2" // Spring Boot 3.0 requires Java 17 as a minimum version systemRulesVersion = "1.19.0" systemLambdaVersion = '1.2.1' junit5Version = '5.9.3' supportDependencies = [ - junit : "junit:junit:$junitVersion", - junit5Api : "org.junit.jupiter:junit-jupiter-api:$junit5Version", - junit5Engine : "org.junit.jupiter:junit-jupiter-engine:$junit5Version", - systemLambda : "com.github.stefanbirkner:system-lambda:$systemLambdaVersion", - hamcrestCore : "org.hamcrest:hamcrest-core:$hamcrestCoreVersion", - jansi : "org.fusesource.jansi:jansi:$jansiVersion", - groovy : "org.codehaus.groovy:groovy-all:$groovyVersion", - systemRules : "com.github.stefanbirkner:system-rules:$systemRulesVersion", - junitParams : "pl.pragmatists:JUnitParams:1.1.1", - springbootstarter : "org.springframework.boot:spring-boot-starter:$springBootVersion", - springbootannproc : "org.springframework.boot:spring-boot-configuration-processor:$springBootVersion", - springboottest : "org.springframework.boot:spring-boot-starter-test:$springBootVersion", - jline3 : "org.jline:jline:$jline3Version", - jline2 : "jline:jline:$jline2Version", - ivy : "org.apache.ivy:ivy:$ivyVersion", - compileTesting : "com.google.testing.compile:compile-testing:$compileTestingVersion", - log4j2api : "org.apache.logging.log4j:log4j-api:$log4j2Version", - log4j2core : "org.apache.logging.log4j:log4j-core:$log4j2Version", - kotlin_stdlib : "org.jetbrains.kotlin:kotlin-stdlib", - scala_lang : "org.scala-lang:scala-library:2.13.10", - validation_api : "jakarta.validation:jakarta.validation-api:3.0.2", - //el_api : "jakarta.el:jakarta.el-api:3.0.3", - el_impl : "org.glassfish:jakarta.el:4.0.2", + junit : "junit:junit:$junitVersion", + junit5Api : "org.junit.jupiter:junit-jupiter-api:$junit5Version", + junit5Engine : "org.junit.jupiter:junit-jupiter-engine:$junit5Version", + systemLambda : "com.github.stefanbirkner:system-lambda:$systemLambdaVersion", + hamcrestCore : "org.hamcrest:hamcrest-core:$hamcrestCoreVersion", + jansi : "org.fusesource.jansi:jansi:$jansiVersion", + groovy : "org.codehaus.groovy:groovy-all:$groovyVersion", + systemRules : "com.github.stefanbirkner:system-rules:$systemRulesVersion", + junitParams : "pl.pragmatists:JUnitParams:1.1.1", + springbootstarter : "org.springframework.boot:spring-boot-starter:$springBootVersion", + springbootannproc : "org.springframework.boot:spring-boot-configuration-processor:$springBootVersion", + springboottest : "org.springframework.boot:spring-boot-starter-test:$springBootVersion", + springbootstarterOld : "org.springframework.boot:spring-boot-starter:2.7.11", + springbootannprocOld : "org.springframework.boot:spring-boot-configuration-processor:2.7.11", + springboottestOld : "org.springframework.boot:spring-boot-starter-test:2.7.11", + jline3 : "org.jline:jline:$jline3Version", + jline2 : "jline:jline:$jline2Version", + ivy : "org.apache.ivy:ivy:$ivyVersion", + compileTesting : "com.google.testing.compile:compile-testing:$compileTestingVersion", + log4j2api : "org.apache.logging.log4j:log4j-api:$log4j2Version", + log4j2core : "org.apache.logging.log4j:log4j-core:$log4j2Version", + kotlin_stdlib : "org.jetbrains.kotlin:kotlin-stdlib", + scala_lang : "org.scala-lang:scala-library:2.13.10", + validation_api : "jakarta.validation:jakarta.validation-api:3.0.2", + //el_api : "jakarta.el:jakarta.el-api:3.0.3", + el_impl : "org.glassfish:jakarta.el:4.0.2", hibernate_validator_annproc: "org.hibernate.validator:hibernate-validator-annotation-processor:8.0.0.Final", hibernate_validator : "org.hibernate.validator:hibernate-validator:8.0.0.Final", diff --git a/picocli-spring-boot-starter/README.md b/picocli-spring-boot-starter/README.md index 795c8dbc7..5057bcbc8 100644 --- a/picocli-spring-boot-starter/README.md +++ b/picocli-spring-boot-starter/README.md @@ -13,7 +13,7 @@ command line applications with Spring and picocli. ## Dependency Management -Picocli 4.7.4 has been tested with Spring Boot 2.5, 2.6 and 2.7 up to 2.7.5. +Picocli 4.7.4 has been tested with Spring Boot 2.5, 2.6, 2.7, and 3.1 up to 3.1.2. Add the following dependency: diff --git a/picocli-spring-boot-starter/build.gradle b/picocli-spring-boot-starter/build.gradle index 3b57d79f0..fd1a2f09a 100644 --- a/picocli-spring-boot-starter/build.gradle +++ b/picocli-spring-boot-starter/build.gradle @@ -22,9 +22,23 @@ if (useJava17) { dependencies { api rootProject - api supportDependencies.springbootstarter - annotationProcessor supportDependencies.springbootannproc - testImplementation supportDependencies.springboottest + if (useJava17) { + api supportDependencies.springbootstarter + annotationProcessor supportDependencies.springbootannproc + testImplementation supportDependencies.springboottest + + logger.quiet("picocli-spring-boot-starter/build.gradle: api ${supportDependencies.springbootstarter}") + logger.quiet("picocli-spring-boot-starter/build.gradle: annotationProcessor ${supportDependencies.springbootannproc}") + logger.quiet("picocli-spring-boot-starter/build.gradle: testImplementation ${supportDependencies.springboottest}") + } else { + api supportDependencies.springbootstarterOld + annotationProcessor supportDependencies.springbootannprocOld + testImplementation supportDependencies.springboottestOld + + logger.quiet("picocli-spring-boot-starter/build.gradle: api ${supportDependencies.springbootstarterOld}") + logger.quiet("picocli-spring-boot-starter/build.gradle: annotationProcessor ${supportDependencies.springbootannprocOld}") + logger.quiet("picocli-spring-boot-starter/build.gradle: testImplementation ${supportDependencies.springboottestOld}") + } } jar {