2014-01-30 118 views
4

我想春天數據依賴性添加到我的春天開機啓動項目,但我得到的錯誤:Missing artifact org.springframework.data:spring-data-jdbc-ext:jar:1.0.0.RELEASE缺少神器

這是我的pom.xml文件。我在這裏錯過了什麼?

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>com.test</groupId> 
    <artifactId>myApp</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <parent> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-parent</artifactId> 
     <version>1.0.0.RC1</version> 
    </parent> 
    <dependencies> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-web</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>org.thymeleaf</groupId> 
      <artifactId>thymeleaf-spring4</artifactId> 
     </dependency> 
      <dependency> 
     <groupId>org.springframework.data</groupId> 
     <artifactId>spring-data-jdbc-ext</artifactId> 
     <version>1.0.0.RELEASE</version> 
    </dependency> 
    </dependencies> 

    <properties> 
     <start-class>com.test.Application</start-class> 
    </properties> 

    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.springframework.boot</groupId> 
       <artifactId>spring-boot-maven-plugin</artifactId> 
      </plugin> 
     </plugins> 
    </build> 

    <repositories> 
     <repository> 
      <id>spring-milestone</id> 
      <url>http://repo.spring.io/libs-milestone</url> 
      <snapshots> 
       <enabled>false</enabled> 
      </snapshots> 
     </repository> 
    </repositories> 

    <pluginRepositories> 
     <pluginRepository> 
      <id>spring-milestone</id> 
      <url>http://repo.spring.io/libs-milestone</url> 
      <snapshots> 
       <enabled>false</enabled> 
      </snapshots> 
     </pluginRepository> 
    </pluginRepositories> 
</project> 
+1

如果您瀏覽到[那些座標](http://repo.spring.io/libs-milestone/org/springframework/data/spring-data-jdbc-core/1.0.0.RELEASE/),您可以看到那裏確實沒有罐子。它也沒有出現在任何其他的Maven搜索上。也許試試'spring-data-jdbc-core'而不是? –

回答

3

由於某種原因,Spring Data JDBC Extensions網站上的文檔錯誤(或分佈錯誤!)。

根據該頁面,您確實需要包括您提到的依賴關係。

<dependency> 
    <groupId>org.springframework.data</groupId> 
    <artifactId>spring-data-jdbc-ext</artifactId> 
    <version>1.0.0.RELEASE</version> 
</dependency> 

但是,如果你看一下在the spring repository爲神器它包含與釋放,而不是一個罐子或POM文件的zip文件。

spring-data-jdbc-ext項目由2個工件組成,這兩個工件都可用。更改依賴於以下

<dependency> 
    <groupId>org.springframework.data</groupId> 
    <artifactId>spring-data-jdbc-core</artifactId> 
    <version>1.0.0.RELEASE</version> 
</dependency> 
<dependency> 
    <groupId>org.springframework.data</groupId> 
    <artifactId>spring-data-oracle</artifactId> 
    <version>1.0.0.RELEASE</version> 
</dependency> 

如果您不需要特定的Oracle擴展比你能離開,一出。

一個小紙條還有一個1.1.0.M1版本(里程碑/預發佈版本),它可以與更新版本的Spring Data一起使用。您可能想嘗試一下,而不是針對較早版本的Spring Data構建的1.0.0.RELEASE版本。

+0

貂的建議是正確的。 spring.io網站存在一個錯誤,我們將更正這個錯誤。同時使用這裏建議的依賴關係。 –

相關問題