From d623a431e6f12a637597b8dd6b3f890e836bf1a8 Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Wed, 28 Dec 2016 13:12:20 +0100 Subject: [PATCH] Update build.gradle --- .../Gradle/spring-jpa-persistence/build.gradle | 39 ++++++++++++++-------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/SpringJava/Gradle/spring-jpa-persistence/build.gradle b/SpringJava/Gradle/spring-jpa-persistence/build.gradle index ed6e4d1..abcc14c 100644 --- a/SpringJava/Gradle/spring-jpa-persistence/build.gradle +++ b/SpringJava/Gradle/spring-jpa-persistence/build.gradle @@ -25,6 +25,7 @@ targetCompatibility = 1.8 sourceCompatibility = 1.8 + repositories { mavenCentral() maven { url 'https://dl.bintray.com/palantir/releases' } @@ -85,8 +86,10 @@ dependencies { compile('com.fasterxml.jackson.core:jackson-databind:2.8.1') - // Loading data base in run time - compile("org.liquibase:liquibase-core:3.5.3") + // Loading data base in run time either using liquibase + compile('org.liquibase:liquibase-core:3.5.3') + // or flyway + compile('org.flywaydb:flyway-core:4.0.3') // Jackson Java time support @@ -128,17 +131,6 @@ dependencies { testCompile 'com.palantir.docker.compose:docker-compose-rule:0.28.1' } -sourceSets { - integTest { - compileClasspath += main.output + test.output - runtimeClasspath += main.output + test.output - } -} - -configurations { - integTestCompile.extendsFrom testCompile - integTestRuntime.extendsFrom testRuntime -} test { testLogging { @@ -152,6 +144,22 @@ test { } } + +// ****************** CUSTOM TASK FOR INTEGRATION TESTS (something like maven-failsafe-plugin) ********************* + +sourceSets { + integTest { + compileClasspath += main.output + test.output + runtimeClasspath += main.output + test.output + } +} + +configurations { + integTestCompile.extendsFrom testCompile + integTestRuntime.extendsFrom testRuntime +} + + task integTest(type: Test) { // dependsOn startApp // finalizedBy stopApp @@ -166,6 +174,7 @@ task integTest(type: Test) { // mustRunAfter test } + integTest.doFirst { // It is required in order to run data bases in random ports. // We need it for running tests from IDE and from command console but @@ -184,6 +193,10 @@ dockerCompose { buildBeforeUp = false } +// ************************************************************************************************************************ + + + querydsl { library = 'com.querydsl:querydsl-apt:4.1.3' querydslSourcesDir = "$buildDir/generated-sources/querydsl" -- 2.1.4