2015-05-14 14:32:42 -04:00
< img src = "http://static.jboss.org/hibernate/images/hibernate_logo_whitebkg_200px.png" / >
2011-05-08 15:46:27 -04:00
2015-05-14 14:32:42 -04:00
Hibernate ORM is a component/library providing Object/Relational Mapping (ORM) support
to applications and other components/libraries. It is also provides an implementation of the
JPA specification, which is the standardized Java specification for ORM. See
[Hibernate.org ](http://hibernate.org/orm/ ) for additional information.
[![Build Status ](http://ci.hibernate.org/job/hibernate-orm-master-h2/badge/icon )](http://ci.hibernate.org/job/hibernate-orm-master-h2/)
2012-04-20 11:46:07 -04:00
Quickstart
2015-05-14 14:32:42 -04:00
==========
2012-04-20 11:46:07 -04:00
git clone git://github.com/hibernate/hibernate-orm.git
cd hibernate-orm
2012-04-20 11:47:19 -04:00
./gradlew clean build
2012-04-20 11:46:07 -04:00
2015-05-14 14:32:42 -04:00
The build requires a Java 8 JDK as JAVA_HOME, but will ensure Java 6 compatibility.
2011-05-08 15:46:27 -04:00
Resources
2015-05-14 14:32:42 -04:00
=========
Hibernate uses [Gradle ](http://gradle.org ) as its build tool. See the _Gradle Primer_ section below if you are new to
Gradle.
2011-05-08 15:46:27 -04:00
2015-05-14 14:32:42 -04:00
Contributors should read the [Contributing Guide ](CONTRIBUTING.md )
2011-05-08 15:31:48 -04:00
2015-05-14 14:32:42 -04:00
See the guides for setting up [IntelliJ ](https://developer.jboss.org/wiki/ContributingToHibernateUsingIntelliJ ) or
2015-09-05 17:12:35 -04:00
[Eclipse ](https://developer.jboss.org/wiki/ContributingToHibernateUsingEclipse ) as your development environment. [Building Hibernate ORM ](https://community.jboss.org/wiki/BuildingHibernateORM4x )
2015-05-14 14:32:42 -04:00
is somewhat outdated, but still has
2011-05-08 15:31:48 -04:00
2011-09-30 06:35:16 -04:00
2015-05-14 14:32:42 -04:00
CI Builds
=========
2011-09-30 06:35:16 -04:00
2015-05-14 14:37:45 -04:00
Hibernate makes use of [Jenkins ](http://jenkins-ci.org ) for its CI needs. The project is built continuous on each
2015-05-14 14:32:42 -04:00
push to the upstream repository. Overall there are a few different jobs, all of which can be seen at
[http://ci.hibernate.org/view/ORM/ ](http://ci.hibernate.org/view/ORM/ )
2012-04-20 11:38:07 -04:00
2015-05-14 14:32:42 -04:00
Gradle primer
=============
2012-04-20 11:38:07 -04:00
2015-05-14 14:32:42 -04:00
This section describes some of the basics developers and contributors new to Gradle might
need to know to get productive quickly. The Gradle documentation is very well done; 2 in
particular that are indispensable:
2012-10-30 03:39:58 -04:00
2015-05-14 14:32:42 -04:00
* [Gradle User Guide ](http://gradle.org/docs/current/userguide/userguide_single.html ) is a typical user guide in that
it follows a topical approach to describing all of the capabilities of Gradle.
* [Gradle DSL Guide ](http://gradle.org/docs/current/dsl/index.html ) is quite unique and excellent in quickyl
getting up to speed on certain aspects of Gradle.
2012-10-30 03:39:58 -04:00
2015-05-14 14:32:42 -04:00
Using the Gradle Wrapper
------------------------
2011-05-08 15:31:48 -04:00
2015-05-14 14:32:42 -04:00
For contributors who do not otherwise use Gradle and do not want to install it, Gradle offers a very cool
features called the wrapper. It lets you run Gradle builds without a previously installed Gradle distro in
a zero-conf manner. Hibernate configures the Gradle wrapper for you. If you would rather use the wrapper and
not install Gradle (or to make sure you use the version of Gradle intended for older builds) you would just use
the command `gradlew` (or `gradlew.bat` ) rather than `gradle` (or `gradle.bat` ) in the following discussions.
Note that `gradlew` is only available in the project's root dir, so depending on your `pwd` you may need to adjust
the path to `gradlew` as well.
Executing Tasks
---------------
2011-05-08 15:31:48 -04:00
2015-05-14 14:32:42 -04:00
Gradle uses the concept of build tasks (equivalent to Ant targets or Maven phases/goals). You can get a list of
available tasks via
2011-05-08 15:31:48 -04:00
2015-05-14 14:32:42 -04:00
gradle tasks
To execute a task across all modules, simply perform that task from the root directory. Gradle will visit each
sub-project and execute that task if the sub-project defines it. To execute a task in a specific module you can
either:
2012-04-20 11:38:07 -04:00
2011-05-08 15:31:48 -04:00
1. `cd` into that module directory and execute the task
2. name the "task path". For example, in order to run the tests for the _hibernate-core_ module from the root directory you could say `gradle hibernate-core:test`
2015-05-14 14:32:42 -04:00
Common Java related tasks
-------------------------
2011-05-08 15:31:48 -04:00
* _build_ - Assembles (jars) and tests this project
2013-12-12 13:00:15 -05:00
* _buildDependents_ - Assembles and tests this project and all projects that depend on it. So think of running this in hibernate-entitymanager, Gradle would assemble and test hibernate-entitymanager as well as hibernate-envers (because envers depends on entitymanager)
2011-05-08 15:31:48 -04:00
* _classes_ - Compiles the main classes
* _testClasses_ - Compiles the test classes
2015-05-14 14:32:42 -04:00
* _compile_ (Hibernate addition) - Performs all compilation tasks including staging resources from both main and test
2011-05-08 15:31:48 -04:00
* _jar_ - Generates a jar archive with all the compiled classes
* _test_ - Runs the tests
2015-01-08 14:48:05 -05:00
* _publish_ - Think Maven deploy
2015-05-14 14:32:42 -04:00
* _publishToMavenLocal_ - Installs the project jar to your local maven cache (aka ~/.m2/repository). Note that Gradle
never uses this, but it can be useful for testing your build with other local Maven-based builds.
2011-05-08 15:31:48 -04:00
* _eclipse_ - Generates an Eclipse project
2015-05-14 14:32:42 -04:00
* _idea_ - Generates an IntelliJ/IDEA project (although the preferred approach is to use IntelliJ's Gradle import).
2013-12-12 13:00:15 -05:00
* _clean_ - Cleans the build directory