Skip to content

Commit

Permalink
feat(deps): major spring upgrade
Browse files Browse the repository at this point in the history
notable dependency upgrades:
* jhipsterDependenciesVersion=8.0.0-beta.2
* springBootVersion=3.1.1
* openapiPluginVersion=7.0.0-beta
  • Loading branch information
bbortt committed Jul 27, 2023
1 parent f87768a commit f8a43bc
Show file tree
Hide file tree
Showing 138 changed files with 1,748 additions and 1,278 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
distribution: 'temurin'
java-version: ${{ matrix.java-version }}
- name: Backend Tests
run: ./gradlew -DsourceCompatibility=${{ matrix.java-version }} test integrationTest -x webapp -x webapp_test
run: ./gradlew -DjavaVersion=${{ matrix.java-version }} test integrationTest -x webapp -x webapp_test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
######################
# Node
######################
.npm/
/node/
node_tmp/
node_modules/
Expand Down
173 changes: 86 additions & 87 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
plugins {
id "com.diffplug.spotless"
id "com.github.andygoossens.gradle-modernizer-plugin"
id "com.github.node-gradle.node"
id "com.google.cloud.tools.jib"
Expand All @@ -22,12 +23,13 @@ version = "${version}"

description = "Event planning tool."

sourceCompatibility = "${sourceCompatibility}"
sourceCompatibility = "${javaVersion}"
targetCompatibility = "${javaVersion}"
assert System.properties["java.specification.version"] == "17" || "18" || "19"


wrapper {
gradleVersion = "7.4.2"
gradleVersion = "8.2.1"
}

repositories {
Expand Down Expand Up @@ -55,6 +57,16 @@ springBoot {
}


gitProperties {
failOnNoGitDirectory = false
keys = ["git.branch", "git.commit.id.abbrev", "git.commit.id.describe"]
}

tasks.withType(com.gorylenko.GenerateGitPropertiesTask).configureEach {
outputs.doNotCacheIf("Task is always executed") { true }
}


dependencies {
// import JHipster dependencies BOM
if (!project.hasProperty("gae")) {
Expand All @@ -63,26 +75,22 @@ dependencies {

// Use ", version: jhipsterDependenciesVersion, changing: true" if you want
// to use a SNAPSHOT release instead of a stable release
implementation group: "tech.jhipster", name: "jhipster-framework"
implementation "javax.annotation:javax.annotation-api"
implementation "org.springframework.boot:spring-boot-starter-cache"
implementation "tech.jhipster:jhipster-framework"
implementation "jakarta.annotation:jakarta.annotation-api"
implementation "com.fasterxml.jackson.module:jackson-module-jaxb-annotations"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-hibernate5"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-hibernate6"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-hppc"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
implementation "org.redisson:redisson"
testImplementation "org.testcontainers:junit-jupiter"
testImplementation "org.testcontainers:testcontainers"
implementation "org.springdoc:springdoc-openapi-webmvc-core"
implementation "org.springdoc:springdoc-openapi-starter-webmvc-api"
implementation "com.zaxxer:HikariCP"
implementation "org.apache.commons:commons-lang3"
implementation "org.openapitools:jackson-databind-nullable:${jacksonDatabindNullableVersion}"
implementation "com.github.ben-manes.caffeine:caffeine:${caffeineVersion}"
annotationProcessor "org.hibernate:hibernate-jpamodelgen:${hibernateVersion}"
implementation "org.hibernate:hibernate-core"
implementation "com.github.ben-manes.caffeine:caffeine"
annotationProcessor "org.hibernate.orm:hibernate-jpamodelgen:${hibernateVersion}"
implementation "org.hibernate.orm:hibernate-core"
implementation "org.hibernate.validator:hibernate-validator"
implementation "org.liquibase:liquibase-core"
liquibaseRuntime "org.liquibase:liquibase-core"
implementation "org.mapstruct:mapstruct:${mapstructVersion}"
annotationProcessor "org.mapstruct:mapstruct-processor:${mapstructVersion}"
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor:${springBootVersion}"
Expand All @@ -97,9 +105,12 @@ dependencies {
testImplementation "org.springframework.boot:spring-boot-starter-test"
testImplementation "org.springframework.boot:spring-boot-test"
testImplementation "org.springframework.security:spring-security-test"
testImplementation "com.tngtech.archunit:archunit-junit5-api:${archunitJunit5Version}"
testRuntimeOnly "com.tngtech.archunit:archunit-junit5-engine:${archunitJunit5Version}"
implementation "org.zalando:problem-spring-web"
testImplementation("com.tngtech.archunit:archunit-junit5-api:${archunitJunit5Version}") {
exclude group: "org.slf4j", module: "slf4j-api"
}
testRuntimeOnly("com.tngtech.archunit:archunit-junit5-engine:${archunitJunit5Version}") {
exclude group: "org.slf4j", module: "slf4j-api"
}
implementation "org.springframework.boot:spring-boot-starter-undertow"
implementation "org.springframework.boot:spring-boot-starter-websocket"
implementation "org.springframework.boot:spring-boot-starter-oauth2-client"
Expand All @@ -108,9 +119,7 @@ dependencies {
implementation "io.micrometer:micrometer-registry-prometheus"
implementation "io.dropwizard.metrics:metrics-core"
implementation "org.springframework.security:spring-security-messaging"
liquibaseRuntime sourceSets.main.compileClasspath
liquibaseRuntime "org.liquibase.ext:liquibase-hibernate5:${liquibaseHibernate5Version}"
//jhipster-needle-gradle-dependency - JHipster will add additional dependencies here
// jhipster-needle-gradle-dependency - JHipster will add additional dependencies here
}

compileJava.dependsOn processResources
Expand All @@ -119,14 +128,6 @@ processResources.dependsOn bootBuildInfo
configurations {
providedRuntime
implementation.exclude module: "spring-boot-starter-tomcat"
all {
resolutionStrategy {
// Inherited version from Spring Boot can't be used because of regressions:
// To be removed as soon as spring-boot use the same version
force "org.liquibase:liquibase-core:4.23.0"
force "org.yaml:snakeyaml:1.33"
}
}
}


Expand Down Expand Up @@ -160,26 +161,17 @@ nohttp {
source.include "build.gradle", "README.md"
}


if (!project.hasProperty("runList")) {
project.ext.runList = "main"
spotless {
java {
target 'src/*/java/**/*.java'
removeUnusedImports()
}
}


if (project.hasProperty("gae")) {
apply plugin: "maven"
apply plugin: "org.springframework.boot.experimental.thin-launcher"
apply plugin: "io.spring.dependency-management"

dependencyManagement {
imports {
mavenBom "tech.jhipster:jhipster-dependencies:${jhipsterDependenciesVersion}"
}
}
appengineStage.dependsOn thinResolve

task createPom {
def basePath = "build/resources/main/META-INF/maven"
def basePath = 'build/resources/main/META-INF/maven'
doLast {
pom {
withXml(dependencyManagement.pomConfigurer)
Expand All @@ -202,11 +194,12 @@ task openApiGenerateBackend(type: org.openapitools.generator.gradle.plugin.tasks
configOptions = [
delegatePattern: "true",
useOptional : "true",
useSpringBoot3 : "true",
useTags : "true",
title : "eventplanner"
]
validateSpec = true
importMappings = [Problem: "org.zalando.problem.Problem"]
importMappings = [Problem:"org.springframework.http.ProblemDetail"]
}

task openApiGenerateFrontend(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask) {
Expand Down Expand Up @@ -246,7 +239,7 @@ test {
// uncomment if the tests reports are not generated
// see https://github.com/jhipster/generator-jhipster/pull/2771 and https://github.com/jhipster/generator-jhipster/pull/4484
// ignoreFailures true
reports.html.enabled = false
reports.html.required = false
}

task testReport(type: TestReport) {
Expand All @@ -272,59 +265,65 @@ task cleanResources(type: Delete) {
delete "build/resources"
}

task webapp_test(type: NpmTask, dependsOn: "npm_install") {
task webapp_test(type: NpmTask) {
inputs.property('appVersion', project.version)
inputs.files("package-lock.json")
.withPropertyName('package-lock')
.withPathSensitivity(PathSensitivity.RELATIVE)
inputs.files("build.gradle")
.withPropertyName('build.gradle')
.withPathSensitivity(PathSensitivity.RELATIVE)
inputs.files("angular.json")
.withPropertyName('angular.json')
.withPathSensitivity(PathSensitivity.RELATIVE)
inputs.files("tsconfig.json", "tsconfig.app.json")
.withPropertyName("tsconfig")
.withPathSensitivity(PathSensitivity.RELATIVE)
inputs.dir("webpack/")
.withPropertyName("webpack/")
.withPathSensitivity(PathSensitivity.RELATIVE)
inputs.dir("src/main/webapp/")
.withPropertyName("webapp-source-dir")
.withPathSensitivity(PathSensitivity.RELATIVE)

outputs.dir("build/test-results/jest/")
.withPropertyName("jest-result-dir")
outputs.file("build/test-results/TESTS-results-jest.xml")
.withPropertyName("jest-result")
outputs.file("build/test-results/clover.xml")
.withPropertyName("clover-result")

dependsOn npmInstall,compileTestJava
args = ["run", "webapp:test"]
}


// Copy local node and npm to a fixed location for npmw
def fixedNode = tasks.register("fixedNode", Copy) {
from nodeSetup
into "build/node"
}
tasks.named("nodeSetup").configure { finalizedBy fixedNode }

def fixedNpm = tasks.register("fixedNpm", Copy) {
from npmSetup
into "build/node"
}
tasks.named("npmSetup").configure { finalizedBy fixedNpm }

test.dependsOn webapp_test


project.ext.diffChangelogFile = "src/main/resources/config/liquibase/changelog/" + new Date().format("yyyyMMddHHmmss") + "_changelog.xml"
if (project.hasProperty("nodeInstall")) {
node {
version = "18.16.1"
npmVersion = "9.8.0"
download = true
}

liquibase {
activities {
main {
driver "org.postgresql.Driver"
url "jdbc:postgresql://localhost:5432/eventplanner"
username "eventplanner"
password ""
changeLogFile "src/main/resources/config/liquibase/master.xml"
defaultSchemaName ""
logLevel "debug"
classpath "src/main/resources/"
}
diffLog {
driver "org.postgresql.Driver"
url "jdbc:postgresql://localhost:5432/eventplanner"
username "eventplanner"
password ""
changeLogFile project.ext.diffChangelogFile
referenceUrl "hibernate:spring:io.github.bbortt.event.planner.domain?dialect=tech.jhipster.domain.util.FixedPostgreSQL10Dialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy"
defaultSchemaName ""
logLevel "debug"
classpath "$buildDir/classes/java/main"
excludeObjects "oauth_access_token, oauth_approvals, oauth_client_details, oauth_client_token, oauth_code, oauth_refresh_token"
}
// Copy local node and npm to a fixed location for npmw
def fixedNode = tasks.register("fixedNode", Copy) {
from nodeSetup
into 'build/node'
}
tasks.named("nodeSetup").configure { finalizedBy fixedNode }

runList = project.ext.runList
def fixedNpm = tasks.register("fixedNpm", Copy) {
from npmSetup
into 'build/node'
}
tasks.named("npmSetup").configure { finalizedBy fixedNpm }
}

test.dependsOn webapp_test


apply from: "gradle/cache.gradle"
apply from: "gradle/docker.gradle"
apply from: "gradle/liquibase.gradle"
apply from: "gradle/sonar.gradle"
//jhipster-needle-gradle-apply-from - JHipster will add additional gradle scripts to be applied here
44 changes: 23 additions & 21 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,39 @@
rootProject.name=event-planner

# Build information
javaVersion=17
profile=dev
sourceCompatibility=17
version=0.1.0

# Dependency versions
jhipsterDependenciesVersion=7.9.3
jhipsterDependenciesVersion=8.0.0-beta.2
# The spring-boot version should match the one managed by
# https://mvnrepository.com/artifact/tech.jhipster/jhipster-dependencies/7.9.3
springBootVersion=2.7.10
# https://mvnrepository.com/artifact/tech.jhipster/jhipster-dependencies/8.0.0-beta.2
springBootVersion=3.1.1
# The hibernate version should match the one managed by
# https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/2.7.3 -->
hibernateVersion=5.6.10.Final
mapstructVersion=1.5.2.Final
archunitJunit5Version=0.22.0
jacksonDatabindNullableVersion=0.2.3
caffeineVersion=3.1.1
liquibaseHibernate5Version=4.15.0
liquibaseTaskPrefix=liquibase
# https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/3.1.1 -->
hibernateVersion=6.1.7.Final
mapstructVersion=1.5.5.Final
archunitJunit5Version=1.0.1
jacksonDatabindNullableVersion=0.2.6

jaxbRuntimeVersion=4.0.0
jaxbRuntimeVersion=4.0.3

# gradle plugin version
jibPluginVersion=3.2.1
jibPluginVersion=3.3.2
gitPropertiesPluginVersion=2.4.1
gradleNodePluginVersion=3.4.0
liquibasePluginVersion=2.1.1
sonarqubePluginVersion=3.4.0.2513
openapiPluginVersion=6.0.1
noHttpCheckstyleVersion=0.0.10
checkstyleVersion=10.3.2
modernizerPluginVersion=1.6.2
gradleNodePluginVersion=5.0.0
sonarqubePluginVersion=4.2.1.3168
spotlessPluginVersion=6.19.0
openapiPluginVersion=7.0.0-beta
noHttpCheckstyleVersion=0.0.11
checkstyleVersion=10.12.1
modernizerPluginVersion=1.8.0

liquibaseTaskPrefix=liquibase
liquibasePluginVersion=2.2.0
liquibaseVersion=4.20.0
liquibaseHibernate6Version=4.20.0

# jhipster-needle-gradle-property - JHipster will add additional properties here

Expand Down
7 changes: 7 additions & 0 deletions gradle/cache.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dependencies {
implementation "org.springframework.boot:spring-boot-starter-cache"
implementation "org.redisson:redisson"
implementation "org.hibernate.orm:hibernate-jcache"
testImplementation "org.testcontainers:junit-jupiter"
testImplementation "org.testcontainers:testcontainers"
}
Loading

0 comments on commit f8a43bc

Please sign in to comment.