Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OGM-1523 Use WildFly 14 default Hibernate Search and ORM #1100

Merged
merged 2 commits into from Nov 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions bom/pom.xml
Expand Up @@ -46,7 +46,7 @@
See http://search.maven.org/#search|gav|1|g%3A"org.wildfly"%20AND%20a%3A"wildfly-parent"
-->

<version.wildfly>13.0.0.Final</version.wildfly>
<version.wildfly>14.0.1.Final</version.wildfly>
<version.org.hibernate.commons.annotations>5.0.3.Final</version.org.hibernate.commons.annotations>
<version.org.jboss.logging.jboss-logging>3.3.2.Final</version.org.jboss.logging.jboss-logging>
<version.org.jboss.logging.jboss-logging-tools>2.1.0.Final</version.org.jboss.logging.jboss-logging-tools>
Expand All @@ -59,7 +59,7 @@
<version.org.jboss.spec.javax.transaction.jboss-transaction-api_1.2_spec>1.0.1.Final</version.org.jboss.spec.javax.transaction.jboss-transaction-api_1.2_spec>
<version.org.jboss.jboss-transaction-spi>7.6.0.Final</version.org.jboss.jboss-transaction-spi>
<version.org.jboss.narayana>5.5.30.Final</version.org.jboss.narayana>
<version.wildfly.nosql>1.0.0.Beta1</version.wildfly.nosql>
<version.wildfly.nosql>1.0.1.Final</version.wildfly.nosql>

<!-- Infinispan -->

Expand Down
1 change: 0 additions & 1 deletion documentation/manual/pom.xml
Expand Up @@ -177,7 +177,6 @@
<hibernate-orm-version>${version.org.hibernate}</hibernate-orm-version>
<hibernate-orm-major-minor-version>${parsed-version.org.hibernate.majorVersion}.${parsed-version.org.hibernate.minorVersion}</hibernate-orm-major-minor-version>
<hibernate-search-version>${version.org.hibernate.search}</hibernate-search-version>
<hibernate-search-module-slot>${module-slot.org.hibernate.search.short-id}</hibernate-search-module-slot>
<hibernate-search-major-minor-version>${parsed-version.org.hibernate.search.majorVersion}.${parsed-version.org.hibernate.search.minorVersion}</hibernate-search-major-minor-version>
<infinispan-version>${version.org.infinispan}</infinispan-version>
<jboss-jta-version>${version.org.jboss.narayana}</jboss-jta-version>
Expand Down
Expand Up @@ -369,11 +369,16 @@ This is the default behaviour, but you are in control and can override this all;
see the https://docs.jboss.org/author/display/WFLY10/JPA+Reference+Guide[WildFly JPA Reference Guide]
for a full list of properties you can explicitly set.

WildFly {wildfly-short-version} however does not include Hibernate OGM and the compatible Hibernate ORM and Hibernate Search
versions and it will require some configuration to make everything works.
WildFly {wildfly-short-version} however does not include Hibernate OGM and it will require some configuration to make everything works.

Hibernate OGM {hibernate-ogm-version} requires Hibernate ORM {hibernate-orm-version} and Hibernate Search {hibernate-search-version}.

[NOTE]
====
Unlike other versions, WildFly {wildfly-short-version} includes the compatible versions of Hibernate ORM and Hibernate Search.
So that, it will no longer necessary to install extra Hibrnate Search modules.
====

===== Server provisioning via Maven

Maven users can use the `wildfly-server-provisioning-maven-plugin`
Expand Down Expand Up @@ -413,39 +418,32 @@ You will also need a `server-provisioning.xml` in the root of your project:
<server-provisioning xmlns="urn:wildfly:server-provisioning:1.1">
<feature-packs>

<feature-pack
groupId="org.hibernate"
artifactId="hibernate-search-jbossmodules-orm"
version="{hibernate-search-version}" /> # <1>

<feature-pack
groupId="org.hibernate.ogm"
artifactId="hibernate-ogm-featurepack-infinispan-remote"
version="{hibernate-ogm-version}" /> # <2>
version="{hibernate-ogm-version}" /> # <1>

<feature-pack
groupId="org.hibernate.ogm"
artifactId="hibernate-ogm-featurepack-infinispan-embedded"
version="{hibernate-ogm-version}" /> # <2>
version="{hibernate-ogm-version}" /> # <1>

<feature-pack
groupId="org.hibernate.ogm"
artifactId="hibernate-ogm-featurepack-mongodb"
version="{hibernate-ogm-version}" /> # <2>
version="{hibernate-ogm-version}" /> # <1>

<feature-pack
groupId="org.hibernate.ogm"
artifactId="hibernate-ogm-featurepack-neo4j"
version="{hibernate-ogm-version}" /> # <2>
version="{hibernate-ogm-version}" /> # <1>

</feature-packs>
</server-provisioning>
----
<1> Add Hibernate Search feature pack, if you need it.
<2> Add one or more Hibernate OGM feature packs, it depends on which dialects your application needs.
<1> Add one or more Hibernate OGM feature packs, it depends on which dialects your application needs.
====

. See https://docs.jboss.org/hibernate/search/5.10/reference/en-US/html_single/#hibernatesearch-jboss-modules-feature-packs[list of available Hibernate Search feature packs].
. See <<hibernate-ogm-jboss-modules-feature-packs, list of available Hibernate OGM feature packs>>.

Once you have the archives, you need to
Expand All @@ -455,26 +453,11 @@ The modules included are:
* _org.hibernate.ogm_, the core Hibernate OGM library.
* _org.hibernate.ogm.<%DATASTORE%>_, one module for each datastore, with _<%DATASTORE%>_ being one of _infinispan_, _mongodb_ etc.
* _org.hibernate.orm_, the Hibernate ORM libraries.
* _org.hibernate.search_, the Hibernate Search libraries.
* Several shared dependencies such as _org.hibernate.hql:<%VERSION%>_ (containing the query parser) and others

The module slot to use for Hibernate OGM {hibernate-ogm-version} is `{hibernate-ogm-module-slot}`
as the format of the slot name does not include the "micro" part of the project version.

You will also need to set the property `wildfly.jpa.hibernate.search.module`
to `org.hibernate.search.orm:{hibernate-search-module-slot}` in your `persistence.xml`.
This way your application will use the right Hibernate ORM and Hibernate Search version
(and not the one shipped with WildFly).

.Property for enabling a Hibernate Search and Hibernate ORM version compatible with Hibernate OGM
====
[source, XML]
[subs="verbatim,attributes"]
----
<property name="wildfly.jpa.hibernate.search.module" value="org.hibernate.search.orm:{hibernate-search-module-slot}"/>
----
====

Now that WildFly is ready, you can include the dependencies in your application in two ways:

Include dependencies using the manifest::
Expand Down
13 changes: 0 additions & 13 deletions featurepack/core/pom.xml
Expand Up @@ -156,19 +156,6 @@
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-orm-jbossmodules</artifactId>
<version>${version.org.hibernate}</version>
<type>zip</type>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

<build>
Expand Down
Expand Up @@ -2,7 +2,5 @@
<build xmlns="urn:wildfly:feature-pack-build:1.1">
<dependencies>
<artifact name="org.wildfly:wildfly-feature-pack" />

<artifact name="org.hibernate:hibernate-orm-jbossmodules"/>
</dependencies>
</build>
2 changes: 1 addition & 1 deletion featurepack/core/src/main/modules/ogm/jipijapa/module.xml
Expand Up @@ -10,7 +10,7 @@
<artifact name="${org.hibernate.ogm:hibernate-ogm-jipijapa}" />
</resources>
<dependencies>
<module name="org.hibernate.orm.jipijapa-hibernate5" slot="${module-slot.org.hibernate.short-id}"/>
<module name="org.hibernate.jipijapa-hibernate5"/>
<module name="org.jboss.as.jpa.spi" />
<module name="org.hibernate" slot="${module-slot.org.hibernate.short-id}" />
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion integrationtest/pom.xml
Expand Up @@ -132,7 +132,7 @@
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<includes>
<include>**/neo4j/embedded/*IT.java</include>
<include>**/mongodb/*IT.java</include>
<include>**/mongodb/**/*IT.java</include>
<include>**/infinispan/*IT.java</include>
</includes>
</configuration>
Expand Down
1 change: 0 additions & 1 deletion integrationtest/server-provisioning.xml
@@ -1,7 +1,6 @@
<server-provisioning xmlns="urn:wildfly:server-provisioning:1.1" extract-schemas="true" copy-module-artifacts="true">
<feature-packs>
<feature-pack groupId="org.wildfly" artifactId="wildfly-feature-pack" version="${version.wildfly}" />
<feature-pack groupId="org.hibernate" artifactId="hibernate-search-jbossmodules-orm" version="${version.org.hibernate.search}" />
<feature-pack groupId="org.hibernate.ogm" artifactId="hibernate-ogm-featurepack-infinispan-remote" version="${project.version}" />
<feature-pack groupId="org.hibernate.ogm" artifactId="hibernate-ogm-featurepack-infinispan-embedded" version="${project.version}" />
<feature-pack groupId="org.hibernate.ogm" artifactId="hibernate-ogm-featurepack-mongodb" version="${project.version}" />
Expand Down
7 changes: 4 additions & 3 deletions pom.xml
Expand Up @@ -75,9 +75,10 @@
<module-slot.org.hibernate.ogm.short-id>${parsed-version.majorVersion}.${parsed-version.minorVersion}</module-slot.org.hibernate.ogm.short-id>
<module-slot.org.hibernate.ogm.jipijapa.full-id>${project.version}</module-slot.org.hibernate.ogm.jipijapa.full-id>

<!-- Temporary use of full version *5.10.0.Final* as module slot for Hibernate Search -->
<!-- Because *5.10* alias slot is reserved to *5.10.1.Final* in WildFly 13.0.0.Final -->
<module-slot.org.hibernate.search.short-id>${version.org.hibernate.search}</module-slot.org.hibernate.search.short-id>
<!-- using 'main' slot module, so that we're using the one provided by WF itself -->
<module-slot.org.hibernate.search.short-id>main</module-slot.org.hibernate.search.short-id>
<!-- to use instead the one provided by Hibernate Search feature pack please put back the usual slot: -->
<!-- <module-slot.org.hibernate.search.short-id>${parsed-version.org.hibernate.search.majorVersion}.${parsed-version.org.hibernate.search.minorVersion}</module-slot.org.hibernate.search.short-id> -->

<module-slot.org.hibernate.short-id>${parsed-version.org.hibernate.majorVersion}.${parsed-version.org.hibernate.minorVersion}</module-slot.org.hibernate.short-id>
<module-slot.org.hibernate.hql.full-id>${version.org.hibernate.hql}</module-slot.org.hibernate.hql.full-id>
Expand Down