Upgrade to JDK 17

This commit is contained in:
Aleksandar Vidakovic
2022-01-03 21:04:53 +08:00
committed by Petri Tuomola
parent 84598709d1
commit c81fc7f0f4
42 changed files with 318 additions and 180 deletions
+6 -1
View File
@@ -8,8 +8,13 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'zulu'
- name: Build the image
run: ./gradlew :fineract-provider:jibDockerBuild -x test
run: ./gradlew :fineract-provider:clean :fineract-provider:jibDockerBuild -x test
- name: Start the stack
run: docker-compose up -d
- name: Wait for stack to come up
+2 -2
View File
@@ -36,10 +36,10 @@ jobs:
${{ runner.os }}-gradle-
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '11'
java-version: '17'
distribution: 'zulu'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
+2 -2
View File
@@ -21,10 +21,10 @@ jobs:
${{ runner.os }}-gradle-
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '11'
java-version: '17'
distribution: 'zulu'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
+2 -2
View File
@@ -48,8 +48,8 @@ install:
- curl -O https://cdn.azul.com/zulu/bin/zulu-repo_1.0.0-3_all.deb
- sudo apt-get -yq install ./zulu-repo_1.0.0-3_all.deb
- sudo apt-get -q update
- sudo apt-get -yq install zulu11-jdk
- export JAVA_HOME=/usr/lib/jvm/zulu11
- sudo apt-get -yq install zulu17-jdk
- export JAVA_HOME=/usr/lib/jvm/zulu17
# https://docs.travis-ci.com/user/languages/java/#caching
before_cache:
+1 -1
View File
@@ -20,7 +20,7 @@ If you are interested in contributing to this project, but perhaps don't quite k
Requirements
============
* Java >= 11 (OpenJDK JVM is tested by our CI on Travis)
* Java >= 17 (OpenJDK JVM is tested by our CI on Travis)
* MariaDB 10.6
You can run the required version of the database server in a container, instead of having to install it, like this:
+5 -5
View File
@@ -59,7 +59,7 @@ plugins {
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.11' apply false
id 'org.springframework.boot' version '2.6.0' apply false
id 'org.springframework.boot' version '2.6.1' apply false
id 'net.ltgt.errorprone' version '2.0.2' 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.1' apply false
@@ -109,7 +109,7 @@ allprojects {
dependencyManagement {
imports {
mavenBom 'org.springframework:spring-framework-bom:5.3.12'
mavenBom 'org.springframework.boot:spring-boot-dependencies:2.6.0'
mavenBom 'org.springframework.boot:spring-boot-dependencies:2.6.1'
mavenBom 'org.junit:junit-bom:5.8.1'
}
@@ -149,7 +149,7 @@ allprojects {
dependency 'org.mock-server:mockserver-junit-jupiter:5.11.2'
dependency 'org.webjars.npm:swagger-ui-dist:4.0.1'
dependency 'org.webjars:webjars-locator-core:0.48'
dependency 'org.springframework.boot:spring-boot-starter-mail:2.6.0'
dependency 'org.springframework.boot:spring-boot-starter-mail:2.6.1'
dependency 'com.icegreen:greenmail-junit5:1.6.5'
// fineract client dependencies
@@ -379,9 +379,9 @@ configure(project.fineractJavaProjects) {
apply plugin: 'com.github.andygoossens.modernizer'
/* define the valid syntax level for source files */
sourceCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
/* define binary compatibility version */
targetCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_17
/* http://stackoverflow.com/questions/19653311/jpa-repository-works-in-idea-and-production-but-not-in-gradle */
sourceSets.main.output.resourcesDir = sourceSets.main.java.outputDir
+1 -1
View File
@@ -102,7 +102,7 @@ sourceSets {
}
java {
// keep this at Java 8, not 11; see https://issues.apache.org/jira/browse/FINERACT-1214
// keep this at Java 8, not 17; see https://issues.apache.org/jira/browse/FINERACT-1214
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
+10 -2
View File
@@ -268,7 +268,7 @@ bootJar {
jib {
from {
image = 'azul/zulu-openjdk-alpine:11'
image = 'azul/zulu-openjdk-alpine:17'
}
to {
@@ -289,7 +289,15 @@ jib {
'-XX:+UseContainerSupport',
'-XX:+UseStringDeduplication',
'-XX:MinRAMPercentage=25',
'-XX:MaxRAMPercentage=80'
'-XX:MaxRAMPercentage=80',
'--add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED',
'--add-opens=java.base/java.lang=ALL-UNNAMED',
'--add-opens=java.base/java.lang.invoke=ALL-UNNAMED',
'--add-opens=java.base/java.io=ALL-UNNAMED',
'--add-opens=java.base/java.security=ALL-UNNAMED',
'--add-opens=java.base/java.util=ALL-UNNAMED',
'--add-opens=java.management/javax.management=ALL-UNNAMED',
'--add-opens=java.naming/javax.naming=ALL-UNNAMED'
]
args = [
'-Duser.home=/tmp',
@@ -19,7 +19,6 @@
package org.apache.fineract.batch.exception;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException;
import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException;
import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException;
@@ -32,6 +31,7 @@ import org.apache.fineract.infrastructure.core.exceptionmapper.PlatformDomainRul
import org.apache.fineract.infrastructure.core.exceptionmapper.PlatformInternalServerExceptionMapper;
import org.apache.fineract.infrastructure.core.exceptionmapper.PlatformResourceNotFoundExceptionMapper;
import org.apache.fineract.infrastructure.core.exceptionmapper.UnsupportedParameterExceptionMapper;
import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper;
import org.apache.fineract.portfolio.loanaccount.exception.MultiDisbursementDataRequiredException;
import org.apache.fineract.portfolio.loanproduct.exception.LinkedAccountRequiredException;
import org.springframework.dao.NonTransientDataAccessException;
@@ -49,7 +49,7 @@ import org.springframework.transaction.TransactionException;
*/
public class ErrorHandler extends RuntimeException {
private static Gson jsonHelper = new GsonBuilder().setPrettyPrinting().create();
private static Gson jsonHelper = GoogleGsonSerializerHelper.createGsonBuilder(true).create();
/**
* Sole Constructor
@@ -38,6 +38,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.EnumOp
import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.GroupIdSerializer;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper;
import org.apache.fineract.portfolio.calendar.data.CalendarData;
import org.apache.fineract.portfolio.group.data.CenterData;
import org.apache.fineract.portfolio.group.data.GroupGeneralData;
@@ -229,7 +230,7 @@ public class CenterImportHandler implements ImportHandler {
}
private CommandProcessingResult importCenter(int rowIndex, String dateFormat) {
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
Type groupCollectionType = new TypeToken<Collection<GroupGeneralData>>() {}.getType();
gsonBuilder.registerTypeAdapter(groupCollectionType, new GroupIdSerializer());
@@ -254,7 +255,7 @@ public class CenterImportHandler implements ImportHandler {
private Integer importCenterMeeting(CommandProcessingResult result, int rowIndex, String dateFormat) {
CalendarData calendarData = meetings.get(rowIndex);
calendarData.setTitle("centers_" + result.getGroupId().toString() + "_CollectionMeeting");
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
gsonBuilder.registerTypeAdapter(EnumOptionData.class, new EnumOptionDataValueSerializer());
@@ -46,6 +46,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.EnumOp
import org.apache.fineract.infrastructure.codes.data.CodeValueData;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper;
import org.apache.fineract.organisation.monetary.data.CurrencyData;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.IndexedColors;
@@ -148,7 +149,7 @@ public class ChartOfAccountsImportHandler implements ImportHandler {
public Count importEntity(String dateFormat) {
Sheet chartOfAccountsSheet = workbook.getSheet(TemplatePopulateImportConstants.CHART_OF_ACCOUNTS_SHEET_NAME);
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(EnumOptionData.class, new EnumOptionDataIdSerializer());
gsonBuilder.registerTypeAdapter(CodeValueData.class, new CodeValueDataIdSerializer());
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
@@ -35,6 +35,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandler
import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandlerUtils;
import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSerializer;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper;
import org.apache.fineract.portfolio.address.data.AddressData;
import org.apache.fineract.portfolio.client.data.ClientData;
import org.apache.fineract.portfolio.client.data.ClientNonPersonData;
@@ -198,7 +199,7 @@ public class ClientEntityImportHandler implements ImportHandler {
int errorCount = 0;
String errorMessage = "";
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
for (ClientData client : clients) {
@@ -34,6 +34,7 @@ import org.apache.fineract.infrastructure.bulkimport.data.Count;
import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandler;
import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandlerUtils;
import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSerializer;
import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper;
import org.apache.fineract.portfolio.address.data.AddressData;
import org.apache.fineract.portfolio.client.data.ClientData;
import org.apache.poi.ss.usermodel.Cell;
@@ -183,7 +184,7 @@ public class ClientPersonImportHandler implements ImportHandler {
int successCount = 0;
int errorCount = 0;
String errorMessage = "";
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
for (ClientData client : clients) {
try {
@@ -38,6 +38,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSe
import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.EnumOptionDataIdSerializer;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper;
import org.apache.fineract.portfolio.savings.data.ClosingOfSavingsAccounts;
import org.apache.fineract.portfolio.savings.data.FixedDepositAccountData;
import org.apache.fineract.portfolio.savings.data.SavingsAccountChargeData;
@@ -344,7 +345,7 @@ public class FixedDepositImportHandler implements ImportHandler {
private int importSavingsClosing(Long savingsId, int i, String dateFormat) {
if (closedOnDate.get(i) != null) {
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
String payload = gsonBuilder.create().toJson(closedOnDate.get(i));
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
@@ -357,7 +358,7 @@ public class FixedDepositImportHandler implements ImportHandler {
}
private CommandProcessingResult importSavings(int i, String dateFormat) {
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
gsonBuilder.registerTypeAdapter(EnumOptionData.class, new EnumOptionDataIdSerializer());
JsonObject savingsJsonob = gsonBuilder.create().toJsonTree(savings.get(i)).getAsJsonObject();
@@ -382,7 +383,7 @@ public class FixedDepositImportHandler implements ImportHandler {
private int importSavingsApproval(Long savingsId, int i, String dateFormat) {
if (approvalDates.get(i) != null) {
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
String payload = gsonBuilder.create().toJson(approvalDates.get(i));
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
@@ -396,7 +397,7 @@ public class FixedDepositImportHandler implements ImportHandler {
private int importSavingsActivation(Long savingsId, int i, String dateFormat) {
if (activationDates.get(i) != null) {
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
String payload = gsonBuilder.create().toJson(activationDates.get(i));
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
@@ -35,6 +35,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandler
import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSerializer;
import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.SavingsAccountTransactionEnumValueSerialiser;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper;
import org.apache.fineract.portfolio.savings.data.SavingsAccountTransactionData;
import org.apache.fineract.portfolio.savings.data.SavingsAccountTransactionEnumData;
import org.apache.poi.ss.usermodel.Cell;
@@ -119,7 +120,7 @@ public class FixedDepositTransactionImportHandler implements ImportHandler {
int successCount = 0;
int errorCount = 0;
String errorMessage = "";
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
gsonBuilder.registerTypeAdapter(SavingsAccountTransactionEnumData.class, new SavingsAccountTransactionEnumValueSerialiser());
@@ -38,6 +38,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSe
import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.EnumOptionDataValueSerializer;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper;
import org.apache.fineract.portfolio.calendar.data.CalendarData;
import org.apache.fineract.portfolio.client.data.ClientData;
import org.apache.fineract.portfolio.group.data.GroupGeneralData;
@@ -233,7 +234,7 @@ public class GroupImportHandler implements ImportHandler {
private Integer importGroupMeeting(CommandProcessingResult result, int rowIndex, String dateFormat) {
CalendarData calendarData = meetings.get(rowIndex);
calendarData.setTitle("group_" + result.getGroupId().toString() + "_CollectionMeeting");
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
gsonBuilder.registerTypeAdapter(EnumOptionData.class, new EnumOptionDataValueSerializer());
@@ -250,7 +251,7 @@ public class GroupImportHandler implements ImportHandler {
}
private CommandProcessingResult importGroup(int rowIndex, String dateFormat) {
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
Type clientCollectionType = new TypeToken<Collection<ClientData>>() {}.getType();
gsonBuilder.registerTypeAdapter(clientCollectionType, new ClientIdSerializer());
@@ -35,6 +35,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandler
import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandlerUtils;
import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSerializer;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper;
import org.apache.fineract.portfolio.loanaccount.guarantor.data.GuarantorData;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.IndexedColors;
@@ -125,7 +126,7 @@ public class GuarantorImportHandler implements ImportHandler {
int successCount = 0;
int errorCount = 0;
String errorMessage = "";
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
for (GuarantorData guarantor : guarantors) {
try {
@@ -36,6 +36,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandler
import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.CurrencyDateCodeSerializer;
import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSerializer;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper;
import org.apache.fineract.organisation.monetary.data.CurrencyData;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.IndexedColors;
@@ -197,7 +198,7 @@ public class JournalEntriesImportHandler implements ImportHandler {
int successCount = 0;
int errorCount = 0;
String errorMessage = "";
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
gsonBuilder.registerTypeAdapter(CurrencyData.class, new CurrencyDateCodeSerializer());
@@ -39,6 +39,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSe
import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.EnumOptionDataValueSerializer;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper;
import org.apache.fineract.portfolio.loanaccount.data.DisbursementData;
import org.apache.fineract.portfolio.loanaccount.data.LoanAccountData;
import org.apache.fineract.portfolio.loanaccount.data.LoanApprovalData;
@@ -466,7 +467,7 @@ public class LoanImportHandler implements ImportHandler {
}
private Integer importLoanRepayment(CommandProcessingResult result, int rowIndex, String dateFormat) {
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
JsonObject loanRepaymentJsonob = gsonBuilder.create().toJsonTree(loanRepayments.get(rowIndex)).getAsJsonObject();
loanRepaymentJsonob.remove("manuallyReversed");
@@ -486,7 +487,7 @@ public class LoanImportHandler implements ImportHandler {
DisbursementData disbusalData = disbursalDates.get(rowIndex);
String linkAccountId = disbusalData.getLinkAccountId();
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
if (linkAccountId != null && !"".equals(linkAccountId)) {
String payload = gsonBuilder.create().toJson(disbusalData);
@@ -510,7 +511,7 @@ public class LoanImportHandler implements ImportHandler {
private Integer importLoanApproval(CommandProcessingResult result, int rowIndex, String dateFormat) {
if (approvalDates.get(rowIndex) != null) {
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
String payload = gsonBuilder.create().toJson(approvalDates.get(rowIndex));
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
@@ -524,7 +525,7 @@ public class LoanImportHandler implements ImportHandler {
}
private CommandProcessingResult importLoan(int rowIndex, String dateFormat) {
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
gsonBuilder.registerTypeAdapter(EnumOptionData.class, new EnumOptionDataValueSerializer());
JsonObject loanJsonOb = gsonBuilder.create().toJsonTree(loans.get(rowIndex)).getAsJsonObject();
@@ -34,6 +34,7 @@ import org.apache.fineract.infrastructure.bulkimport.data.Count;
import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandler;
import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandlerUtils;
import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSerializer;
import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper;
import org.apache.fineract.portfolio.loanaccount.data.LoanTransactionData;
import org.apache.fineract.portfolio.loanaccount.service.LoanReadPlatformService;
import org.apache.poi.ss.usermodel.Cell;
@@ -112,7 +113,7 @@ public class LoanRepaymentImportHandler implements ImportHandler {
int successCount = 0;
int errorCount = 0;
String errorMessage = "";
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
for (LoanTransactionData loanRepayment : loanRepayments) {
@@ -32,6 +32,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandler
import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandlerUtils;
import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSerializer;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper;
import org.apache.fineract.organisation.office.data.OfficeData;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.IndexedColors;
@@ -88,7 +89,7 @@ public class OfficeImportHandler implements ImportHandler {
public Count importEntity(String dateFormat) {
Sheet officeSheet = workbook.getSheet(TemplatePopulateImportConstants.OFFICE_SHEET_NAME);
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
int successCount = 0;
@@ -36,6 +36,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSe
import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.EnumOptionDataIdSerializer;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper;
import org.apache.fineract.portfolio.savings.data.RecurringDepositAccountData;
import org.apache.fineract.portfolio.savings.data.SavingsAccountChargeData;
import org.apache.fineract.portfolio.savings.data.SavingsActivation;
@@ -346,7 +347,7 @@ public class RecurringDepositImportHandler implements ImportHandler {
private int importSavingsActivation(Long savingsId, int i, String dateFormat) {
if (activationDates.get(i) != null) {
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
String payload = gsonBuilder.create().toJson(activationDates.get(i));
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
@@ -360,7 +361,7 @@ public class RecurringDepositImportHandler implements ImportHandler {
private int importSavingsApproval(Long savingsId, int i, String dateFormat) {
if (approvalDates.get(i) != null) {
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
String payload = gsonBuilder.create().toJson(approvalDates.get(i));
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
@@ -373,7 +374,7 @@ public class RecurringDepositImportHandler implements ImportHandler {
}
private CommandProcessingResult importSavings(int i, String dateFormat) {
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
gsonBuilder.registerTypeAdapter(EnumOptionData.class, new EnumOptionDataIdSerializer());
JsonObject savingsJsonob = gsonBuilder.create().toJsonTree(savings.get(i)).getAsJsonObject();
@@ -36,6 +36,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSe
import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.SavingsAccountTransactionEnumValueSerialiser;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException;
import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper;
import org.apache.fineract.portfolio.savings.data.SavingsAccountTransactionData;
import org.apache.fineract.portfolio.savings.data.SavingsAccountTransactionEnumData;
import org.apache.poi.ss.usermodel.Cell;
@@ -120,7 +121,7 @@ public class RecurringDepositTransactionImportHandler implements ImportHandler {
int successCount = 0;
int errorCount = 0;
String errorMessage = "";
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
gsonBuilder.registerTypeAdapter(SavingsAccountTransactionEnumData.class, new SavingsAccountTransactionEnumValueSerialiser());
@@ -37,6 +37,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSe
import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.EnumOptionDataIdSerializer;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper;
import org.apache.fineract.portfolio.savings.data.SavingsAccountChargeData;
import org.apache.fineract.portfolio.savings.data.SavingsAccountData;
import org.apache.fineract.portfolio.savings.data.SavingsActivation;
@@ -341,7 +342,7 @@ public class SavingsImportHandler implements ImportHandler {
private int importSavingsActivation(Long savingsId, int i, String dateFormat) {
if (activationDates.get(i) != null) {
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
String payload = gsonBuilder.create().toJson(activationDates.get(i));
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
@@ -355,7 +356,7 @@ public class SavingsImportHandler implements ImportHandler {
private int importSavingsApproval(Long savingsId, int i, String dateFormat) {
if (approvalDates.get(i) != null) {
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
String payload = gsonBuilder.create().toJson(approvalDates.get(i));
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
@@ -368,7 +369,7 @@ public class SavingsImportHandler implements ImportHandler {
}
private CommandProcessingResult importSavings(int i, String dateFormat) {
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
gsonBuilder.registerTypeAdapter(EnumOptionData.class, new EnumOptionDataIdSerializer());
JsonObject savingsJsonob = gsonBuilder.create().toJsonTree(savings.get(i)).getAsJsonObject();
@@ -35,6 +35,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandler
import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSerializer;
import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.SavingsAccountTransactionEnumValueSerialiser;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper;
import org.apache.fineract.portfolio.savings.data.SavingsAccountTransactionData;
import org.apache.fineract.portfolio.savings.data.SavingsAccountTransactionEnumData;
import org.apache.poi.ss.usermodel.Cell;
@@ -119,7 +120,7 @@ public class SavingsTransactionImportHandler implements ImportHandler {
int successCount = 0;
int errorCount = 0;
String errorMessage = "";
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
gsonBuilder.registerTypeAdapter(SavingsAccountTransactionEnumData.class, new SavingsAccountTransactionEnumValueSerialiser());
@@ -33,6 +33,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandler
import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandlerUtils;
import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSerializer;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper;
import org.apache.fineract.portfolio.shareaccounts.data.ShareAccountChargeData;
import org.apache.fineract.portfolio.shareaccounts.data.ShareAccountData;
import org.apache.poi.ss.usermodel.Cell;
@@ -153,7 +154,7 @@ public class SharedAccountImportHandler implements ImportHandler {
int successCount = 0;
int errorCount = 0;
String errorMessage = "";
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
for (ShareAccountData shareAccountData : shareAccountDataList) {
@@ -32,6 +32,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandler
import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandlerUtils;
import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSerializer;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper;
import org.apache.fineract.organisation.staff.data.StaffData;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.IndexedColors;
@@ -101,7 +102,7 @@ public class StaffImportHandler implements ImportHandler {
int successCount = 0;
int errorCount = 0;
String errorMessage = "";
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
for (StaffData staff : staffList) {
try {
@@ -31,6 +31,7 @@ import org.apache.fineract.infrastructure.bulkimport.data.Count;
import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandler;
import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandlerUtils;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper;
import org.apache.fineract.useradministration.data.AppUserData;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.IndexedColors;
@@ -113,7 +114,7 @@ public class UserImportHandler implements ImportHandler {
int successCount = 0;
int errorCount = 0;
String errorMessage = "";
GsonBuilder gsonBuilder = new GsonBuilder();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
for (AppUserData user : users) {
try {
JsonObject userJsonob = gsonBuilder.create().toJsonTree(user).getAsJsonObject();
@@ -28,10 +28,10 @@ import java.time.LocalDate;
import java.time.temporal.ChronoField;
/**
* Serializer for Joda Time {@link LocalDate} that returns the date in array format to match previous Jackson
* Serializer for Java Local Time {@link LocalDate} that returns the date in array format to match previous Jackson
* functionality.
*/
public class JodaLocalDateAdapter implements JsonSerializer<LocalDate> {
public class LocalDateAdapter implements JsonSerializer<LocalDate> {
@Override
@SuppressWarnings("unused")
@@ -0,0 +1,47 @@
/**
* 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.
*/
package org.apache.fineract.infrastructure.core.api;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import java.lang.reflect.Type;
import java.time.LocalTime;
/**
* Serializer for Java Local Time {@link LocalTime} that returns the time in array format to match previous Jackson
* functionality.
*/
public class LocalTimeAdapter implements JsonSerializer<LocalTime> {
@Override
@SuppressWarnings("unused")
public JsonElement serialize(final LocalTime src, final Type typeOfSrc, final JsonSerializationContext context) {
JsonArray array = null;
if (src != null) {
array = new JsonArray();
array.add(new JsonPrimitive(src.getHour()));
array.add(new JsonPrimitive(src.getMinute()));
array.add(new JsonPrimitive(src.getSecond()));
}
return array;
}
}
@@ -22,6 +22,7 @@ import com.google.gson.ExclusionStrategy;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.MonthDay;
import java.time.ZonedDateTime;
import java.util.ArrayList;
@@ -29,8 +30,9 @@ import java.util.HashSet;
import java.util.Set;
import org.apache.fineract.infrastructure.core.api.DateAdapter;
import org.apache.fineract.infrastructure.core.api.JodaDateTimeAdapter;
import org.apache.fineract.infrastructure.core.api.JodaLocalDateAdapter;
import org.apache.fineract.infrastructure.core.api.JodaMonthDayAdapter;
import org.apache.fineract.infrastructure.core.api.LocalDateAdapter;
import org.apache.fineract.infrastructure.core.api.LocalTimeAdapter;
import org.apache.fineract.infrastructure.core.api.ParameterListExclusionStrategy;
import org.apache.fineract.infrastructure.core.api.ParameterListInclusionStrategy;
import org.apache.fineract.infrastructure.core.exception.UnsupportedParameterException;
@@ -42,15 +44,6 @@ import org.springframework.stereotype.Service;
@Service
public final class GoogleGsonSerializerHelper {
public Gson createGsonBuilder(final boolean prettyPrint) {
final GsonBuilder builder = new GsonBuilder();
registerTypeAdapters(builder);
if (prettyPrint) {
builder.setPrettyPrinting();
}
return builder.create();
}
public Gson createGsonBuilderForPartialResponseFiltering(final boolean prettyPrint, final Set<String> responseParameters) {
final ExclusionStrategy strategy = new ParameterListInclusionStrategy(responseParameters);
@@ -99,9 +92,24 @@ public final class GoogleGsonSerializerHelper {
return serializer.toJson(singleDataObject);
}
public static GsonBuilder createGsonBuilder() {
return createGsonBuilder(false);
}
public static GsonBuilder createGsonBuilder(final boolean prettyPrint) {
final GsonBuilder builder = new GsonBuilder();
registerTypeAdapters(builder);
if (prettyPrint) {
builder.setPrettyPrinting();
}
return builder;
}
public static void registerTypeAdapters(final GsonBuilder builder) {
builder.registerTypeAdapter(java.util.Date.class, new DateAdapter());
builder.registerTypeAdapter(LocalDate.class, new JodaLocalDateAdapter());
builder.registerTypeAdapter(LocalDate.class, new LocalDateAdapter());
// NOTE: was missing, necessary for GSON serialization with JDK 17's restrictive module access
builder.registerTypeAdapter(LocalTime.class, new LocalTimeAdapter());
builder.registerTypeAdapter(ZonedDateTime.class, new JodaDateTimeAdapter());
builder.registerTypeAdapter(MonthDay.class, new JodaMonthDayAdapter());
}
+2 -1
View File
@@ -16,5 +16,6 @@
# specific language governing permissions and limitations
# under the License.
#
org.gradle.jvmargs=-Xmx2g
org.gradle.jvmargs=-Xmx2g --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED
buildType=BUILD
org.gradle.caching=true
Binary file not shown.
+1 -1
View File
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+159 -110
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env sh
#!/bin/sh
#
# Copyright 2015 the original author or authors.
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,67 +17,101 @@
#
##############################################################################
##
## Gradle start up script for UN*X
##
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
APP_BASE_NAME=${0##*/}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
MAX_FD=maximum
warn () {
echo "$*"
}
} >&2
die () {
echo
echo "$*"
echo
exit 1
}
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
@@ -106,80 +140,95 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"
+1
View File
@@ -45,6 +45,7 @@ cargo {
}
startStopTimeout = 240000
containerProperties {
property 'cargo.start.jvmargs', '--add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED'
property 'cargo.tomcat.connector.keystoreFile', file("$rootDir/fineract-provider/src/main/resources/keystore.jks")
property 'cargo.tomcat.connector.keystorePass', 'openmf'
property 'cargo.tomcat.httpSecure', true
+1 -1
View File
@@ -20,7 +20,7 @@ dependencies {
// testCompile dependencies are ONLY used in src/test, not src/main.
// Do NOT repeat dependencies which are ALREADY in implementation or runtimeOnly!
//
tomcat 'org.apache.tomcat:tomcat:9.0.54@zip'
tomcat 'org.apache.tomcat:tomcat:9.0.56@zip'
testImplementation( files("$rootDir/fineract-provider/build/classes/java/main/"),
project(path: ':fineract-provider', configuration: 'runtimeElements'),
project(path: ':fineract-client', configuration: 'runtimeElements'),
@@ -76,7 +76,7 @@ public class LoanDisbursementDetailsIntegrationTest {
String withoutInstallmentAmount = "";
String proposedAmount = "10000";
createTranches.add(this.loanTransactionHelper.createTrancheDetail(id, "01 June 2015", "5000"));
createTranches.add(this.loanTransactionHelper.createTrancheDetail(id, "01 Sep 2015", "5000"));
createTranches.add(this.loanTransactionHelper.createTrancheDetail(id, "01 September 2015", "5000"));
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2014");
LOG.info("---------------------------------CLIENT CREATED WITH ID---------------------------------------------------{}", clientID);
+1 -1
View File
@@ -45,7 +45,7 @@ cargo {
}
startStopTimeout = 240000
containerProperties {
property 'cargo.start.jvmargs', '-Dfineract.security.basicauth.enabled=false -Dfineract.security.oauth.enabled=true -Dfineract.security.2fa.enabled=false'
property 'cargo.start.jvmargs', '-Dfineract.security.basicauth.enabled=false -Dfineract.security.oauth.enabled=true -Dfineract.security.2fa.enabled=false --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED'
property 'cargo.tomcat.connector.keystoreFile', file("$rootDir/fineract-provider/src/main/resources/keystore.jks")
property 'cargo.tomcat.connector.keystorePass', 'openmf'
property 'cargo.tomcat.httpSecure', true
+1 -1
View File
@@ -20,7 +20,7 @@ dependencies {
// testCompile dependencies are ONLY used in src/test, not src/main.
// Do NOT repeat dependencies which are ALREADY in implementation or runtimeOnly!
//
tomcat 'org.apache.tomcat:tomcat:9.0.54@zip'
tomcat 'org.apache.tomcat:tomcat:9.0.56@zip'
testImplementation( files("$rootDir/fineract-provider/build/classes/java/main/"),
project(path: ':fineract-provider', configuration: 'runtimeElements'),
'org.junit.jupiter:junit-jupiter-api'
+1 -1
View File
@@ -45,7 +45,7 @@ cargo {
}
startStopTimeout = 240000
containerProperties {
property 'cargo.start.jvmargs', '-Dfineract.security.basicauth.enabled=true -Dfineract.security.oauth.enabled=false -Dfineract.security.2fa.enabled=true'
property 'cargo.start.jvmargs', '-Dfineract.security.basicauth.enabled=true -Dfineract.security.oauth.enabled=false -Dfineract.security.2fa.enabled=true --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED'
property 'cargo.tomcat.connector.keystoreFile', file("$rootDir/fineract-provider/src/main/resources/keystore.jks")
property 'cargo.tomcat.connector.keystorePass', 'openmf'
property 'cargo.tomcat.httpSecure', true
+1 -1
View File
@@ -20,7 +20,7 @@ dependencies {
// testCompile dependencies are ONLY used in src/test, not src/main.
// Do NOT repeat dependencies which are ALREADY in implementation or runtimeOnly!
//
tomcat 'org.apache.tomcat:tomcat:9.0.54@zip'
tomcat 'org.apache.tomcat:tomcat:9.0.56@zip'
testImplementation( files("$rootDir/fineract-provider/build/classes/java/main/"),
project(path: ':fineract-provider', configuration: 'runtimeElements'),
'org.junit.jupiter:junit-jupiter-api',