|
|
|
@@ -38,12 +38,12 @@ buildscript {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
|
classpath 'org.gradle.api.plugins:gradle-tomcat-plugin:1.0',
|
|
|
|
|
classpath 'com.bmuschko:gradle-tomcat-plugin:2.5',
|
|
|
|
|
'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0',
|
|
|
|
|
'org.zeroturnaround:gradle-jrebel-plugin:1.1.2',
|
|
|
|
|
'org.springframework.boot:spring-boot-gradle-plugin:1.1.6.RELEASE' // also change springDataJpaVersion above
|
|
|
|
|
'org.springframework.boot:spring-boot-gradle-plugin:2.1.3.RELEASE' // also change springDataJpaVersion below
|
|
|
|
|
classpath "org.apache.openjpa:openjpa:$openJPAVersion"
|
|
|
|
|
classpath 'at.schmutterer.oss.gradle:gradle-openjpa:0.2.0'
|
|
|
|
|
classpath 'com.radcortez.gradle:openjpa-gradle-plugin:3.0.0'
|
|
|
|
|
classpath 'gradle.plugin.org.nosphere.apache:creadur-rat-gradle:0.2.2'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@@ -52,10 +52,10 @@ apply plugin: "org.nosphere.apache.rat"
|
|
|
|
|
apply plugin: 'rebel'
|
|
|
|
|
apply plugin: 'license'
|
|
|
|
|
apply plugin: 'war'
|
|
|
|
|
apply plugin: 'spring-boot'
|
|
|
|
|
apply plugin: 'org.springframework.boot'
|
|
|
|
|
apply plugin: 'eclipse'
|
|
|
|
|
apply plugin: 'idea'
|
|
|
|
|
apply plugin: 'tomcat'
|
|
|
|
|
apply plugin: 'com.bmuschko.tomcat'
|
|
|
|
|
apply plugin: 'project-report'
|
|
|
|
|
apply plugin: 'java'
|
|
|
|
|
apply plugin: 'openjpa'
|
|
|
|
@@ -76,13 +76,12 @@ repositories {
|
|
|
|
|
jcenter()
|
|
|
|
|
// mavenLocal() // useful for local dev using MariaDB4j SNAPSHOTs (not needed for real-world non-SNAPHOT builds)
|
|
|
|
|
}
|
|
|
|
|
openjpa {
|
|
|
|
|
files = fileTree(sourceSets.main.output.classesDir).matching {
|
|
|
|
|
include '**/AbstractPersistableCustom.class'
|
|
|
|
|
include '**/domain/*.class'
|
|
|
|
|
|
|
|
|
|
openjpa {
|
|
|
|
|
includes = ['**/AbstractPersistableCustom.class', '**/domain/*.class']
|
|
|
|
|
enhance {
|
|
|
|
|
enforcePropertyRestrictions true
|
|
|
|
|
}
|
|
|
|
|
enforcePropertyRestrictions = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rat {
|
|
|
|
@@ -188,6 +187,7 @@ configurations {
|
|
|
|
|
}
|
|
|
|
|
runtime
|
|
|
|
|
all*.exclude group: 'commons-logging'
|
|
|
|
|
all*.exclude module: 'jul-to-slf4j' // see FINERACT-700 re. ClassCircularityError: java/util/logging/LogRecord
|
|
|
|
|
}
|
|
|
|
|
/* Pick up dependencies based on the environemnt, defaults to production */
|
|
|
|
|
if (project.hasProperty('env') && project.getProperty('env') == 'dev') {
|
|
|
|
@@ -294,7 +294,7 @@ war {
|
|
|
|
|
from('../DISCLAIMER') { // notice the parens
|
|
|
|
|
into "WEB-INF/" // no leading slash
|
|
|
|
|
}
|
|
|
|
|
war.finalizedBy(bootRepackage)
|
|
|
|
|
war.finalizedBy(bootWar)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
license {
|
|
|
|
@@ -328,9 +328,26 @@ tomcatRunWar {
|
|
|
|
|
configFile = file('src/test/resources/META-INF/context.xml')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
task tomcatRunWarAsDaemonForIntegrationTest(type: com.bmuschko.gradle.tomcat.tasks.TomcatRunWar) {
|
|
|
|
|
httpPort = 8080
|
|
|
|
|
httpsPort = 8443
|
|
|
|
|
stopPort = 8081
|
|
|
|
|
stopKey= 'stopKey'
|
|
|
|
|
enableSSL = true
|
|
|
|
|
keystoreFile = file('src/main/resources/keystore.jks')
|
|
|
|
|
keystorePass = 'openmf'
|
|
|
|
|
configFile = file('src/test/resources/META-INF/context.xml')
|
|
|
|
|
daemon = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
task tomcatStopAfterIntegrationTest(type: com.bmuschko.gradle.tomcat.tasks.TomcatStop) {
|
|
|
|
|
stopPort = 8081
|
|
|
|
|
stopKey = 'stopKey'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* http://stackoverflow.com/questions/19653311/jpa-repository-works-in-idea-and-production-but-not-in-gradle */
|
|
|
|
|
sourceSets.main.output.resourcesDir = sourceSets.main.output.classesDir
|
|
|
|
|
sourceSets.test.output.resourcesDir = sourceSets.test.output.classesDir
|
|
|
|
|
sourceSets.main.output.resourcesDir = sourceSets.main.java.outputDir
|
|
|
|
|
sourceSets.test.output.resourcesDir = sourceSets.test.java.outputDir
|
|
|
|
|
|
|
|
|
|
/* Exclude maria db and embedded tomcat related files for non dev builds */
|
|
|
|
|
if (!(project.hasProperty('env') && project.getProperty('env') == 'dev')) {
|
|
|
|
@@ -362,14 +379,14 @@ configurations {
|
|
|
|
|
integrationTestRuntime.extendsFrom testRuntime
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
task integrationTest(type:Test){
|
|
|
|
|
description = "Run integration tests (located in src/integrationTest/java). Starts tomcat in daemon mode before executing the tests."
|
|
|
|
|
it.dependsOn war
|
|
|
|
|
doFirst {
|
|
|
|
|
tomcatRunWar.daemon = true
|
|
|
|
|
tomcatRunWar.execute()
|
|
|
|
|
}
|
|
|
|
|
testClassesDir = project.sourceSets.integrationTest.output.classesDir
|
|
|
|
|
task integrationTest(type:Test) {
|
|
|
|
|
description = "Run integration tests (located in src/integrationTest/java). Starts Tomcat in daemon mode before executing the tests (and stops it after)."
|
|
|
|
|
dependsOn war
|
|
|
|
|
dependsOn tomcatRunWarAsDaemonForIntegrationTest
|
|
|
|
|
tasks.findByName('tomcatRunWarAsDaemonForIntegrationTest').mustRunAfter 'war'
|
|
|
|
|
finalizedBy tomcatStopAfterIntegrationTest
|
|
|
|
|
|
|
|
|
|
testClassesDirs = project.sourceSets.integrationTest.output.classesDirs
|
|
|
|
|
classpath = project.sourceSets.integrationTest.runtimeClasspath
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -391,21 +408,27 @@ configurations.driver.each {File file ->
|
|
|
|
|
loader.addURL(file.toURL())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
task createDB<<{
|
|
|
|
|
task createDB {
|
|
|
|
|
description= "Creates the Database. Needs database name to be passed (like: -PdbName=someDBname)"
|
|
|
|
|
def sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' )
|
|
|
|
|
sql.execute( 'create database '+"`$dbName`" )
|
|
|
|
|
doLast {
|
|
|
|
|
def sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' )
|
|
|
|
|
sql.execute( 'create database '+"`$dbName`" )
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
task dropDB<<{
|
|
|
|
|
task dropDB {
|
|
|
|
|
description= "Drops the specified database. The database name has to be passed (like: -PdbName=someDBname)"
|
|
|
|
|
def sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' )
|
|
|
|
|
sql.execute( 'DROP DATABASE '+"`$dbName`")
|
|
|
|
|
doLast {
|
|
|
|
|
def sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' )
|
|
|
|
|
sql.execute( 'DROP DATABASE '+"`$dbName`")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
task setBlankPassword<<{
|
|
|
|
|
def sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' )
|
|
|
|
|
sql.execute('USE `mifosplatform-tenants`')
|
|
|
|
|
sql.execute('UPDATE mifosplatform-tenants.tenants SET schema_server = \'localhost\', schema_server_port = \'3306\', schema_username = \'mifos\', schema_password = \'mysql\' WHERE id=1;')
|
|
|
|
|
task setBlankPassword {
|
|
|
|
|
doLast {
|
|
|
|
|
def sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' )
|
|
|
|
|
sql.execute('USE `mifosplatform-tenants`')
|
|
|
|
|
sql.execute('UPDATE mifosplatform-tenants.tenants SET schema_server = \'localhost\', schema_server_port = \'3306\', schema_username = \'mifos\', schema_password = \'mysql\' WHERE id=1;')
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -428,8 +451,8 @@ def qualifyVersionIfNecessary(version) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
springBoot {
|
|
|
|
|
mainClass = 'org.apache.fineract.ServerWithMariaDB4jApplication'
|
|
|
|
|
mainClassName = 'org.apache.fineract.ServerWithMariaDB4jApplication'
|
|
|
|
|
}
|
|
|
|
|
bootRepackage {
|
|
|
|
|
mainClass = 'org.apache.fineract.ServerWithMariaDB4jApplication'
|
|
|
|
|
bootWar {
|
|
|
|
|
mainClassName = 'org.apache.fineract.ServerWithMariaDB4jApplication'
|
|
|
|
|
}
|
|
|
|
|