michaelbukachi commented on a change in pull request #525: FINERACT-700:
upgrade Gradle from 2.10 to 5.2.1
URL: https://github.com/apache/fineract/pull/525#discussion_r259505963
##########
File path: fineract-provider/build.gradle
##########
@@ -364,7 +363,7 @@ task integrationTest(type:Test){
tomcatRunWar.daemon = true
tomcatRunWar.execute()
Review comment:
I tinkered a bit using the specified `gradle 5.2.1` and discovered that the
specified flyway plugin `3.0` is not compatible with the gradle version due to
the above mentioned error. I discovered that in flyway `3.1` they added a new
feature where one can override `FlywayTask` so implementing the flyway tasks
using the below format would get rid of the `TaskInternal.execute()` error:
```
task migrateTenantListDB(type: org.flywaydb.gradle.task.FlywayMigrateTask) {
description="Migrates a Tenant List DB. Optionally can pass dbName.
Defaults to 'mifosplatform-tenants' (Example: -PdbName=someDBname)"
def filePath = "filesystem:$projectDir" +
'/src/main/resources/sql/migrations/list_db'
def tenantsDbName = 'mifosplatform-tenants';
if (rootProject.hasProperty("dbName")) {
tenantsDbName = rootProject.getProperty("dbName")
}
extension = new org.flywaydb.gradle.FlywayExtension()
extension.url= "jdbc:mysql:thin://localhost:3306/$tenantsDbName"
extension.driver = "org.drizzle.jdbc.DrizzleDriver"
extension.user = 'root'
extension.password = '.....'
extension.locations= [filePath]
}
```
However, in gradle `5.0` the property `sourceSet.output.classesDir` was
removed in favour of `sourceSet.output.classesDirs`. You'll notice that in the
internal implementation of Flyway 3.1
[here](https://github.com/flyway/flyway/blob/f7fa24196789e2cbcc5ffffb409b5eca2c629846/flyway-gradle-plugin/src/main/groovy/org/flywaydb/gradle/task/AbstractFlywayTask.groovy)
the propety `classesDir` is still being used:
```
def runTask() {
if (isJavaProject()) {
def classLoader = Thread.currentThread().getContextClassLoader()
project.sourceSets.each {
def classesUrl = it.output.classesDir.toURI().toURL()
<----------
logger.debug("Adding directory to Classpath: " + classesUrl)
classLoader.addURL(classesUrl)
...............
}
```
Flyway `5.0.0` was corrected to support both `classesDir` and `classesDirs`,
however, it doesn't seem to be compatible with `drizzle-jdbc`; even the latest
version `1.4`. I tried the default `mysql-connector` but it always threw a
bunch of errors during migration. Some are show below:
```
DB: Unknown table 'acc_gl_account' (SQL State: 42S02 - Error Code: 1051)
DB: Unknown table 'acc_gl_closure' (SQL State: 42S02 - Error Code: 1051)
DB: Unknown table 'acc_gl_journal_entry' (SQL State: 42S02 - Error Code:
1051)
DB: Unknown table 'acc_product_mapping' (SQL State: 42S02 - Error Code: 1051)
DB: Unknown table 'c_configuration' (SQL State: 42S02 - Error Code: 1051)
DB: Unknown table 'm_appuser' (SQL State: 42S02 - Error Code: 1051)
DB: Unknown table 'm_appuser_role' (SQL State: 42S02 - Error Code: 1051)
DB: Unknown table 'm_calendar' (SQL State: 42S02 - Error Code: 1051)
DB: Unknown table 'm_calendar_instance' (SQL State: 42S02 - Error Code: 1051)
DB: Unknown table 'm_charge' (SQL State: 42S02 - Error Code: 1051)
DB: Unknown table 'm_client' (SQL State: 42S02 - Error Code: 1051)
DB: Unknown table 'm_client_identifier' (SQL State: 42S02 - Error Code: 1051)
DB: Unknown table 'm_code' (SQL State: 42S02 - Error Code: 1051)
DB: Unknown table 'm_code_value' (SQL State: 42S02 - Error Code: 1051)
DB: Unknown table 'm_currency' (SQL State: 42S02 - Error Code: 1051)
DB: Unknown table 'm_deposit_account' (SQL State: 42S02 - Error Code: 1051)
DB: Unknown table 'm_deposit_account_transaction' (SQL State: 42S02 - Error
Code: 1051)
DB: Unknown table 'm_document' (SQL State: 42S02 - Error Code: 1051)
DB: Unknown table 'm_fund' (SQL State: 42S02 - Error Code: 1051)
DB: Unknown table 'm_group' (SQL State: 42S02 - Error Code: 1051)
DB: Unknown table 'm_group_level' (SQL State: 42S02 - Error Code: 1051)
DB: Unknown table 'm_group_client' (SQL State: 42S02 - Error Code: 1051)
DB: Unknown table 'm_guarantor' (SQL State: 42S02 - Error Code: 1051)
DB: Unknown table 'm_loan' (SQL State: 42S02 - Error Code: 1051)
DB: Unknown table 'm_loan_charge' (SQL State: 42S02 - Error Code: 1051)
DB: Unknown table 'm_loan_arrears_aging' (SQL State: 42S02 - Error Code:
1051)
DB: Unknown table 'm_loan_collateral' (SQL State: 42S02 - Error Code: 1051)
DB: Unknown table 'm_loan_officer_assignment_history' (SQL State: 42S02 -
Error Code: 1051)
DB: Unknown table 'm_loan_repayment_schedule' (SQL State: 42S02 - Error
Code: 1051)
DB: Unknown table 'm_loan_transaction' (SQL State: 42S02 - Error Code: 1051)
DB: No data - zero rows fetched, selected, or processed (SQL State: 02000 -
Error Code: 1329)
DB: No data - zero rows fetched, selected, or processed (SQL State: 02000 -
Error Code: 1329)
DB: No data - zero rows fetched, selected, or processed (SQL State: 02000 -
Error Code: 1329)
DB: No data - zero rows fetched, selected, or processed (SQL State: 02000 -
Error Code: 1329)
DB: Unknown table 'm_template' (SQL State: 42S02 - Error Code: 1051)
DB: Unknown table 'm_templatemappers' (SQL State: 42S02 - Error Code: 1051)
DB: Unknown table 'm_template_m_templatemappers' (SQL State: 42S02 - Error
Code: 1051)
DB: Unknown table 'sms_messages_outbound' (SQL State: 42S02 - Error Code:
1051)
DB: Data truncated for column 'last_time_password_updated' at row 1 (SQL
State: 01000 - Error Code: 1265)
DB: You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near '--Journal
entries also refer to Client transactions
```
To remove those errors changes will have to be made the `.sql` files.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services