From 355f5c800516ef6070295169b927a43d14afb72a Mon Sep 17 00:00:00 2001 From: Jan Schatteman Date: Mon, 8 Jan 2024 23:59:17 +0100 Subject: [PATCH] HHH-17616 - More work related to moving resources Signed-off-by: Jan Schatteman --- .../main/asciidoc/userguide/chapters/events/Events.adoc | 3 ++- .../main/asciidoc/userguide/chapters/schema/Schema.adoc | 2 +- gradle/java-module.gradle | 7 ------- .../org/hibernate/orm/test/propertyref/import.sql | 0 .../org/hibernate/orm/test/schemamanager/data.sql | 0 hibernate-micrometer/hibernate-micrometer.gradle | 2 +- hibernate-spatial/hibernate-spatial.gradle | 2 +- 7 files changed, 5 insertions(+), 11 deletions(-) rename hibernate-core/src/test/{java => resources}/org/hibernate/orm/test/propertyref/import.sql (100%) rename hibernate-core/src/test/{java => resources}/org/hibernate/orm/test/schemamanager/data.sql (100%) diff --git a/documentation/src/main/asciidoc/userguide/chapters/events/Events.adoc b/documentation/src/main/asciidoc/userguide/chapters/events/Events.adoc index e8b9c8e638..d5eb2fc630 100644 --- a/documentation/src/main/asciidoc/userguide/chapters/events/Events.adoc +++ b/documentation/src/main/asciidoc/userguide/chapters/events/Events.adoc @@ -3,6 +3,7 @@ :root-project-dir: ../../../../../../.. :core-project-dir: {root-project-dir}/hibernate-core :example-dir-event: {core-project-dir}/src/test/java/org/hibernate/orm/test/events +:example-dir-event-resources: {core-project-dir}/src/test/resources/org/hibernate/orm/test/events :extrasdir: extras It is useful for the application to react to certain events that occur inside Hibernate. @@ -179,7 +180,7 @@ include::{example-dir-event}/DefaultEntityListener.java[tags=events-default-list [source, XML, indent=0] ---- -include::{example-dir-event}/DefaultEntityListener-orm.xml[tags=events-default-listener-mapping-example] +include::{example-dir-event-resources}/DefaultEntityListener-orm.xml[tags=events-default-listener-mapping-example] ---- ==== diff --git a/documentation/src/main/asciidoc/userguide/chapters/schema/Schema.adoc b/documentation/src/main/asciidoc/userguide/chapters/schema/Schema.adoc index 5749faddbf..61e030b593 100644 --- a/documentation/src/main/asciidoc/userguide/chapters/schema/Schema.adoc +++ b/documentation/src/main/asciidoc/userguide/chapters/schema/Schema.adoc @@ -82,7 +82,7 @@ Considering the following HBM mapping: ==== [source, JAVA, indent=0] ---- -include::{example-dir-schemagen}/SchemaGenerationTest.hbm.xml[] +include::{example-dir-schemagen-resources}/org/hibernate/orm/test/schema/SchemaGenerationTest.hbm.xml[] ---- ==== diff --git a/gradle/java-module.gradle b/gradle/java-module.gradle index cf368d1438..488ef1eb7d 100644 --- a/gradle/java-module.gradle +++ b/gradle/java-module.gradle @@ -246,13 +246,6 @@ tasks.withType( Test.class ).each { test -> sourceSets { test { resources { - // add `src/test/java` as a test-resources dir - configure( srcDir('src/test/java') ) { - filter { - include '**/*.properties' - include '**/*.xml' - } - } configure( srcDir('src/test/resources') ) { filter { include '*.properties' diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/propertyref/import.sql b/hibernate-core/src/test/resources/org/hibernate/orm/test/propertyref/import.sql similarity index 100% rename from hibernate-core/src/test/java/org/hibernate/orm/test/propertyref/import.sql rename to hibernate-core/src/test/resources/org/hibernate/orm/test/propertyref/import.sql diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/schemamanager/data.sql b/hibernate-core/src/test/resources/org/hibernate/orm/test/schemamanager/data.sql similarity index 100% rename from hibernate-core/src/test/java/org/hibernate/orm/test/schemamanager/data.sql rename to hibernate-core/src/test/resources/org/hibernate/orm/test/schemamanager/data.sql diff --git a/hibernate-micrometer/hibernate-micrometer.gradle b/hibernate-micrometer/hibernate-micrometer.gradle index 57e54a41cb..2f93bfd226 100644 --- a/hibernate-micrometer/hibernate-micrometer.gradle +++ b/hibernate-micrometer/hibernate-micrometer.gradle @@ -16,7 +16,7 @@ sourceSets { // resources inherently exclude sources test { resources { - setSrcDirs( ['src/test/java','src/test/resources'] ) + setSrcDirs( ['src/test/resources'] ) } } } diff --git a/hibernate-spatial/hibernate-spatial.gradle b/hibernate-spatial/hibernate-spatial.gradle index 34ba99f164..f178213093 100644 --- a/hibernate-spatial/hibernate-spatial.gradle +++ b/hibernate-spatial/hibernate-spatial.gradle @@ -35,7 +35,7 @@ dependencies { } sourceSets.test.resources { - setSrcDirs( ['src/test/java', 'src/test/resources'] ) + setSrcDirs( ['src/test/resources'] ) } tasks.test {