Skip to content

Commit

Permalink
[VL-7352] Patch/spring boot (#140)
Browse files Browse the repository at this point in the history
* fix: build errors before merge

* chore: upgrade spring-boot

* fix: upgrade to latest patch version

---------

Co-authored-by: sloops77 <[email protected]>
  • Loading branch information
sloops77 and sloops77 authored Mar 5, 2024
1 parent 8e40c9f commit f16196b
Show file tree
Hide file tree
Showing 61 changed files with 505 additions and 292 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ fineract-provider/src/main/resources/application.properties
fineract-provider/out/
fineract-provider/config/swagger/config.json
fineract-provider/config/swagger/fineract-input.yaml
/.java-version
160 changes: 91 additions & 69 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
// TODO: this is work in progress, please follow FINERACT-1171
buildscript {
ext {
jacocoVersion = '0.8.6'
jacocoVersion = '0.8.7'
retrofitVersion = '2.9.0'
okhttpVersion = '4.9.3'
oltuVersion = '1.0.2'
okhttpVersion = '4.9.2'
oltuVersion = '1.0.1'
fineractJavaProjects = subprojects.findAll{
[
'fineract-api',
Expand Down Expand Up @@ -52,22 +52,29 @@ buildscript {
}

plugins {
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'com.diffplug.spotless' version '5.14.1' apply false
id 'io.spring.dependency-management' version '1.1.4'
id "org.barfuin.gradle.taskinfo" version "1.3.1"
id 'com.adarshr.test-logger' version '3.1.0'
id 'com.diffplug.spotless' version '6.1.0' apply false
id 'org.nosphere.apache.rat' version '0.7.0' apply false
id 'com.github.hierynomus.license' version '0.15.0' apply false
id 'com.github.hierynomus.license' version '0.16.1' apply false
id 'com.github.jk1.dependency-license-report' version '2.0' apply false
id 'org.openapi.generator' version '4.3.1' apply false
id 'org.zeroturnaround.gradle.jrebel' version '1.1.10' apply false
id 'org.springframework.boot' version '2.3.5.RELEASE' apply false
id 'org.zeroturnaround.gradle.jrebel' version '1.1.11' apply false
id 'org.springframework.boot' version '2.6.15' apply false
id 'net.ltgt.errorprone' version '2.0.2' apply false
id 'io.swagger.core.v3.swagger-gradle-plugin' version '2.1.10' apply false
id 'com.gorylenko.gradle-git-properties' version '2.2.4' apply false
id 'io.swagger.core.v3.swagger-gradle-plugin' version '2.1.11' apply false
id 'com.gorylenko.gradle-git-properties' version '2.3.2' apply false
id 'org.asciidoctor.jvm.convert' version '3.3.2' apply false
id 'org.asciidoctor.jvm.pdf' version '3.3.2' apply false
id 'org.asciidoctor.jvm.epub' version '3.3.2' apply false
id 'org.asciidoctor.jvm.revealjs' version '3.3.2' apply false
id 'org.asciidoctor.jvm.gems' version '3.3.2' apply false
id 'org.asciidoctor.kindlegen.base' version '3.2.0' apply false
id 'fr.brouillard.oss.gradle.jgitver' version '0.10.0-rc03'
id "org.sonarqube" version "3.3"
id "com.github.andygoossens.modernizer" version "1.6.1" apply false
id 'com.github.spotbugs' version '5.0.3' apply false
}

description = '''\
Expand All @@ -81,23 +88,30 @@ ext['swaggerFile'] = "$rootDir/fineract-provider/build/classes/java/main/static/
allprojects {
group = 'org.apache.fineract'

jgitver {
strategy 'PATTERN'
versionPattern '${M}.${m}.${p}-${meta.GIT_SHA1_8}'
}

repositories {
jcenter()
}

apply plugin: 'io.spring.dependency-management'
apply plugin: 'com.adarshr.test-logger'
apply plugin: 'com.diffplug.spotless'
apply plugin: 'com.github.hierynomus.license'
apply plugin: 'org.nosphere.apache.rat'
apply plugin: 'project-report'
apply plugin: 'com.github.jk1.dependency-license-report'

// Configuration for the dependency management plugin
// https://github.com/spring-gradle-plugins/dependency-management-plugin
dependencyManagement {
imports {
mavenBom 'org.springframework:spring-framework-bom:5.3.23'
mavenBom 'org.springframework.boot:spring-boot-dependencies:2.3.12.RELEASE'
mavenBom 'org.junit:junit-bom:5.7.2'
mavenBom 'org.springframework:spring-framework-bom:5.3.32'
mavenBom 'org.springframework.boot:spring-boot-dependencies:2.6.15'
mavenBom 'org.junit:junit-bom:5.8.2'
}

dependencies {
Expand All @@ -107,39 +121,39 @@ allprojects {

dependency 'org.springframework.security.oauth:spring-security-oauth2:2.5.2.RELEASE'
dependency 'org.apache.openjpa:openjpa:3.2.0' // when upgrading, also change OpenJPA version repeated above in buildscript!
dependency 'com.google.guava:guava:30.1.1-jre'
dependency 'com.google.guava:guava:31.0.1-jre'
dependency 'com.google.code.gson:gson:2.8.9'
dependency 'com.google.truth:truth:1.1.3'
dependency 'com.google.truth.extensions:truth-java8-extension:1.1.3'
dependency 'org.apache.commons:commons-email:1.5'
dependency 'commons-io:commons-io:2.10.0'
dependency 'commons-io:commons-io:2.11.0'
dependency 'mysql:mysql-connector-java:8.0.30'
dependency 'com.github.librepdf:openpdf:1.3.26'
dependency 'org.mnode.ical4j:ical4j:3.0.28'
dependency 'org.mnode.ical4j:ical4j:3.1.1'
dependency 'org.quartz-scheduler:quartz:2.3.2'
dependency 'com.amazonaws:aws-java-sdk-s3:1.12.19'
dependency 'org.ehcache:ehcache:3.9.4'
dependency 'com.amazonaws:aws-java-sdk-s3:1.12.100'
dependency 'org.ehcache:ehcache:3.9.7'
dependency 'com.github.spullara.mustache.java:compiler:0.9.10'
dependency 'com.jayway.jsonpath:json-path:2.6.0'
dependency 'org.apache.tika:tika-core:1.27'
dependency 'org.apache.httpcomponents:httpclient:4.5.13'
dependency 'io.swagger.core.v3:swagger-annotations:2.1.10'
dependency 'io.swagger.core.v3:swagger-annotations:2.1.11'
dependency 'jakarta.management.j2ee:jakarta.management.j2ee-api:1.1.4'
dependency 'jakarta.jms:jakarta.jms-api:2.0.3'
dependency 'jakarta.xml.bind:jakarta.xml.bind-api:2.3.3'
dependency 'org.glassfish.jaxb:jaxb-runtime:2.3.4'
dependency 'org.glassfish.jaxb:jaxb-runtime:2.3.5'
dependency 'jakarta.validation:jakarta.validation-api:3.0.0'
dependency 'org.apache.activemq:activemq-broker:5.16.2'
dependency 'org.apache.activemq:activemq-broker:5.16.3'
dependency 'org.apache.bval:org.apache.bval.bundle:2.0.5'

dependency 'io.github.classgraph:classgraph:4.8.110'
dependency 'org.awaitility:awaitility:4.1.0'
dependency 'com.github.spotbugs:spotbugs-annotations:4.3.0'
dependency 'io.github.classgraph:classgraph:4.8.129'
dependency 'org.awaitility:awaitility:4.1.1'
dependency 'com.github.spotbugs:spotbugs-annotations:4.5.2'
dependency 'javax.cache:cache-api:1.1.1'
dependency 'org.mock-server:mockserver-junit-jupiter:5.11.2'
dependency 'org.webjars.npm:swagger-ui-dist:3.51.1'
dependency 'org.webjars:webjars-locator-core:0.47'
dependency 'org.springframework.boot:spring-boot-starter-mail:2.3.12.RELEASE'
dependency 'org.webjars:webjars-locator-core:0.48'
dependency 'org.springframework.boot:spring-boot-starter-mail:2.6.15'

// fineract client dependencies
dependency "com.squareup.retrofit2:retrofit:$retrofitVersion"
Expand Down Expand Up @@ -167,30 +181,13 @@ allprojects {
dependency "com.squareup.okhttp3:okhttp-urlconnection:$okhttpVersion"
dependency "com.squareup.okhttp3:okhttp-sse:$okhttpVersion"
dependency "io.gsonfire:gson-fire:1.8.5"
dependency "io.swagger:swagger-core:1.6.2"
dependency "io.swagger:swagger-annotations:1.6.2"
dependency "io.swagger:swagger-core:1.6.3"
dependency "io.swagger:swagger-annotations:1.6.3"
dependency "javax.annotation:javax.annotation-api:1.3.2"
dependency "com.google.code.findbugs:jsr305:3.0.2"
dependency "commons-codec:commons-codec:1.15"

//Pentaho
dependency 'org.pentaho.reporting.engine:classic-core:9.1.0.0-SNAPSHOT'
dependency 'org.pentaho.reporting.engine:classic-extensions:9.1.0.0-SNAPSHOT'
dependency 'org.pentaho.reporting.engine:classic-extensions-scripting:9.1.0.0-SNAPSHOT'
dependency 'org.pentaho.reporting.engine:wizard-core:9.1.0.0-SNAPSHOT'
dependency 'org.pentaho.reporting.designer:wizard-xul:9.1.0.0-SNAPSHOT'
dependency 'org.pentaho.reporting.library:libbase:9.1.0.0-SNAPSHOT'
dependency 'org.pentaho.reporting.library:libdocbundle:9.1.0.0-SNAPSHOT'
dependency 'org.pentaho.reporting.library:libfonts:9.1.0.0-SNAPSHOT'
dependency 'org.pentaho.reporting.library:libformat:9.1.0.0-SNAPSHOT'
dependency 'org.pentaho.reporting.library:libformula:9.1.0.0-SNAPSHOT'
dependency 'org.pentaho.reporting.library:libloader:9.1.0.0-SNAPSHOT'
dependency 'org.pentaho.reporting.library:librepository:9.1.0.0-SNAPSHOT'
dependency 'org.pentaho.reporting.library:libserializer:9.1.0.0-SNAPSHOT'
dependency 'org.pentaho.reporting.library:libsparkline:9.1.0.0-SNAPSHOT'
dependency 'org.pentaho.reporting.library:libxml:9.1.0.0-SNAPSHOT'

dependency ('org.flywaydb:flyway-core:7.0.0') {
dependency ('org.flywaydb:flyway-core:8.1.0') {
// https://issues.apache.org/jira/browse/FINERACT-1172
// https://github.com/apache/fineract/pull/1355
// https://github.com/flyway/flyway/issues/2957
Expand Down Expand Up @@ -229,12 +226,20 @@ allprojects {
}
}

// Configuration for the sonarqube plugin
// https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-gradle/
sonarqube {
properties {
property "sonar.projectKey", "velocity_apache_fineract"
}
}

// Configuration for the spotless plugin
// https://github.com/diffplug/spotless/tree/main/plugin-gradle
spotless {
format 'misc', {
target '**/*.md', '**/*.properties', '**/.gitignore', '**/.openapi-generator-ignore', '**/*.yml', '**/*.xml', '**/**.json', '**/*.sql'
targetExclude '**/build/**', '**/bin/**', '**/.settings/**', '**/.idea/**', '**/.gradle/**', '**/gradlew.bat'
targetExclude '**/build/**', '**/bin/**', '**/.settings/**', '**/.idea/**', '**/.gradle/**', '**/gradlew.bat', '**/licenses/**', '**/banner.txt'
indentWithSpaces(4)
endWithNewline()
trimTrailingWhitespace()
Expand Down Expand Up @@ -278,8 +283,13 @@ allprojects {
'**/gradlew*'
])
}

licenseFormat.dependsOn licenseFormatBuildScripts

licenseReport {
outputDir = "$projectDir/licenses"
}

// Configuration for Apache Release Audit Tool task
// https://github.com/eskatos/creadur-rat-gradle
rat {
Expand Down Expand Up @@ -316,6 +326,7 @@ allprojects {
'**/.gitkeep',
'**/*.iml',
'**/config/swagger/templates/**',
'**/.java-version',
// Notice files
'**/NOTICE_RELEASE',
'**/NOTICE_SOURCE',
Expand Down Expand Up @@ -387,7 +398,7 @@ configure(project.fineractJavaProjects) {
apply plugin: 'jacoco'
apply plugin: "net.ltgt.errorprone"
apply plugin: "com.github.spotbugs"
apply plugin: 'com.github.andygoossens.gradle-modernizer-plugin'
apply plugin: 'com.github.andygoossens.modernizer'

/* define the valid syntax level for source files */
sourceCompatibility = JavaVersion.VERSION_11
Expand Down Expand Up @@ -429,27 +440,23 @@ configure(project.fineractJavaProjects) {
"-Xlint:varargs",
"-Xlint:preview",
"-Xlint:static",
"-Werror"
]
// TODO FINERACT-959 (gradually) enable -Xlint:all (see "javac -help -X")

options.deprecation = true

options.compilerArgs +=[
"-Werror",
"-Xmaxwarns",
1500,
"-Xmaxerrs",
1500
]
// TODO FINERACT-959 (gradually) enable -Xlint:all (see "javac -help -X")

options.deprecation = true
}

// Configuration for the spotless plugin
// https://github.com/diffplug/spotless/tree/main/plugin-gradle
dependencies {
spotbugsPlugins 'jp.skypencil.findbugs.slf4j:bug-pattern:1.5.0@jar'
spotbugs 'com.github.spotbugs:spotbugs:4.2.2'
}

// Configuration for the spotless plugin
// https://github.com/diffplug/spotless/tree/main/plugin-gradle
spotless {
java {
targetExclude '**/build/**', '**/bin/**', '**/out/**'
Expand Down Expand Up @@ -491,7 +498,9 @@ configure(project.fineractJavaProjects) {
lineEndings 'UNIX'
}

compileJava.dependsOn spotlessCheck
// compileJava may create more source files into generated, hence we need to run these tasks after it
licenseMain.dependsOn compileJava
processResources.dependsOn compileJava

// If we are running Gradle within Eclipse to enhance classes with OpenJPA,
// set the classes directory to point to Eclipse's default build directory
Expand All @@ -502,7 +511,7 @@ configure(project.fineractJavaProjects) {
// Configuration for the Checkstyle plugin
// https://docs.gradle.org/current/userguide/checkstyle_plugin.html
dependencies {
checkstyle 'com.puppycrawl.tools:checkstyle:8.44'
checkstyle 'com.puppycrawl.tools:checkstyle:9.1'
checkstyle 'com.github.sevntu-checkstyle:sevntu-checks:1.40.0'
}

Expand All @@ -524,7 +533,7 @@ configure(project.fineractJavaProjects) {
// Configuration for the errorprone plugin
// https://github.com/tbroyer/gradle-errorprone-plugin
dependencies {
errorprone "com.google.errorprone:error_prone_core:2.6.0"
errorprone "com.google.errorprone:error_prone_core:2.10.0"
}

tasks.withType(JavaCompile) {
Expand All @@ -542,6 +551,7 @@ configure(project.fineractJavaProjects) {
"AlmostJavadoc",
"InvalidBlockTag",
"JavaUtilDate", // TODO FINERACT-1298
"ReturnValueIgnored"
)
error(
"DefaultCharset",
Expand Down Expand Up @@ -628,12 +638,10 @@ configure(project.fineractJavaProjects) {

test {
useJUnitPlatform()
testLogging {
// FINERACT-927
events "skipped", "failed"
showStandardStreams = false
exceptionFormat "full"
}
}

testlogger {
logLevel 'quiet'
}

// Configuration for spotbugs plugin
Expand All @@ -642,7 +650,7 @@ configure(project.fineractJavaProjects) {
// To generate an HTML report instead of XML
spotbugs {
reportLevel = 'high'
showProgress = true
showProgress = false
}
// https://github.com/spotbugs/spotbugs-gradle-plugin/issues/242
spotbugsMain {
Expand Down Expand Up @@ -673,7 +681,6 @@ configure(project.fineractJavaProjects) {
}

configure(project.fineractPublishProjects) {
apply plugin: 'maven'
apply plugin: 'maven-publish'

publishing {
Expand Down Expand Up @@ -712,3 +719,18 @@ configure(project.fineractPublishProjects) {
// TODO FINERACT-1102: Actually use this to deploy to ASF (Apache Software Foundation) Nexus Maven Repository
}
}

task printSourceSetInformation() {
doLast{
sourceSets.each { srcSet ->
println "["+srcSet.name+"]"
print "-->Source directories: "+srcSet.allJava.srcDirs+"\n"
print "-->Output directories: "+srcSet.output.classesDirs.files+"\n"
print "-->Compile classpath:\n"
srcSet.compileClasspath.files.each {
print " "+it.path+"\n"
}
println ""
}
}
}
17 changes: 17 additions & 0 deletions docker-compose-activemq.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

version: '2'

Expand Down
19 changes: 19 additions & 0 deletions eng/environments/common.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#


CURR_VERSION="1.14.0"
TARGET_CONTAINER_REG="ghcr.io"
Expand Down
Loading

0 comments on commit f16196b

Please sign in to comment.