diff --git a/build.gradle b/build.gradle
index e09cc9d5f95..587b01a0e3a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -31,6 +31,7 @@ buildscript {
'fineract-accounting',
'fineract-provider',
'fineract-branch',
+ 'fineract-document',
'fineract-investor',
'fineract-loan',
'fineract-savings',
@@ -54,7 +55,8 @@ buildscript {
'fineract-investor',
'fineract-loan',
'fineract-savings',
- 'fineract-branch'
+ 'fineract-branch',
+ 'fineract-document'
].contains(it.name)
}
npmRepository = 'https://npm.pkg.github.com'
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/Base64EncodedImage.java b/fineract-core/src/main/java/org/apache/fineract/infrastructure/core/domain/Base64EncodedImage.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/Base64EncodedImage.java
rename to fineract-core/src/main/java/org/apache/fineract/infrastructure/core/domain/Base64EncodedImage.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/ImageDataURLNotValidException.java b/fineract-core/src/main/java/org/apache/fineract/infrastructure/core/exception/ImageDataURLNotValidException.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/ImageDataURLNotValidException.java
rename to fineract-core/src/main/java/org/apache/fineract/infrastructure/core/exception/ImageDataURLNotValidException.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/ImageUploadException.java b/fineract-core/src/main/java/org/apache/fineract/infrastructure/core/exception/ImageUploadException.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/ImageUploadException.java
rename to fineract-core/src/main/java/org/apache/fineract/infrastructure/core/exception/ImageUploadException.java
diff --git a/fineract-document/build.gradle b/fineract-document/build.gradle
new file mode 100644
index 00000000000..6eeb13ada52
--- /dev/null
+++ b/fineract-document/build.gradle
@@ -0,0 +1,90 @@
+/**
+ * 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.
+ */
+description = 'Fineract Document'
+
+apply plugin: 'java'
+apply plugin: 'eclipse'
+
+compileJava.doLast {
+ def mainSS = sourceSets.main
+ def source = mainSS.java.classesDirectory.get()
+ copy {
+ from file("src/main/resources/jpa/document/persistence.xml")
+ into "${source}/META-INF/"
+ }
+ javaexec {
+ description = 'Performs EclipseLink static weaving of entity classes'
+ def target = source
+ main 'org.eclipse.persistence.tools.weaving.jpa.StaticWeave'
+ args '-persistenceinfo', source, '-classpath', sourceSets.main.runtimeClasspath, source, target
+ classpath sourceSets.main.runtimeClasspath
+ }
+ delete {
+ delete "${source}/META-INF/persistence.xml"
+ }
+}
+
+configurations {
+ providedRuntime // needed for Spring Boot executable WAR
+ providedCompile
+ compile() {
+ exclude module: 'hibernate-entitymanager'
+ exclude module: 'hibernate-validator'
+ exclude module: 'activation'
+ exclude module: 'bcmail-jdk14'
+ exclude module: 'bcprov-jdk14'
+ exclude module: 'bctsp-jdk14'
+ exclude module: 'c3p0'
+ exclude module: 'stax-api'
+ exclude module: 'jaxb-api'
+ exclude module: 'jaxb-impl'
+ exclude module: 'jboss-logging'
+ exclude module: 'itext-rtf'
+ exclude module: 'classworlds'
+ }
+ runtime
+}
+
+apply from: 'dependencies.gradle'
+
+// Configuration for the modernizer plugin
+// https://github.com/andygoossens/gradle-modernizer-plugin
+modernizer {
+ ignoreClassNamePatterns = [
+ '.*AbstractPersistableCustom',
+ '.*EntityTables',
+ '.*domain.*'
+ ]
+}
+
+// If we are running Gradle within Eclipse to enhance classes with OpenJPA,
+// set the classes directory to point to Eclipse's default build directory
+if (project.hasProperty('env') && project.getProperty('env') == 'eclipse') {
+ sourceSets.main.java.outputDir = new File(rootProject.projectDir, "fineract-core/bin/main")
+}
+
+if (!(project.hasProperty('env') && project.getProperty('env') == 'dev')) {
+ sourceSets {
+ test {
+ java {
+ exclude '**/core/boot/tests/**'
+ }
+ }
+ }
+}
diff --git a/fineract-document/dependencies.gradle b/fineract-document/dependencies.gradle
new file mode 100644
index 00000000000..0f4c8facd23
--- /dev/null
+++ b/fineract-document/dependencies.gradle
@@ -0,0 +1,83 @@
+/**
+ * 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.
+ */
+
+dependencies {
+ // 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'.
+
+ // implementation dependencies are directly used (compiled against) in src/main (and src/test)
+ //
+ implementation(project(path: ':fineract-core'))
+
+ implementation(
+ 'org.springframework.boot:spring-boot-starter-web',
+ 'org.springframework.boot:spring-boot-starter-security',
+ 'jakarta.ws.rs:jakarta.ws.rs-api',
+ 'org.glassfish.jersey.media:jersey-media-multipart',
+
+ 'com.google.guava:guava',
+ 'com.google.code.gson:gson',
+
+ 'org.apache.commons:commons-lang3',
+
+ 'com.jayway.jsonpath:json-path',
+
+ 'com.github.spotbugs:spotbugs-annotations',
+ 'io.swagger.core.v3:swagger-annotations-jakarta',
+
+ 'com.squareup.retrofit2:converter-gson',
+
+ 'org.springdoc:springdoc-openapi-starter-webmvc-ui',
+ 'org.mapstruct:mapstruct',
+
+ 'io.github.resilience4j:resilience4j-spring-boot3',
+ 'org.apache.httpcomponents:httpcore',
+
+ 'org.apache.tika:tika-core',
+ 'org.apache.tika:tika-parser-microsoft-module',
+ 'org.apache.tika:tika-parser-miscoffice-module',
+ )
+ compileOnly 'org.projectlombok:lombok'
+ annotationProcessor 'org.projectlombok:lombok'
+ annotationProcessor 'org.mapstruct:mapstruct-processor'
+ implementation('org.apache.commons:commons-csv'){}
+ implementation ('software.amazon.awssdk:s3') {
+ }
+ implementation ('software.amazon.awssdk:auth') {
+ }
+ implementation ('org.springframework.boot:spring-boot-starter-data-jpa') {
+ exclude group: 'org.hibernate'
+ }
+ implementation('org.eclipse.persistence:org.eclipse.persistence.jpa') {
+ exclude group: 'org.eclipse.persistence', module: 'jakarta.persistence'
+ }
+ // testCompile dependencies are ONLY used in src/test, not src/main.
+ // Do NOT repeat dependencies which are ALREADY in implementation or runtimeOnly!
+ //
+ testImplementation( 'io.github.classgraph:classgraph' )
+ 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'
+ exclude group: 'jakarta.activation'
+ exclude group: 'javax.activation'
+ exclude group: 'org.skyscreamer'
+ }
+ testImplementation ('org.mockito:mockito-inline')
+}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/ContentResources.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/ContentResources.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/ContentResources.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/ContentResources.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/DocumentManagementApiResource.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/DocumentManagementApiResource.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/DocumentManagementApiResource.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/DocumentManagementApiResource.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/DocumentManagementApiResourceSwagger.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/DocumentManagementApiResourceSwagger.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/DocumentManagementApiResourceSwagger.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/DocumentManagementApiResourceSwagger.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/FileUploadValidator.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/FileUploadValidator.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/FileUploadValidator.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/FileUploadValidator.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/ImagesApiResource.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/ImagesApiResource.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/ImagesApiResource.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/ImagesApiResource.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/ImagesApiResourceSwagger.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/ImagesApiResourceSwagger.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/ImagesApiResourceSwagger.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/ImagesApiResourceSwagger.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/command/DocumentCommand.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/command/DocumentCommand.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/command/DocumentCommand.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/command/DocumentCommand.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/command/DocumentCommandValidator.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/command/DocumentCommandValidator.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/command/DocumentCommandValidator.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/command/DocumentCommandValidator.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentPathSanitizer.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentPathSanitizer.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentPathSanitizer.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentPathSanitizer.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepository.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepository.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepository.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepository.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepositoryFactory.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepositoryFactory.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepositoryFactory.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepositoryFactory.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepositoryUtils.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepositoryUtils.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepositoryUtils.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepositoryUtils.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/FileSystemContentPathSanitizer.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/FileSystemContentPathSanitizer.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/FileSystemContentPathSanitizer.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/FileSystemContentPathSanitizer.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/FileSystemContentRepository.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/FileSystemContentRepository.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/FileSystemContentRepository.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/FileSystemContentRepository.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/S3ContentRepository.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/S3ContentRepository.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/S3ContentRepository.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/S3ContentRepository.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/data/FileData.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/data/FileData.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/data/FileData.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/data/FileData.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/data/ImageData.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/data/ImageData.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/data/ImageData.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/data/ImageData.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/data/ImageResizer.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/data/ImageResizer.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/data/ImageResizer.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/data/ImageResizer.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/domain/Document.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/domain/Document.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/domain/Document.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/domain/Document.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/domain/DocumentRepository.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/domain/DocumentRepository.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/domain/DocumentRepository.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/domain/DocumentRepository.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/domain/ImageRepository.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/domain/ImageRepository.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/domain/ImageRepository.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/domain/ImageRepository.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/ContentManagementException.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/ContentManagementException.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/ContentManagementException.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/ContentManagementException.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/DocumentNotFoundException.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/DocumentNotFoundException.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/DocumentNotFoundException.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/DocumentNotFoundException.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/InvalidEntityTypeForDocumentManagementException.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/InvalidEntityTypeForDocumentManagementException.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/InvalidEntityTypeForDocumentManagementException.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/InvalidEntityTypeForDocumentManagementException.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/InvalidEntityTypeForImageManagementException.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/InvalidEntityTypeForImageManagementException.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/InvalidEntityTypeForImageManagementException.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/InvalidEntityTypeForImageManagementException.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentReadPlatformService.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentReadPlatformService.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentReadPlatformService.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentReadPlatformService.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentReadPlatformServiceImpl.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentReadPlatformServiceImpl.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentReadPlatformServiceImpl.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentReadPlatformServiceImpl.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentWritePlatformService.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentWritePlatformService.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentWritePlatformService.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentWritePlatformService.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentWritePlatformServiceJpaRepositoryImpl.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentWritePlatformServiceJpaRepositoryImpl.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentWritePlatformServiceJpaRepositoryImpl.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentWritePlatformServiceJpaRepositoryImpl.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/ImageReadPlatformService.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/ImageReadPlatformService.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/ImageReadPlatformService.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/ImageReadPlatformService.java
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/ImageWritePlatformService.java b/fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/ImageWritePlatformService.java
similarity index 100%
rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/ImageWritePlatformService.java
rename to fineract-document/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/ImageWritePlatformService.java
diff --git a/fineract-document/src/main/resources/jpa/document/persistence.xml b/fineract-document/src/main/resources/jpa/document/persistence.xml
new file mode 100644
index 00000000000..bf9980fa80a
--- /dev/null
+++ b/fineract-document/src/main/resources/jpa/document/persistence.xml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+ org.eclipse.persistence.jpa.PersistenceProvider
+
+ org.apache.fineract.accounting.glaccount.domain.GLAccount
+ org.apache.fineract.accounting.journalentry.domain.JournalEntry
+ org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom
+ org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom
+ org.apache.fineract.infrastructure.codes.domain.Code
+ org.apache.fineract.infrastructure.codes.domain.CodeValue
+ org.apache.fineract.infrastructure.documentmanagement.domain.Image
+ org.apache.fineract.organisation.staff.domain.Staff
+ org.apache.fineract.organisation.office.domain.Office
+ org.apache.fineract.organisation.office.domain.OrganisationCurrency
+ org.apache.fineract.organisation.monetary.domain.ApplicationCurrency
+ org.apache.fineract.organisation.holiday.domain.Holiday
+ org.apache.fineract.organisation.workingdays.domain.WorkingDays
+ org.apache.fineract.portfolio.group.domain.Group
+ org.apache.fineract.portfolio.group.domain.GroupLevel
+ org.apache.fineract.portfolio.group.domain.StaffAssignmentHistory
+ org.apache.fineract.portfolio.group.domain.GroupRole
+ org.apache.fineract.portfolio.client.domain.Client
+ org.apache.fineract.portfolio.fund.domain.Fund
+ org.apache.fineract.portfolio.charge.domain.Charge
+ org.apache.fineract.portfolio.paymenttype.domain.PaymentType
+ org.apache.fineract.portfolio.paymentdetail.domain.PaymentDetail
+ org.apache.fineract.portfolio.tax.domain.TaxGroup
+ org.apache.fineract.portfolio.tax.domain.TaxGroupMappings
+ org.apache.fineract.portfolio.tax.domain.TaxComponent
+ org.apache.fineract.portfolio.tax.domain.TaxComponentHistory
+ org.apache.fineract.portfolio.calendar.domain.Calendar
+ org.apache.fineract.portfolio.calendar.domain.CalendarHistory
+ org.apache.fineract.portfolio.calendar.domain.CalendarInstance
+ org.apache.fineract.useradministration.domain.AppUser
+ org.apache.fineract.useradministration.domain.Role
+ org.apache.fineract.useradministration.domain.Permission
+ org.apache.fineract.useradministration.domain.AppUserClientMapping
+ false
+
+
+
+
+
diff --git a/fineract-provider/dependencies.gradle b/fineract-provider/dependencies.gradle
index 67487cac89f..38433c3ab41 100644
--- a/fineract-provider/dependencies.gradle
+++ b/fineract-provider/dependencies.gradle
@@ -30,6 +30,7 @@ dependencies {
implementation(project(path: ':fineract-loan'))
implementation(project(path: ':fineract-savings'))
implementation(project(path: ':fineract-branch'))
+ implementation(project(path: ':fineract-document'))
providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")
// Never use "compile" scope, but make all dependencies either 'implementation', 'runtimeOnly' or 'testCompile'.
diff --git a/fineract-provider/src/main/resources/jpa/persistence.xml b/fineract-provider/src/main/resources/jpa/persistence.xml
index bf3f727b5f8..b398f5f4dc6 100644
--- a/fineract-provider/src/main/resources/jpa/persistence.xml
+++ b/fineract-provider/src/main/resources/jpa/persistence.xml
@@ -140,6 +140,8 @@
org.apache.fineract.accounting.rule.domain.AccountingRule
org.apache.fineract.accounting.rule.domain.AccountingTagRule
+
+ org.apache.fineract.infrastructure.documentmanagement.domain.Document
false
diff --git a/settings.gradle b/settings.gradle
index eca37424742..16a89ae35d9 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -52,6 +52,7 @@ include ':fineract-core'
include ':fineract-accounting'
include ':fineract-provider'
include ':fineract-branch'
+include ':fineract-document'
include ':fineract-investor'
include ':fineract-loan'
include ':fineract-savings'