Merge pull request #582 from apache/FINERACT-761_LEGAL-462_use-MariaDB-ConnectorJ-instead-Drizzle-in-build

use MariaDB ConnectorJ instead of Drizzle MySQL JDBC driver -only- during build for Flyway (fixes FINERACT-761)
This commit is contained in:
Vishwas Babu A J
2019-06-12 21:27:13 -07:00
committed by GitHub
2 changed files with 35 additions and 13 deletions
+10
View File
@@ -45,6 +45,16 @@ License
This project is licensed under Apache License Version 2.0. See <https://github.com/apache/incubator-fineract/blob/develop/LICENSE.md> for referece.
The Connector/J JDBC Driver client library from MariaDB.org, which is licensed under the LGPL,
is used in development when running integration tests that use the Flyway library. That JDBC
driver is however not included in and distributed with the Fineract product, and is not
required to use the product.
If you are developer and object to using the LGPL licensed Connector/J JDBC driver,
simply do not run the integration tests that use the Flyway library.
As discussed in [LEGAL-462](https://issues.apache.org/jira/browse/LEGAL-462), this project therefore
complies with the [Apache Software Foundation third-party license policy](https://www.apache.org/legal/resolved.html).
Apache Fineract Platform API
============
+25 -13
View File
@@ -424,14 +424,26 @@ buildscript {
dependencies {
classpath "org.flywaydb:flyway-gradle-plugin:3.0" // version upgraded during Spring Boot & MariaDB4j work, as prev. used v0.2 didn't work well after *.sql moved from fineract-db to fineract-provider/src/main/resources (new version also has clearer errors, e.g. in case of missing DB)
classpath 'org.drizzle.jdbc:drizzle-jdbc:1.3'
// NOT classpath 'org.drizzle.jdbc:drizzle-jdbc:1.3' as it is not compatible with Flyway 3.1+ (only up to 3.0)
// We require Flyway 3.1+ because =< 3.0 is not compatible with current Gradle versions (only ancient ones we originally used to use).
// Using LGPL ConnectorJ ()org.mariadb.jdbc:mariadb-java-client) instead of the BSD licensed drizzle-jdbc *IS OK* at Apache.org,
// as long as it's only used as a test library by developers at build time, and not end-user distributed, and optional.
// So it's OK here, but would not be as a default runtime dependency and in the dist JAR/WAR.
// see https://issues.apache.org/jira/browse/LEGAL-462
// see https://issues.apache.org/jira/browse/FINERACT-761
// see https://github.com/flyway/flyway/issues/2332
// see https://github.com/krummas/DrizzleJDBC/issues/46
// see https://github.com/apache/fineract/pull/525
// see https://github.com/apache/fineract/pull/550
classpath 'org.mariadb.jdbc:mariadb-java-client:2.4.1'
}
}
flyway {
url = "jdbc:mysql:thin://localhost:3306/mifostenant-default"
driver = "org.drizzle.jdbc.DrizzleDriver"
url = "jdbc:mariadb://localhost:3306/mifostenant-default"
driver = "org.mariadb.jdbc.Driver"
user = mysqlUser
password = mysqlPassword
}
@@ -445,8 +457,8 @@ task migrateTenantDB<<{
tenantDbName = rootProject.getProperty("dbName")
}
flyway.url= "jdbc:mysql:thin://localhost:3306/$tenantDbName"
flyway.driver = "org.drizzle.jdbc.DrizzleDriver"
flyway.url= "jdbc:mariadb://localhost:3306/$tenantDbName"
flyway.driver = "org.mariadb.jdbc.Driver"
flyway.locations= [filePath]
/**We use ${ as the prefix for strecthy reporting, do not want them to be interpreted by Flyway**/
flyway.placeholderPrefix = "\$\${"
@@ -462,8 +474,8 @@ task showTenantDBInfo<<{
tenantDbName = rootProject.getProperty("dbName")
}
flyway.url= "jdbc:mysql:thin://localhost:3306/$tenantDbName"
flyway.driver = "org.drizzle.jdbc.DrizzleDriver"
flyway.url= "jdbc:mariadb://localhost:3306/$tenantDbName"
flyway.driver = "org.mariadb.jdbc.Driver"
flyway.locations= [filePath]
flywayInfo.execute()
}
@@ -478,8 +490,8 @@ task migrateTenantListDB<<{
tenantsDbName = rootProject.getProperty("dbName")
}
flyway.url= "jdbc:mysql:thin://localhost:3306/$tenantsDbName"
flyway.driver = "org.drizzle.jdbc.DrizzleDriver"
flyway.url= "jdbc:mariadb://localhost:3306/$tenantsDbName"
flyway.driver = "org.mariadb.jdbc.Driver"
flyway.locations= [filePath]
flywayMigrate.execute()
@@ -494,8 +506,8 @@ task showTenantListDBInfo<<{
tenantsDbName = rootProject.getProperty("dbName")
}
flyway.url= "jdbc:mysql:thin://localhost:3306/$tenantsDbName"
flyway.driver = "org.drizzle.jdbc.DrizzleDriver"
flyway.url= "jdbc:mariadb://localhost:3306/$tenantsDbName"
flyway.driver = "org.mariadb.jdbc.Driver"
flyway.locations= [filePath]
flywayInfo.execute()
}
@@ -509,8 +521,8 @@ task repairTenantDB<<{
tenantsDbName = rootProject.getProperty("dbName")
}
flyway.url= "jdbc:mysql:thin://localhost:3306/$tenantsDbName"
flyway.driver = "org.drizzle.jdbc.DrizzleDriver"
flyway.url= "jdbc:mariadb://localhost:3306/$tenantsDbName"
flyway.driver = "org.mariadb.jdbc.Driver"
flyway.locations= [filePath]
flywayRepair.execute()
}