Skip to content

Commit

Permalink
wip on fineract-provider
Browse files Browse the repository at this point in the history
  • Loading branch information
kjozsa committed Oct 7, 2024
1 parent 8081b69 commit 3813fcb
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 132 deletions.
50 changes: 15 additions & 35 deletions fineract-provider/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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',
Expand All @@ -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
Expand All @@ -138,47 +120,47 @@ 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')
sql.execute("CREATE DATABASE `${dbName}` CHARACTER SET utf8mb4")
}
}

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')
sql.execute("DROP DATABASE `${dbName}`")
}
}

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')
sql.execute("CREATE DATABASE ${dbName}")
}
}

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')
sql.execute("DROP DATABASE ${dbName}")
}
}

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')
sql.execute("CREATE DATABASE `${dbName}` CHARACTER SET utf8mb4")
}
}

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')
Expand Down Expand Up @@ -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}"
Expand Down Expand Up @@ -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
Expand Down
169 changes: 72 additions & 97 deletions fineract-provider/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -188,28 +177,14 @@ 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',
'io.cucumber:cucumber-java',
'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'
Expand Down

0 comments on commit 3813fcb

Please sign in to comment.