如何使用Gradle with Spring Boot获取Gosling Release Train of Spring数据?

前端之家收集整理的这篇文章主要介绍了如何使用Gradle with Spring Boot获取Gosling Release Train of Spring数据?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

如何将最新的Gosling版本系列列入我的Gradle构建文件

我曾经在大多数依赖项中使用1.1.9.RELEASE组.现在我需要修复RepositoryRestMvcConfiguration提到here的问题,并且这样做我试图升级到spring Data的最新版本,它根据我链接的github问题修复了bug.

当我添加Gosling版本系列依赖项时,我还删除了spring-data-jpa的spring启动程序和spring-data-rest,认为我可能存在依赖冲突.这样做会拉入新的jar文件但现在我得到的所有javax.persistence注释都找不到符号错误.

我可以使用带有弹簧启动启动器的Gosling版本系列,还是我必须弄清楚如何手动拉入所有弹簧启动依赖关系才能使用Gosling?

我在Mac OS X Yosemite上使用Gradle 2.3.10.

新规范

  1. buildscript {
  2. ext {
  3. springBootVersion = '1.3.0.M3'
  4. }
  5. repositories {
  6. jcenter()
  7. mavenCentral()
  8. //maven { url "https://repo.spring.io/snapshot" }
  9. maven { url "https://repo.spring.io/milestone" }
  10. }
  11. dependencies {
  12. classpath "io.spring.gradle:dependency-management-plugin:0.5.0.RELEASE"
  13. classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
  14. }
  15. }
  16. apply plugin: 'java'
  17. apply plugin: 'eclipse'
  18. apply plugin: 'idea'
  19. apply plugin: 'spring-boot'
  20. apply plugin: "io.spring.dependency-management"
  21. ext {
  22. springVersion = '4.1.6.RELEASE'
  23. springDataVersion = 'Gosling-RELEASE'
  24. }
  25. dependencyManagement {
  26. imports {
  27. mavenBom "org.springframework:spring-framework-bom:${springVersion}"
  28. mavenBom "org.springframework.data:spring-data-releasetrain:${springDataVersion}"
  29. }
  30. }
  31. jar {
  32. baseName = 'my-data-api'
  33. version = '0.0.1'
  34. }
  35. sourceCompatibility = 1.8
  36. targetCompatibility = 1.8
  37. repositories {
  38. jcenter()
  39. mavenCentral()
  40. //maven { url "https://repo.spring.io/snapshot" }
  41. maven { url "https://repo.spring.io/milestone" }
  42. }
  43. dependencies {
  44. compile("org.springframework.boot:spring-boot-starter-actuator:1.3.0.M3")
  45. compile("org.springframework.boot:spring-boot-starter-aop:1.3.0.M3")
  46. compile 'org.springframework.data:spring-data-jpa'
  47. compile 'org.springframework.data:spring-data-rest-webmvc'
  48. compile("org.springframework.boot:spring-boot-starter-web:1.3.0.M3")
  49. compile("org.springframework.boot:spring-boot-starter-jdbc:1.3.0.M3")
  50. compile('org.antlr:stringtemplate:4.0.2')
  51. compile('org.apache.commons:commons-lang3:3.0')
  52. compile('commons-io:commons-io:2.4')
  53. compile('com.ingres.jdbc:iijdbc:10.0-4.0.5')
  54. testCompile("org.springframework.boot:spring-boot-starter-test:1.3.0.M3")
  55. }

代码

  1. buildscript {
  2. ext {
  3. springBootVersion = '1.3.0.M2'
  4. }
  5. repositories {
  6. jcenter()
  7. mavenCentral()
  8. maven { url "https://repo.spring.io/snapshot" }
  9. maven { url "https://repo.spring.io/milestone" }
  10. }
  11. dependencies {
  12. classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
  13. }
  14. }
  15. apply plugin: 'java'
  16. apply plugin: 'eclipse'
  17. apply plugin: 'idea'
  18. apply plugin: 'spring-boot'
  19. jar {
  20. baseName = 'my-data-api'
  21. version = '0.0.1'
  22. }
  23. sourceCompatibility = 1.8
  24. targetCompatibility = 1.8
  25. repositories {
  26. jcenter()
  27. mavenCentral()
  28. maven { url "https://repo.spring.io/snapshot" }
  29. maven { url "https://repo.spring.io/milestone" }
  30. }
  31. dependencies {
  32. compile("org.springframework.boot:spring-boot-starter-actuator:1.2.0.RC2")
  33. compile("org.springframework.boot:spring-boot-starter-aop:1.1.9.RELEASE")
  34. compile("org.springframework.boot:spring-boot-starter-data-jpa:1.1.9.RELEASE")
  35. compile("org.springframework.boot:spring-boot-starter-web:1.1.9.RELEASE")
  36. compile("org.springframework.boot:spring-boot-starter-data-rest:1.1.9.RELEASE")
  37. compile("org.springframework.boot:spring-boot-starter-jdbc:1.1.9.RELEASE")
  38. compile('org.antlr:stringtemplate:4.0.2')
  39. compile('org.apache.commons:commons-lang3:3.0')
  40. compile('commons-io:commons-io:2.4')
  41. compile('com.ingres.jdbc:iijdbc:10.0-4.0.5')
  42. testCompile("org.springframework.boot:spring-boot-starter-test:1.1.9.RELEASE")
  43. }

编辑:

如果我在build.gradle中放置一个javax持久性依赖项,那么我可以成功构建并使用RepositoryRestConfigurerAdapter,但是我的entityManagerFactory缺少依赖项的运行时问题

最佳答案
如果您已经在使用里程碑版本的Spring Boot,我建议您切换到M5.它包括Gosling-RELEASE Spring Data.

猜你在找的Spring相关文章