在 Maven 中找不到休眠空间 4.3

dev*_*lop 3 java hibernate spatial pom.xml maven

我想将hibernate-spatial和添加postgis到我的 Maven 项目中。

这是我的pom.xml

  <properties>
    <hibernate.version>4.3.6.Final</hibernate.version>
    <hibernate.spatial.version>4.3</hibernate.spatial.version>
    <hibernate.core.version>4.3.6.Final</hibernate.core.version>
    <postgis-jdbc.version>2.2.0</postgis-jdbc.version>
  </properties>

  ...

  <dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core</artifactId>
    <version>${hibernate.core.version}</version>
  </dependency>
  <dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-entitymanager</artifactId>
    <version>${hibernate-entitymanager.version}</version>
  </dependency>
  <dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-spatial</artifactId>
    <version>${hibernate.spatial.version}</version>
  </dependency>
  <dependency>
    <groupId>org.postgis</groupId>
    <artifactId>postgis-jdbc</artifactId>
    <version>${postgis-jdbc.version}</version>
  </dependency>
Run Code Online (Sandbox Code Playgroud)

参考entity-managerhibernate-core工作。但是hibernate-spatialpostgis-jdbc没有找到:

org.hibernate:hibernate-spatial:4.3 not found 检查 Maven 模型以解决问题。

(同样的错误postgis-jdbc

如何在我的项目中包含这些库?

Tob*_*fke 5

hibernate-spatial5.0之前,该库在公共 maven 存储库中不可用。您始终可以通过浏览http://mvnrepository.com/(在本例中为http://mvnrepository.com/artifact/org.hibernate/hibernate-spatial)来检查可用的内容。

但是您可以将 hibernate 空间存储库添加到您的 POM,其中包含 hibernate-spatial 的早期版本:

<project ...>
  ...
  <repositories>
    <repository>
      <id>Hibernate Spatial repo</id>
      <url>http://www.hibernatespatial.org/repository</url>
    </repository>
  </repositories>

</project>
Run Code Online (Sandbox Code Playgroud)

这也包含postgis-jdbc版本1.5.2中的匹配库。