Maven Quick Start

If you use maven for your project, it's very easy to start using Hibernate Spatial.

First, add the Hibernate Spatial and GeoTools repositories to you pom.xml

 
...
<repositories>
	<repository>
		<id>GeoTools repo</id>
		<url>http://maven.geotools.fr/repository</url>
	</repository>
		<id>Hibernate Spatial repo</id>
		<url>http://www.hibernatespatial.org/repository</url>
	</repository>
		
</repositories>
...

			

Secondly, add the Hibernate Spatial Provider as a dependency. E.g., when using Postgis/Postgresql, add the hibernate-spatial-postgis artifact. Other possibilities are: hibernate-spatial-oracle, or hibernate-spatial-mysql

 
...
<dependencies>
	...
	<dependency>
		<groupId>org.hibernatespatial</groupId>
		<artifactId>hibernate-spatial-postgis</artifactId>
		<version>1.0-M2</version>
	</dependency>
	...
</dependencies>
...

Maven will now transitively resolve the dependencies to JTS, Hibernate and Hibernate Spatial (core module). Now you're good to go.