From f92bffae43d14840d2add28647b8c4c16e9f6687 Mon Sep 17 00:00:00 2001 From: Andrea Boriero Date: Mon, 23 Oct 2017 11:40:23 +0100 Subject: [PATCH] Add gradle task to copy resources to out folder --- build.gradle | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/build.gradle b/build.gradle index 74ada05229..7d1a493ff0 100644 --- a/build.gradle +++ b/build.gradle @@ -268,6 +268,21 @@ subprojects { subProject -> // } } + /* + The latest versions of IntelliJ copy and use the test resources into out/test/resources + this occurs before the placeholder in the test config file are substituted + with the testing values. + + This behaviour prevents the execution of the hibernate tests from inside the IDE. + + A solution is to enable the 'After Build' Execution of the copyResourcesToIntelliJOutFolder task + from the 'Gradle project' IntelliJ tool window ( The task can be found under hibernate-orm > Task > other) + */ + task copyResourcesToIntelliJOutFolder(type: Copy) { + from "$subProject.buildDir/resources/test" + into 'out/test/resources' + } + processTestResources.doLast( { copy { from( sourceSets.test.java.srcDirs ) {