Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is a very special question, I hope that somebody here already worked in a similar project setup.

I am working with Netbeans and started a maven web project based upon the maven HS 4.x tutorial on

This compiles fine using maven.

Next I want to use the maven hibernate3 plugin from MOJO (, so I can create SQL Scripts and the database schema out of my java entitiy classes. So the workflow should be

  1. code java entitiy classes with spatial (postgis) fields
  2. compile
  3. create DDL out of entity classes
  4. create/update database schema with DDL
  5. run app

The problem is, when I run

mvn hibernate3:hbm2ddl

The plugin does not search for hibernate spatial in the remote repo on like the compile plugin does, but searches for it in the central repo. Due to the fact, that the hibernate-spatial.jar does not exist there, DDL creation fails. This is what the maven output looks like:

[ERROR] Failed to execute goal org.codehaus.mojo:hibernate3-maven-plugin:2.2:hbm2ddl ... Plugin org.codehaus.mojo:hibernate3-maven-plugin:2.2 or one of its dependencies could not be resolved: Could not find artifact org.hibernate:hibernate-spatial:jar:4.0-M1 in central ( -> [Help 1]
Caused by: ... Could not find artifact org.hibernate:hibernate-spatial:jar:4.0-M1 in central (
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1]

As I already mentioned, maven compile goal works and resolves hibernate-spatial correctly.

Is there an alternative way to create database schema out of java entity classes without the maven hibernate plugin?

share|improve this question

Ok, problem was a wrong hibernate version in the first place, but also wrong use of hibernate3 plugin with hibernate4, and some missing hibernate4 libraries. Got it working now without the maven plugin, based on the correct use of JPA EntityManager and auto schema generation. Works like a charm now.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.