Hibernate spatial unresolved dependencies postgis-jdbc; 1.5.3: not found

I install hibernate spaces following the instructions in the documentation from the official website:

http://www.hibernatespatial.org/tutorial-hs4.html

The problem is with library dependency

Why not find a library:

postgis-jdbc: jar: 1.5.3: compile

See the version of this library on the official website:

http://postgis.refractions.net/download/

But not available

The message displayed on the terminal is as follows:

[warn] http://scala-tools.org/repo-releases/org/postgis/postgis-jdbc/1.5.3/postgis-jdbc-1.5.3.jar [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: UNRESOLVED DEPENDENCIES :: [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: org.postgis#postgis-jdbc;1.5.3: not found [warn] :::::::::::::::::::::::::::::::::::::::::::::: [info] [info] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS 

Does anyone know how I can solve this dependency

Thank you very much for your attention

+4
source share
2 answers

It seems that the latest available version of postgis-jdbc in the central maven repository is 1.3.3. Unfortunately, none of the three additional repositories declared in the hibernate-spatial tutorial contains version 1.5.3 postgis-jdbc (the highest version is 1.5.2, available at repo http://www.hibernatespatial.org/repository/ )

Version 1.5.3 is not listed on the postgis download page, however you can still download it here: http://postgis.refractions.net/download/postgis-1.5.3.tar.gz

A pragmatic approach would be to create the library yourself (described in postgis-1.5.3 / java / jdbc / README) and manually add it to the local maven repository (see the Maven documentation - I would like to provide a URL, but because of my current SO reputation I cannot post more than two URLs for each answer).

+9
source

You can also tell your build system to ignore the transient dependency, and then declare the version you need explicitly. Not sure which build engine uses it, but here is how I did it with SBT in the Play Framework:

 libraryDependencies ++= Seq( [...] "org.postgis" % "postgis-jdbc" % "1.5.2", "org.hibernate" % "hibernate-spatial" % "4.0-M1" exclude("org.postgis", "postgis-jdbc") ) 

You also need to add a sleeping spatial repo to access version 1.5.2 :

 resolvers += ( "Hibernate Spatial Repository" at "http://www.hibernatespatial.org/repository" ) 

I found out about this using this tutorial , which shows how to do the same with Maven.

0
source

All Articles