From 3813fcb85b242b6ebd7b7c68b1a70076246631e9 Mon Sep 17 00:00:00 2001 From: Kristof Jozsa Date: Mon, 7 Oct 2024 17:46:51 +0200 Subject: [PATCH] wip on fineract-provider --- fineract-provider/build.gradle | 50 +++----- fineract-provider/dependencies.gradle | 169 +++++++++++--------------- 2 files changed, 87 insertions(+), 132 deletions(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 846cb8d8b73..929a2723260 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -18,11 +18,9 @@ */ description = 'Fineract Provider' -apply plugin: 'org.zeroturnaround.gradle.jrebel' apply plugin: 'java' -apply plugin: 'eclipse' apply plugin: 'org.springframework.boot' -apply plugin: 'com.gorylenko.gradle-git-properties' +//apply plugin: 'com.gorylenko.gradle-git-properties' apply plugin: 'io.swagger.core.v3.swagger-gradle-plugin' apply plugin: 'com.google.cloud.tools.jib' apply plugin: 'se.thinkcode.cucumber-runner' @@ -88,21 +86,9 @@ configurations { } } +apply plugin: 'io.freefair.lombok' apply from: 'dependencies.gradle' -dependencies { - implementation 'org.springframework.boot:spring-boot-starter' - implementation 'org.postgresql:postgresql' - implementation 'org.mariadb.jdbc:mariadb-java-client' - implementation 'mysql:mysql-connector-java:8.0.33' - // Add other dependencies as needed - - // Driver dependencies for SQL tasks - driver 'org.postgresql:postgresql' - driver 'org.mariadb.jdbc:mariadb-java-client' - driver 'mysql:mysql-connector-java:8.0.33' -} - modernizer { ignoreClassNamePatterns = [ '.*AbstractPersistableCustom', @@ -111,10 +97,6 @@ modernizer { ] } -if (project.hasProperty('env') && project.env == 'eclipse') { - sourceSets.main.java.outputDir = file('bin/main') -} - sourceSets { main { output.resourcesDir = java.classesDirectory @@ -138,7 +120,7 @@ ext { pgPassword = 'postgres' } -task createDB { +tasks.register('createDB') { description = 'Creates the MariaDB Database. Needs database name to be passed (e.g., -PdbName=someDBname)' doLast { def sql = Sql.newInstance('jdbc:mariadb://localhost:3306/', mysqlUser, mysqlPassword, 'org.mariadb.jdbc.Driver') @@ -146,7 +128,7 @@ task createDB { } } -task dropDB { +tasks.register('dropDB') { description = 'Drops the specified MariaDB database. Needs database name to be passed (e.g., -PdbName=someDBname)' doLast { def sql = Sql.newInstance('jdbc:mariadb://localhost:3306/', mysqlUser, mysqlPassword, 'org.mariadb.jdbc.Driver') @@ -154,7 +136,7 @@ task dropDB { } } -task createPGDB { +tasks.register('createPGDB') { description = 'Creates the PostgreSQL Database. Needs database name to be passed (e.g., -PdbName=someDBname)' doLast { def sql = Sql.newInstance('jdbc:postgresql://localhost:5432/', pgUser, pgPassword, 'org.postgresql.Driver') @@ -162,7 +144,7 @@ task createPGDB { } } -task dropPGDB { +tasks.register('dropPGDB') { description = 'Drops the specified PostgreSQL database. Needs database name to be passed (e.g., -PdbName=someDBname)' doLast { def sql = Sql.newInstance('jdbc:postgresql://localhost:5432/', pgUser, pgPassword, 'org.postgresql.Driver') @@ -170,7 +152,7 @@ task dropPGDB { } } -task createMySQLDB { +tasks.register('createMySQLDB') { description = 'Creates the MySQL Database. Needs database name to be passed (e.g., -PdbName=someDBname)' doLast { def sql = Sql.newInstance('jdbc:mysql://localhost:3306/', mysqlUser, mysqlPassword, 'com.mysql.cj.jdbc.Driver') @@ -178,7 +160,7 @@ task createMySQLDB { } } -task dropMySQLDB { +tasks.register('dropMySQLDB') { description = 'Drops the specified MySQL database. Needs database name to be passed (e.g., -PdbName=someDBname)' doLast { def sql = Sql.newInstance('jdbc:mysql://localhost:3306/', mysqlUser, mysqlPassword, 'com.mysql.cj.jdbc.Driver') @@ -252,7 +234,7 @@ jib { } } -task migrateDatabase { +tasks.register('migrateDatabase') { doFirst { println "Executing liquibase database migration to version $dbVersion" def dbUrl = "jdbc:${dbType}://${dbHost}:${dbPort}/${dbName}" @@ -284,14 +266,12 @@ cucumber { tasks.jibDockerBuild.dependsOn bootJar -gitProperties { - gitPropertiesResourceDir = file("$buildDir/classes/java/main") - dateFormat = "yyyy-MM-dd'T'HH:mmZ" - dateFormatTimeZone = 'GMT' - failOnNoGitDirectory = false -} - -//generateGitProperties.outputs.upToDateWhen { false } +//gitProperties { +// gitPropertiesResourceDir = file("$buildDir/classes/java/main") +// dateFormat = "yyyy-MM-dd'T'HH:mmZ" +// dateFormatTimeZone = 'GMT' +// failOnNoGitDirectory = false +//} // Ensure tasks execute in the correct order jar.dependsOn resolve diff --git a/fineract-provider/dependencies.gradle b/fineract-provider/dependencies.gradle index 7af3a59982e..d2aa0c0eac3 100644 --- a/fineract-provider/dependencies.gradle +++ b/fineract-provider/dependencies.gradle @@ -24,101 +24,95 @@ dependencies { } } - implementation(project(path: ':fineract-core')) - implementation(project(path: ':fineract-accounting')) - implementation(project(path: ':fineract-investor')) - implementation(project(path: ':fineract-rates')) - implementation(project(path: ':fineract-charge')) - implementation(project(path: ':fineract-loan')) - implementation(project(path: ':fineract-savings')) - implementation(project(path: ':fineract-branch')) - implementation(project(path: ':fineract-document')) - implementation(project(path: ':fineract-progressive-loan')) - implementation(project(path: ':fineract-report')) - implementation(project(path: ':fineract-tax')) + annotationProcessor 'org.mapstruct:mapstruct-processor' + + implementation(project(':fineract-core')) + implementation(project(':fineract-accounting')) + implementation(project(':fineract-investor')) + implementation(project(':fineract-rates')) + implementation(project(':fineract-charge')) + implementation(project(':fineract-loan')) + implementation(project(':fineract-savings')) + implementation(project(':fineract-branch')) + implementation(project(':fineract-document')) + implementation(project(':fineract-progressive-loan')) + implementation(project(':fineract-report')) + implementation(project(':fineract-tax')) + implementation(project(':fineract-avro-schemas')) providedRuntime("org.springframework.boot:spring-boot-starter-tomcat") - // Never use "compile" scope, but make all dependencies either 'implementation', 'runtimeOnly' or 'testCompile'. - // Note that we never use 'api', because Fineract at least currently is a simple monolithic application ("WAR"), not a library. - // We also (normally should have) no need to ever use 'compileOnly'. + // Driver dependencies for SQL tasks + driver 'org.postgresql:postgresql' + driver 'org.mariadb.jdbc:mariadb-java-client' + driver 'mysql:mysql-connector-java:8.0.33' - // implementation dependencies are directly used (compiled against) in src/main (and src/test) - // - implementation( - project(path: ':fineract-avro-schemas') - ) implementation( - 'org.springframework.boot:spring-boot-starter-web', - 'org.springframework.boot:spring-boot-starter-security', - 'org.springframework.boot:spring-boot-starter-cache', - 'org.springframework.boot:spring-boot-starter-oauth2-resource-server', - 'org.springframework.boot:spring-boot-starter-actuator', - 'org.springframework.boot:spring-boot-starter-batch', - 'org.springframework.batch:spring-batch-integration', - 'org.springframework.boot:spring-boot-starter-integration', - 'org.springframework.integration:spring-integration-event', - 'org.springframework.integration:spring-integration-jms', - 'org.springframework.integration:spring-integration-kafka', - 'org.springframework.kafka:spring-kafka', - - 'io.micrometer:micrometer-registry-prometheus', - 'io.micrometer:micrometer-registry-otlp', - 'io.micrometer:micrometer-registry-cloudwatch2', - - 'io.awspring.cloud:spring-cloud-aws-starter', - - 'org.apache.avro:avro', - 'jakarta.ws.rs:jakarta.ws.rs-api', - 'org.glassfish.jersey.media:jersey-media-multipart', - - 'org.springframework:spring-jms', - 'org.springframework:spring-context-support', - - 'com.google.guava:guava', + 'ch.qos.logback.contrib:logback-jackson', + 'ch.qos.logback.contrib:logback-json-classic', + 'com.github.librepdf:openpdf', + 'com.github.spotbugs:spotbugs-annotations', + 'com.github.spullara.mustache.java:compiler', + 'com.google.cloud.sql:mysql-socket-factory-connector-j-8', 'com.google.code.gson:gson', - - 'jakarta.jms:jakarta.jms-api', - 'jakarta.management.j2ee:jakarta.management.j2ee-api', - - 'com.squareup.retrofit2:retrofit', + 'com.google.guava:guava', + 'com.jayway.jsonpath:json-path', 'com.squareup.okhttp3:okhttp', 'com.squareup.okhttp3:okhttp-urlconnection', - - 'org.apache.commons:commons-lang3', + 'com.squareup.retrofit2:converter-gson', + 'com.squareup.retrofit2:retrofit', + 'com.sun.activation:jakarta.activation', + 'com.sun.mail:jakarta.mail', 'commons-io:commons-io', + 'io.awspring.cloud:spring-cloud-aws-starter', + 'io.github.classgraph:classgraph', + 'io.github.resilience4j:resilience4j-spring-boot3', + 'io.micrometer:micrometer-registry-cloudwatch2', + 'io.micrometer:micrometer-registry-otlp', + 'io.micrometer:micrometer-registry-prometheus', + 'io.swagger.core.v3:swagger-annotations-jakarta', + 'io.swagger.core.v3:swagger-jaxrs2-jakarta', + 'jakarta.jms:jakarta.jms-api', + 'jakarta.management.j2ee:jakarta.management.j2ee-api', + 'jakarta.ws.rs:jakarta.ws.rs-api', + 'javax.cache:cache-api', + 'mysql:mysql-connector-java:8.0.33', + 'org.apache.avro:avro', + 'org.apache.commons:commons-csv', + 'org.apache.commons:commons-lang3', + 'org.apache.commons:commons-math3', 'org.apache.poi:poi', 'org.apache.poi:poi-ooxml', 'org.apache.tika:tika-core', 'org.apache.tika:tika-parser-microsoft-module', 'org.apache.tika:tika-parser-miscoffice-module', - + 'org.codehaus.janino:janino', + 'org.glassfish.jersey.media:jersey-media-multipart', 'org.liquibase:liquibase-core', - - 'com.github.librepdf:openpdf', - 'com.github.spullara.mustache.java:compiler', - 'com.jayway.jsonpath:json-path', - - 'javax.cache:cache-api', - - 'com.github.spotbugs:spotbugs-annotations', - 'io.swagger.core.v3:swagger-annotations-jakarta', - - 'com.google.cloud.sql:mysql-socket-factory-connector-j-8', - 'com.squareup.retrofit2:converter-gson', - 'com.sun.activation:jakarta.activation', - 'com.sun.mail:jakarta.mail', - - 'org.springdoc:springdoc-openapi-starter-webmvc-ui', 'org.mapstruct:mapstruct', - - 'io.github.resilience4j:resilience4j-spring-boot3', + 'org.mariadb.jdbc:mariadb-java-client', + 'org.postgresql:postgresql', + 'org.springdoc:springdoc-openapi-starter-webmvc-ui', + 'org.springframework.batch:spring-batch-integration', + 'org.springframework.boot:spring-boot-starter', + 'org.springframework.boot:spring-boot-starter-actuator', + 'org.springframework.boot:spring-boot-starter-batch', + 'org.springframework.boot:spring-boot-starter-cache', + 'org.springframework.boot:spring-boot-starter-integration', + 'org.springframework.boot:spring-boot-starter-oauth2-resource-server', + 'org.springframework.boot:spring-boot-starter-security', + 'org.springframework.boot:spring-boot-starter-web', + 'org.springframework.integration:spring-integration-event', + 'org.springframework.integration:spring-integration-jms', + 'org.springframework.integration:spring-integration-kafka', + 'org.springframework.kafka:spring-kafka', + 'org.springframework:spring-context-support', + 'org.springframework:spring-jms', + 'software.amazon.awssdk:auth', + 'software.amazon.awssdk:s3', + 'software.amazon.msk:aws-msk-iam-auth', ) - implementation 'software.amazon.msk:aws-msk-iam-auth' - - implementation 'io.swagger.core.v3:swagger-jaxrs2-jakarta' - implementation ('org.apache.commons:commons-email') { exclude group: 'com.sun.mail', module: 'javax.mail' exclude group: 'javax.activation', module: 'activation' @@ -149,11 +143,6 @@ dependencies { implementation ('org.quartz-scheduler:quartz') { exclude group: 'com.zaxxer', module: 'HikariCP-java7' } - implementation('org.apache.commons:commons-csv'){} - implementation ('software.amazon.awssdk:s3') { - } - implementation ('software.amazon.awssdk:auth') { - } implementation ('org.mnode.ical4j:ical4j') { exclude group: 'commons-logging' @@ -188,21 +177,6 @@ dependencies { 'org.apache.httpcomponents:httpclient' ) - compileOnly 'org.projectlombok:lombok' - annotationProcessor 'org.projectlombok:lombok' - annotationProcessor 'org.mapstruct:mapstruct-processor' - - implementation 'ch.qos.logback.contrib:logback-json-classic' - implementation 'ch.qos.logback.contrib:logback-jackson' - implementation 'org.codehaus.janino:janino' - - implementation 'org.apache.commons:commons-math3' - - implementation 'io.github.classgraph:classgraph' - - // testCompile dependencies are ONLY used in src/test, not src/main. - // Do NOT repeat dependencies which are ALREADY in implementation or runtimeOnly! - // testImplementation( 'io.cucumber:cucumber-spring', 'io.github.classgraph:classgraph', 'io.cucumber:cucumber-core', @@ -210,6 +184,7 @@ dependencies { 'io.cucumber:cucumber-java8', 'io.cucumber:cucumber-junit-platform-engine', ) + testImplementation ('org.springframework.boot:spring-boot-starter-test') { exclude group: 'com.jayway.jsonpath', module: 'json-path' exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'