diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 2c1033be1c3..d74ac52eeb3 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -31,6 +31,22 @@ apply plugin: 'io.freefair.lombok' check.dependsOn('cucumber') +dependencies { + annotationProcessor( + 'org.projectlombok:lombok', + 'org.mapstruct:mapstruct-processor', + 'org.springframework.boot:spring-boot-configuration-processor' + ) + + implementation( + project(':fineract-core'), + project(':fineract-loan'), + project(':fineract-accounting'), + project(':fineract-savings'), + 'org.mapstruct:mapstruct' + ) +} + // Properly declare task for JPA enhancement task enhanceJPA(type: JavaExec) { description = 'Performs static weaving of entity classes' @@ -84,6 +100,16 @@ task enhanceJPA(type: JavaExec) { compileJava.finalizedBy enhanceJPA compileTestJava.mustRunAfter enhanceJPA +// Ensure MapStruct runs before test compilation +tasks.withType(JavaCompile) { + options.compilerArgs += [ + '-Amapstruct.defaultComponentModel=spring', + '-Amapstruct.suppressGeneratorTimestamp=true', + '-Amapstruct.suppressGeneratorVersionInfoComment=true', + '-Amapstruct.verbose=true' + ] +} + // Configuration for Swagger documentation generation task task prepareInputYaml { def inputFile = file("${projectDir}/config/swagger/fineract-input.yaml.template")