2014-01-30 111 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网站存在一个错误,我们将更正这个错误。同时使用这里建议的依赖关系。 –

相关问题