diff --git a/hibernate-core/src/test/java/org/hibernate/jpa/test/cdi/BasicCdiTest.java b/hibernate-core/src/test/java/org/hibernate/jpa/test/cdi/BasicCdiTest.java
index 8ee9d3fb2b..56169ef9ad 100644
--- a/hibernate-core/src/test/java/org/hibernate/jpa/test/cdi/BasicCdiTest.java
+++ b/hibernate-core/src/test/java/org/hibernate/jpa/test/cdi/BasicCdiTest.java
@@ -51,6 +51,7 @@ public class BasicCdiTest {
.addClass( EventQueue.class )
.addClass( Event.class )
.addClass( Monitor.class )
+ .addAsManifestResource( "jboss-deployment-structure.xml" )
.addAsManifestResource( EmptyAsset.INSTANCE, "beans.xml" )
.addAsManifestResource( new StringAsset( persistenceXml().exportAsString() ), "persistence.xml" );
}
diff --git a/hibernate-core/src/test/java/org/hibernate/jpa/test/cdi/extended/ConversationalPersistenceContextExtendedTest.java b/hibernate-core/src/test/java/org/hibernate/jpa/test/cdi/extended/ConversationalPersistenceContextExtendedTest.java
index 1d62b26111..ae6e503fba 100644
--- a/hibernate-core/src/test/java/org/hibernate/jpa/test/cdi/extended/ConversationalPersistenceContextExtendedTest.java
+++ b/hibernate-core/src/test/java/org/hibernate/jpa/test/cdi/extended/ConversationalPersistenceContextExtendedTest.java
@@ -37,6 +37,7 @@ public class ConversationalPersistenceContextExtendedTest {
.addClass( Event.class )
.addClass( ConversationalEventManager.class )
.addAsManifestResource( EmptyAsset.INSTANCE, "beans.xml" )
+ .addAsManifestResource( "jboss-deployment-structure.xml" )
.addAsManifestResource( new StringAsset( persistenceXml().exportAsString() ), "persistence.xml" );
}
diff --git a/hibernate-core/src/test/java/org/hibernate/jpa/test/cdi/extended/ManualFlushConversationalPersistenceContextExtendedTest.java b/hibernate-core/src/test/java/org/hibernate/jpa/test/cdi/extended/ManualFlushConversationalPersistenceContextExtendedTest.java
index b9df53f57c..3ee578a0c1 100644
--- a/hibernate-core/src/test/java/org/hibernate/jpa/test/cdi/extended/ManualFlushConversationalPersistenceContextExtendedTest.java
+++ b/hibernate-core/src/test/java/org/hibernate/jpa/test/cdi/extended/ManualFlushConversationalPersistenceContextExtendedTest.java
@@ -38,6 +38,7 @@ public class ManualFlushConversationalPersistenceContextExtendedTest {
.addClass( Event.class )
.addClass( ManualFlushConversationalEventManager.class )
.addAsManifestResource( EmptyAsset.INSTANCE, "beans.xml" )
+ .addAsManifestResource( "jboss-deployment-structure.xml" )
.addAsManifestResource( new StringAsset( persistenceXml().exportAsString() ), "persistence.xml" );
}
diff --git a/hibernate-core/src/test/java/org/hibernate/jpa/test/cdi/extended/NonConversationalPersistenceContextExtendedTest.java b/hibernate-core/src/test/java/org/hibernate/jpa/test/cdi/extended/NonConversationalPersistenceContextExtendedTest.java
index 8842c47a9b..aa2e68a0b5 100644
--- a/hibernate-core/src/test/java/org/hibernate/jpa/test/cdi/extended/NonConversationalPersistenceContextExtendedTest.java
+++ b/hibernate-core/src/test/java/org/hibernate/jpa/test/cdi/extended/NonConversationalPersistenceContextExtendedTest.java
@@ -37,6 +37,7 @@ public class NonConversationalPersistenceContextExtendedTest {
.addClass( Event.class )
.addClass( NonConversationalEventManager.class )
.addAsManifestResource( EmptyAsset.INSTANCE, "beans.xml" )
+ .addAsManifestResource( "jboss-deployment-structure.xml" )
.addAsManifestResource( new StringAsset( persistenceXml().exportAsString() ), "persistence.xml" );
}
diff --git a/hibernate-core/src/test/java/org/hibernate/test/wf/ddl/bmt/emf/DdlInWildFlyUsingBmtAndEmfTest.java b/hibernate-core/src/test/java/org/hibernate/test/wf/ddl/bmt/emf/DdlInWildFlyUsingBmtAndEmfTest.java
index 9bd5cea265..42c0f24f7a 100644
--- a/hibernate-core/src/test/java/org/hibernate/test/wf/ddl/bmt/emf/DdlInWildFlyUsingBmtAndEmfTest.java
+++ b/hibernate-core/src/test/java/org/hibernate/test/wf/ddl/bmt/emf/DdlInWildFlyUsingBmtAndEmfTest.java
@@ -54,6 +54,7 @@ public class DdlInWildFlyUsingBmtAndEmfTest {
.setManifest( "org/hibernate/test/wf/ddl/manifest.mf" )
.addClass( WildFlyDdlEntity.class )
// .addAsManifestResource( EmptyAsset.INSTANCE, "beans.xml")
+ .addAsWebInfResource( "jboss-deployment-structure.xml" ) //Add as "web-inf" resource on Web archives
.addAsResource( new StringAsset( persistenceXml().exportAsString() ), PERSISTENCE_XML_RESOURCE_NAME )
.addAsResource( "org/hibernate/test/wf/ddl/log4j.properties", "log4j.properties" );
System.out.println( war.toString(true) );
diff --git a/hibernate-core/src/test/java/org/hibernate/test/wf/ddl/cmt/emf/DdlInWildFlyUsingBmtAndEmfTest.java b/hibernate-core/src/test/java/org/hibernate/test/wf/ddl/cmt/emf/DdlInWildFlyUsingBmtAndEmfTest.java
index 61c4f123f9..c59c78b176 100644
--- a/hibernate-core/src/test/java/org/hibernate/test/wf/ddl/cmt/emf/DdlInWildFlyUsingBmtAndEmfTest.java
+++ b/hibernate-core/src/test/java/org/hibernate/test/wf/ddl/cmt/emf/DdlInWildFlyUsingBmtAndEmfTest.java
@@ -52,6 +52,7 @@ public class DdlInWildFlyUsingBmtAndEmfTest {
.setManifest( "org/hibernate/test/wf/ddl/manifest.mf" )
.addClass( WildFlyDdlEntity.class )
// .addAsManifestResource( EmptyAsset.INSTANCE, "beans.xml")
+ .addAsWebInfResource( "jboss-deployment-structure.xml" ) //Add as "web-inf" resource on Web archives
.addAsResource( new StringAsset( persistenceXml().exportAsString() ), PERSISTENCE_XML_RESOURCE_NAME )
.addAsResource( "org/hibernate/test/wf/ddl/log4j.properties", "log4j.properties" );
System.out.println( war.toString(true) );
diff --git a/hibernate-core/src/test/resources/jboss-deployment-structure.xml b/hibernate-core/src/test/resources/jboss-deployment-structure.xml
new file mode 100644
index 0000000000..7bcb4a3cc8
--- /dev/null
+++ b/hibernate-core/src/test/resources/jboss-deployment-structure.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/hibernate-orm-modules/src/main/modules/org/hibernate/core/module.xml b/hibernate-orm-modules/src/main/modules/org/hibernate/core/module.xml
index 6db62d8496..8e8fe41415 100644
--- a/hibernate-orm-modules/src/main/modules/org/hibernate/core/module.xml
+++ b/hibernate-orm-modules/src/main/modules/org/hibernate/core/module.xml
@@ -14,7 +14,6 @@
-
@@ -25,10 +24,6 @@
-
-
diff --git a/hibernate-orm-modules/src/main/modules/org/hibernate/jipijapa-hibernate5/module.xml b/hibernate-orm-modules/src/main/modules/org/hibernate/jipijapa-hibernate5/module.xml
index 88cc9e22d0..6b43d43a2f 100644
--- a/hibernate-orm-modules/src/main/modules/org/hibernate/jipijapa-hibernate5/module.xml
+++ b/hibernate-orm-modules/src/main/modules/org/hibernate/jipijapa-hibernate5/module.xml
@@ -16,8 +16,6 @@
-
-
@@ -25,9 +23,6 @@
-
-
-
diff --git a/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/integrationtest/HibernateEnversOnWildflyTest.java b/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/integrationtest/HibernateEnversOnWildflyTest.java
index 05178337d4..da71740390 100644
--- a/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/integrationtest/HibernateEnversOnWildflyTest.java
+++ b/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/integrationtest/HibernateEnversOnWildflyTest.java
@@ -44,6 +44,7 @@ public class HibernateEnversOnWildflyTest {
return ShrinkWrap.create( WebArchive.class )
.addClass( AuditedEntity.class )
.addAsWebInfResource( EmptyAsset.INSTANCE, "beans.xml" )
+ .addAsWebInfResource( "jboss-deployment-structure.xml" )
.addAsResource( new StringAsset( persistenceXml().exportAsString() ), "META-INF/persistence.xml" );
}
diff --git a/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/integrationtest/HibernateModulesOnWildflyTest.java b/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/integrationtest/HibernateModulesOnWildflyTest.java
index f35dd758ed..b1a850a844 100644
--- a/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/integrationtest/HibernateModulesOnWildflyTest.java
+++ b/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/integrationtest/HibernateModulesOnWildflyTest.java
@@ -45,6 +45,7 @@ public class HibernateModulesOnWildflyTest {
return ShrinkWrap.create( WebArchive.class )
.addClass( Kryptonite.class )
.addAsWebInfResource( EmptyAsset.INSTANCE, "beans.xml" )
+ .addAsWebInfResource( "jboss-deployment-structure.xml" )
.addAsResource( new StringAsset( persistenceXml().exportAsString() ), "META-INF/persistence.xml" );
}
diff --git a/hibernate-orm-modules/src/test/resources/jboss-deployment-structure.xml b/hibernate-orm-modules/src/test/resources/jboss-deployment-structure.xml
new file mode 100644
index 0000000000..7bcb4a3cc8
--- /dev/null
+++ b/hibernate-orm-modules/src/test/resources/jboss-deployment-structure.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+