2014-03-05 262 views
0

我注意到春季启动样本数据Redis的声明了以下依赖关系:弹簧引导启动与弹簧引导起动XXX

<dependency> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter</artifactId> 
</dependency> 
<dependency> 
    <groupId>org.springframework.data</groupId> 
    <artifactId>spring-data-redis</artifactId> 
</dependency> 

在这里看到全POMhttps://github.com/spring-projects/spring-boot/blob/v1.0.0.RC4/spring-boot-samples/spring-boot-sample-data-redis/pom.xml

我看没有提到的<artifactId>spring-boot-starter-redis</artifactId>

我的问题是:当我用spring-boot-starterspring-boot-starter-xxx其中xxx是该项目的名称(这里是Redis)?

回答

3

特定问题的答案spring-boot-starter是其他人的基准,对于不使用任何其他Spring组件的独立(非Web)应用程序,它基本支持Spring,日志记录和测试,但没有别的(没有webapp功能,没有数据库等)。由于所有其他首发都依赖于它,所以一旦你使用另一个首发,你可以取出香草起动器。编辑:看到这里https://github.com/spring-projects/spring-boot/commit/77fd127e09963a844f8fb4e574e1f0d9d3424d4e

在redis启动器上由您决定,但如果它存在,我会使用启动器,因为它通常会减少需要声明的依赖项的数量。 redis实际上并没有增加很多价值(因此它直到最近才存在),但它可能应该在样本中使用。