You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by ar...@apache.org on 2023/06/06 09:45:18 UTC

[fineract] 01/15: FINERACT-1724: Spring Boot upgrade to 3.x

This is an automated email from the ASF dual-hosted git repository.

arnold pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git

commit 84abf365c893e727fb96c67e01ae2fc107ef9527
Author: Arnold Galovics <ga...@gmail.com>
AuthorDate: Wed May 24 19:40:48 2023 +0200

    FINERACT-1724: Spring Boot upgrade to 3.x
---
 build.gradle                                             | 14 +++++++-------
 .../main/groovy/org.apache.fineract.dependencies.gradle  |  9 ++++++---
 .../infrastructure/core/jpa/CriteriaQueryFactory.java    |  2 +-
 fineract-doc/build.gradle                                |  2 +-
 fineract-investor/build.gradle                           |  4 ++--
 fineract-provider/build.gradle                           | 16 ++++++++--------
 fineract-war/build.gradle                                |  4 ++--
 gradle/wrapper/gradle-wrapper.properties                 |  2 +-
 8 files changed, 28 insertions(+), 25 deletions(-)

diff --git a/build.gradle b/build.gradle
index cf6a56916..68fad8e27 100644
--- a/build.gradle
+++ b/build.gradle
@@ -70,7 +70,7 @@ plugins {
     id 'com.github.jk1.dependency-license-report' version '2.1' apply false
     id 'org.openapi.generator' version '6.2.1' apply false
     id 'org.zeroturnaround.gradle.jrebel' version '1.1.12' apply false
-    id 'org.springframework.boot' version '2.7.10' apply false
+    id 'org.springframework.boot' version '3.1.0' apply false
     id 'net.ltgt.errorprone' version '3.0.1' apply false
     id 'io.swagger.core.v3.swagger-gradle-plugin' version '2.2.9' apply false
     id 'com.gorylenko.gradle-git-properties' version '2.4.1' apply false
@@ -95,7 +95,7 @@ description = '''\
 Run as:
 gradle clean bootRun'''
 
-ext['groovy.version'] = '3.0.10'
+ext['groovy.version'] = '4.0.6'
 ext['swaggerFile'] = "$rootDir/fineract-provider/build/classes/java/main/static/fineract.yaml".toString()
 
 allprojects  {
@@ -299,8 +299,8 @@ configure(project.fineractJavaProjects) {
     targetCompatibility = JavaVersion.VERSION_17
 
     /* http://stackoverflow.com/questions/19653311/jpa-repository-works-in-idea-and-production-but-not-in-gradle */
-    sourceSets.main.output.resourcesDir = sourceSets.main.java.outputDir
-    sourceSets.test.output.resourcesDir = sourceSets.test.java.outputDir
+    sourceSets.main.output.resourcesDir = sourceSets.main.java.classesDirectory
+    sourceSets.test.output.resourcesDir = sourceSets.test.java.classesDirectory
 
     configurations {
         implementation.setCanBeResolved(true)
@@ -412,13 +412,13 @@ configure(project.fineractJavaProjects) {
     // https://www.eclemma.org/jacoco/
     jacoco {
         toolVersion = jacocoVersion
-        reportsDir = file("$buildDir/reports/jacoco")
+        reportsDirectory = file("$buildDir/reports/jacoco")
     }
 
     jacocoTestReport {
         reports {
-            html.enabled=true
-            xml.enabled=true
+            html.required = true
+            xml.required = true
             html.destination file("${buildDir}/code-coverage")
         }
     }
diff --git a/buildSrc/src/main/groovy/org.apache.fineract.dependencies.gradle b/buildSrc/src/main/groovy/org.apache.fineract.dependencies.gradle
index 16db5c964..d304325f3 100644
--- a/buildSrc/src/main/groovy/org.apache.fineract.dependencies.gradle
+++ b/buildSrc/src/main/groovy/org.apache.fineract.dependencies.gradle
@@ -22,8 +22,8 @@ apply plugin: 'io.spring.dependency-management'
 // https://github.com/spring-gradle-plugins/dependency-management-plugin
 dependencyManagement {
     imports {
-        mavenBom 'org.springframework:spring-framework-bom:5.3.27'
-        mavenBom 'org.springframework.boot:spring-boot-dependencies:2.7.10'
+        mavenBom 'org.springframework:spring-framework-bom:6.0.9'
+        mavenBom 'org.springframework.boot:spring-boot-dependencies:3.1.0'
         mavenBom 'org.jetbrains.kotlin:kotlin-bom:1.8.20'
         mavenBom 'org.junit:junit-bom:5.9.2'
         mavenBom 'com.fasterxml.jackson:jackson-bom:2.14.2'
@@ -219,7 +219,7 @@ dependencyManagement {
             entry 'poi-ooxml-schemas'
         }
 
-        dependencySet(group: 'io.rest-assured', version: '4.5.1') {
+        dependencySet(group: 'io.rest-assured', version: '5.3.0') {
             entry 'rest-assured'
             entry 'json-path'
             entry 'xml-path'
@@ -242,5 +242,8 @@ dependencyManagement {
         dependency 'org.assertj:assertj-core:3.24.2'
 
         dependency 'org.apache.commons:commons-math3:3.6.1'
+
+        dependency 'org.mockito:mockito-inline:5.2.0'
+
     }
 }
diff --git a/fineract-core/src/main/java/org/apache/fineract/infrastructure/core/jpa/CriteriaQueryFactory.java b/fineract-core/src/main/java/org/apache/fineract/infrastructure/core/jpa/CriteriaQueryFactory.java
index f95680b74..be9d38ff7 100644
--- a/fineract-core/src/main/java/org/apache/fineract/infrastructure/core/jpa/CriteriaQueryFactory.java
+++ b/fineract-core/src/main/java/org/apache/fineract/infrastructure/core/jpa/CriteriaQueryFactory.java
@@ -18,11 +18,11 @@
  */
 package org.apache.fineract.infrastructure.core.jpa;
 
+import jakarta.persistence.EntityManager;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.function.Supplier;
-import javax.persistence.EntityManager;
 import javax.persistence.TypedQuery;
 import javax.persistence.criteria.CriteriaBuilder;
 import javax.persistence.criteria.CriteriaQuery;
diff --git a/fineract-doc/build.gradle b/fineract-doc/build.gradle
index ecbabc521..d9464d20b 100644
--- a/fineract-doc/build.gradle
+++ b/fineract-doc/build.gradle
@@ -117,5 +117,5 @@ task doc(type: Zip) {
             }
         }
     }
-    archiveName "${project.name}-${project.version}.zip"
+    archiveFileName = "${project.name}-${project.version}.zip"
 }
diff --git a/fineract-investor/build.gradle b/fineract-investor/build.gradle
index 61fbb5a44..7fa0aea2f 100644
--- a/fineract-investor/build.gradle
+++ b/fineract-investor/build.gradle
@@ -94,8 +94,8 @@ eclipse {
 }
 
 /* http://stackoverflow.com/questions/19653311/jpa-repository-works-in-idea-and-production-but-not-in-gradle */
-sourceSets.main.output.resourcesDir = sourceSets.main.java.outputDir
-sourceSets.test.output.resourcesDir = sourceSets.test.java.outputDir
+sourceSets.main.output.resourcesDir = sourceSets.main.java.classesDirectory
+sourceSets.test.output.resourcesDir = sourceSets.test.java.classesDirectory
 
 if (!(project.hasProperty('env') && project.getProperty('env') == 'dev')) {
     sourceSets {
diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle
index 83dbb36eb..beb127309 100644
--- a/fineract-provider/build.gradle
+++ b/fineract-provider/build.gradle
@@ -123,8 +123,8 @@ eclipse {
 }
 
 /* http://stackoverflow.com/questions/19653311/jpa-repository-works-in-idea-and-production-but-not-in-gradle */
-sourceSets.main.output.resourcesDir = sourceSets.main.java.outputDir
-sourceSets.test.output.resourcesDir = sourceSets.test.java.outputDir
+sourceSets.main.output.resourcesDir = sourceSets.main.java.classesDirectory
+sourceSets.test.output.resourcesDir = sourceSets.test.java.classesDirectory
 
 if (!(project.hasProperty('env') && project.getProperty('env') == 'dev')) {
     sourceSets {
@@ -154,10 +154,10 @@ dependencies {
     driver 'mysql:mysql-connector-java:8.0.32'
 }
 
-URLClassLoader loader = GroovyObject.class.classLoader
-configurations.driver.each {File file ->
-    loader.addURL(file.toURL())
-}
+//URLClassLoader loader = GroovyObject.class.classLoader
+//configurations.driver.each {File file ->
+//    loader.addURL(file.toURL())
+//}
 
 task createDB {
     description= "Creates the MariaDB Database. Needs database name to be passed (like: -PdbName=someDBname)"
@@ -235,7 +235,7 @@ bootJar {
     manifest {
         attributes('Main-Class': 'org.springframework.boot.loader.PropertiesLauncher', 'Implementation-Title': 'Apache Fineract', 'Implementation-Version': project.version)
     }
-    classifier = ''
+    archiveClassifier = ''
     dependsOn resolve
 }
 
@@ -346,4 +346,4 @@ checkstyleTest.dependsOn resolve
 rat.dependsOn prepareInputYaml
 spotbugsTest.dependsOn resolve
 compileTestJava.dependsOn ':fineract-client:processResources', ':fineract-avro-schemas:processResources'
-bootJarMainClassName.dependsOn resolve
+resolveMainClassName.dependsOn resolve
diff --git a/fineract-war/build.gradle b/fineract-war/build.gradle
index 113d6a978..cf3d6ac8c 100644
--- a/fineract-war/build.gradle
+++ b/fineract-war/build.gradle
@@ -44,7 +44,7 @@ war {
         into "WEB-INF/" // no leading slash
     }
     enabled = true
-    classifier = ''
+    archiveClassifier = ''
 }
 
 dependencies {
@@ -56,7 +56,7 @@ dependencies {
 
 tasks.withType(Tar) {
     compression Compression.GZIP
-    extension 'tar.gz'
+    archiveExtension = 'tar.gz'
 }
 
 distributions {
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index ae04661ee..fae08049a 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-7.5.1-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists