Skip to content

Commit

Permalink
OGM-1260 Expands WildFly 10 configuration paragraph
Browse files Browse the repository at this point in the history
  * Use variables to set the right versions when possible
  * Show plugin example to download and unpack WildFly
  * Show how to uphrade ORM version on WildFly
  • Loading branch information
DavideD committed Mar 1, 2017
1 parent 7100ce0 commit 50e10c8
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 7 deletions.
2 changes: 2 additions & 0 deletions documentation/manual/pom.xml
Expand Up @@ -168,9 +168,11 @@
<icons>font</icons>
<tabsize>4</tabsize>

<wildfly-version>${version.wildfly}</wildfly-version>
<hibernate-ogm-version>${project.version}</hibernate-ogm-version>
<hibernate-ogm-module-slot>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}</hibernate-ogm-module-slot>
<hibernate-orm-version>${hibernateVersion}</hibernate-orm-version>
<hibernate-wildfly-classifier>${hibernateWildflyClassifier}</hibernate-wildfly-classifier>
<hibernate-orm-major-minor-version>${hibernateParsedVersion.majorVersion}.${hibernateParsedVersion.minorVersion}</hibernate-orm-major-minor-version>
<hibernate-search-version>${hibernateSearchVersion}</hibernate-search-version>
<hibernate-search-module-slot>${hibernate-search.module.slot}</hibernate-search-module-slot>
Expand Down
Expand Up @@ -360,18 +360,101 @@ as you can include your favourite version of Hibernate OGM directly to the colle

You can download the pre-packaged module ZIP for this version of Hibernate OGM from:

* https://downloads.sourceforge.net/project/hibernate/hibernate-ogm/{hibernate-ogm-version}/hibernate-ogm-modules-{hibernate-ogm-version}-wildfly-10-dist.zip[Sourceforge]
* https://repo1.maven.org/maven2/org/hibernate/ogm/hibernate-ogm-modules/{hibernate-ogm-version}/hibernate-ogm-modules-{hibernate-ogm-version}-wildfly-10-dist.zip[The Maven Central repository]
* https://downloads.sourceforge.net/project/hibernate/hibernate-ogm/{hibernate-ogm-version}/hibernate-ogm-modules-{hibernate-ogm-version}-{hibernate-wildfly-classifier}.zip[Sourceforge]
* https://repo1.maven.org/maven2/org/hibernate/ogm/hibernate-ogm-modules/{hibernate-ogm-version}/hibernate-ogm-modules-{hibernate-ogm-version}-{hibernate-wildfly-classifier}.zip[The Maven Central repository]

Unpack the archive into the `modules` folder of your WildFly 10 installation.
Hibernate OGM {hibernate-ogm-version} requires Hibernate ORM {hibernate-orm-version} that is not included
with WildFly 10.

For this reason, you also need the pre-packaged module ZIP for Hibernate ORM, you can download it
https://repo1.maven.org/maven2/org/hibernate/hibernate-orm-modules/{hibernate-orm-version}/hibernate-orm-modules-{hibernate-orm-version}-{hibernate-wildfly-classifier}.zip[from Maven Central]

Unpack the archives into the `modules` folder of your WildFly 10 installation.
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.
* 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.

To upgrade the Hibernate ORM version you will need to add the following property to your `persistence.xml`:

.Property to set a different Hibernate ORM version
====
[source, XML]
[subs="verbatim,attributes"]
----
<property name="jboss.as.jpa.providerModule" value="org.hibernate:{hibernate-orm-major-minor-version}"/>
----
====

You will find more details in the
http://docs.jboss.org/hibernate/orm/current/topical/html_single/wildfly/Wildfly.html[Using latest Hibernate ORM within WildFly] paragraph of the
Hibernate ORM documentation.

If you are using Maven, you can download and set up your wildfly with the following snippet:

.Maven example to prepare a WildFly installation for integration tests
====
[source, XML]
[subs="verbatim,attributes"]
----
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>pre-integration-test</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<!-- Download and unpack WildFly -->
<artifactItem>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-dist</artifactId>
<version>{wildfly-version}</version>
<type>zip</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}</outputDirectory>
</artifactItem>
<!-- Download and unpack Hibernate ORM modules -->
<artifactItem>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-orm-modules</artifactId>
<version>{hibernate-orm-version}</version>
<classifier>{hibernate-wildfly-classifier}</classifier>
<type>zip</type>
<overWrite>false</overWrite>
<outputDirectory>
${project.build.directory}/wildfly-{wildfly-version}/modules
</outputDirectory>
</artifactItem>
<!-- Download and unpack Hibernate OGM modules -->
<artifactItem>
<groupId>org.hibernate.ogm</groupId>
<artifactId>hibernate-ogm-modules</artifactId>
<classifier>{hibernate-wildfly-classifier}</classifier>
<version>{hibernate-ogm-version}</version>
<type>zip</type>
<overWrite>false</overWrite>
<outputDirectory>
${project.build.directory}/wildfly-{wildfly-version}/modules
</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
----
====

There are two ways to include the dependencies in your project:

Using the manifest::
Expand Down Expand Up @@ -407,7 +490,6 @@ https://docs.jboss.org/author/display/WFLY10/Class+Loading+in+WildFly[WildFly do

WildFly will by default attempt to guess which Persistence Provider you need by having a look at the `provider` section of the `persistence.xml`.


==== Enabling both the Hibernate Search and Hibernate OGM modules

A compatible Hibernate Search module is included in WildFly 10, and Hibernate Search is activated automatically if you're indexing any entity.
Expand Down
6 changes: 3 additions & 3 deletions integrationtest/pom.xml
Expand Up @@ -112,15 +112,15 @@
<groupId>org.hibernate</groupId>
<artifactId>hibernate-orm-modules</artifactId>
<version>${hibernateVersion}</version>
<classifier>wildfly-10-dist</classifier>
<classifier>${hibernateWildflyClassifier}</classifier>
<type>zip</type>
<overWrite>false</overWrite>
<outputDirectory>${jboss.home}/modules</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>hibernate-ogm-modules</artifactId>
<classifier>wildfly-10-dist</classifier>
<classifier>${hibernateWildflyClassifier}</classifier>
<version>${project.version}</version>
<type>zip</type>
<overWrite>false</overWrite>
Expand Down Expand Up @@ -149,7 +149,7 @@
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search-modules</artifactId>
<version>${hibernateSearchVersion}</version>
<classifier>wildfly-10-dist</classifier>
<classifier>${hibernateWildflyClassifier}</classifier>
<type>zip</type>
<overWrite>false</overWrite>
<outputDirectory>${jboss.home}/modules</outputDirectory>
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Expand Up @@ -74,6 +74,7 @@

<!-- Target version of WildFly (for testing and JipiJapa integration) -->
<version.wildfly>10.1.0.Final</version.wildfly>
<hibernateWildflyClassifier>wildfly-10-dist</hibernateWildflyClassifier>
<hibernate-orm.module.slot>5.1</hibernate-orm.module.slot>

<!-- Asciidoctor -->
Expand Down

0 comments on commit 50e10c8

Please sign in to comment.