使用Gradle启动2.0.0.BUILD-SNAPSHOT时出错

使用Gradle启动2.0.0.BUILD-SNAPSHOT时出错,gradle,spring-boot,Gradle,Spring Boot,我创建了一个Gradle启动项目,版本为2.0.0.BUILD-SNAPSHOT,未做任何更改,并尝试使用以下工具运行该应用程序: gradle bootRun 我得到以下错误 FAILURE: Build failed with an exception. * What went wrong: Could not resolve all dependencies for configuration ':compileClasspath'. > Could not find or

我创建了一个Gradle启动项目,版本为2.0.0.BUILD-SNAPSHOT,未做任何更改,并尝试使用以下工具运行该应用程序:

gradle bootRun

我得到以下错误

    FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all dependencies for configuration ':compileClasspath'.
> Could not find org.springframework.boot:spring-boot-starter-actuator:.
  Searched in the following locations:
      https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-actuator//spring-boot-starter-actuator-.pom
      https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-actuator//spring-boot-starter-actuator-.jar
      https://repo.spring.io/snapshot/org/springframework/boot/spring-boot-starter-actuator//spring-boot-starter-actuator-.pom
      https://repo.spring.io/snapshot/org/springframework/boot/spring-boot-starter-actuator//spring-boot-starter-actuator-.jar
      https://repo.spring.io/milestone/org/springframework/boot/spring-boot-starter-actuator//spring-boot-starter-actuator-.pom
      https://repo.spring.io/milestone/org/springframework/boot/spring-boot-starter-actuator//spring-boot-starter-actuator-.jar
现在,当我将版本更改为: springBootVersion='1.5.3.BUILD-SNAPSHOT'应用程序启动正常

我怀疑dependency management${springBootVersion}标记有问题,如图所示:

[版本在哪里?]/spring boot starter actuator-[版本在哪里?].pom

以下是我配置的回购协议(粗体部分不是INITIALZR生成的aut:

repositories {
    mavenCentral()
    maven { url 'https://repo.spring.io/libs-snapshot' }
    maven { url "https://repo.spring.io/snapshot" }
    maven { url "https://repo.spring.io/milestone" }
}

这可能对某些依赖项有所帮助,但初学者pom仍然存在一个问题:

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all dependencies for configuration ':compileClasspath'.
> Could not find org.springframework.boot:spring-boot-starter-aop:.
  Searched in the following locations:
      https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-aop//spring-boot-starter-aop-.pom
      https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-aop//spring-boot-starter-aop-.jar
      https://repo.spring.io/snapshot/org/springframework/boot/spring-boot-starter-aop//spring-boot-starter-aop-.pom
      https://repo.spring.io/snapshot/org/springframework/boot/spring-boot-starter-aop//spring-boot-starter-aop-.jar
      https://repo.spring.io/milestone/org/springframework/boot/spring-boot-starter-aop//spring-boot-starter-aop-.pom
      https://repo.spring.io/milestone/org/springframework/boot/spring-boot-starter-aop//spring-boot-starter-aop-.jar
  Required by:
      project :
> Could not find org.springframework.boot:spring-boot-starter-jdbc:.
  Searched in the following locations:
      https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-jdbc//spring-boot-starter-jdbc-.pom
      https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-jdbc//spring-boot-starter-jdbc-.jar
      https://repo.spring.io/snapshot/org/springframework/boot/spring-boot-starter-jdbc//spring-boot-starter-jdbc-.pom
      https://repo.spring.io/snapshot/org/springframework/boot/spring-boot-starter-jdbc//spring-boot-starter-jdbc-.jar
      https://repo.spring.io/milestone/org/springframework/boot/spring-boot-starter-jdbc//spring-boot-starter-jdbc-.pom
      https://repo.spring.io/milestone/org/springframework/boot/spring-boot-starter-jdbc//spring-boot-starter-jdbc-.jar
  Required by:
      project :
> Could not find org.springframework.boot:spring-boot-starter-data-rest:.
  Searched in the following locations:
      https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-data-rest//spring-boot-starter-data-rest-.pom
      https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-data-rest//spring-boot-starter-data-rest-.jar
      https://repo.spring.io/snapshot/org/springframework/boot/spring-boot-starter-data-rest//spring-boot-starter-data-rest-.pom
      https://repo.spring.io/snapshot/org/springframework/boot/spring-boot-starter-data-rest//spring-boot-starter-data-rest-.jar
      https://repo.spring.io/milestone/org/springframework/boot/spring-boot-starter-data-rest//spring-boot-starter-data-rest-.pom
      https://repo.spring.io/milestone/org/springframework/boot/spring-boot-starter-data-rest//spring-boot-starter-data-rest-.jar
  Required by:
      project :
> Could not find com.h2database:h2:.
  Searched in the following locations:
      https://repo1.maven.org/maven2/com/h2database/h2//h2-.pom
      https://repo1.maven.org/maven2/com/h2database/h2//h2-.jar
      https://repo.spring.io/snapshot/com/h2database/h2//h2-.pom
      https://repo.spring.io/snapshot/com/h2database/h2//h2-.jar
      https://repo.spring.io/milestone/com/h2database/h2//h2-.pom
      https://repo.spring.io/milestone/com/h2database/h2//h2-.jar
  Required by:
      project :
> Could not find org.hsqldb:hsqldb:.
  Searched in the following locations:
      https://repo1.maven.org/maven2/org/hsqldb/hsqldb//hsqldb-.pom
      https://repo1.maven.org/maven2/org/hsqldb/hsqldb//hsqldb-.jar
      https://repo.spring.io/snapshot/org/hsqldb/hsqldb//hsqldb-.pom
      https://repo.spring.io/snapshot/org/hsqldb/hsqldb//hsqldb-.jar
      https://repo.spring.io/milestone/org/hsqldb/hsqldb//hsqldb-.pom
      https://repo.spring.io/milestone/org/hsqldb/hsqldb//hsqldb-.jar
  Required by:
      project :
> Could not find org.springframework.boot:spring-boot-starter-security:.
  Searched in the following locations:
      https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-security//spring-boot-starter-security-.pom
      https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-security//spring-boot-starter-security-.jar
      https://repo.spring.io/snapshot/org/springframework/boot/spring-boot-starter-security//spring-boot-starter-security-.pom
      https://repo.spring.io/snapshot/org/springframework/boot/spring-boot-starter-security//spring-boot-starter-security-.jar
      https://repo.spring.io/milestone/org/springframework/boot/spring-boot-starter-security//spring-boot-starter-security-.pom
      https://repo.spring.io/milestone/org/springframework/boot/spring-boot-starter-security//spring-boot-starter-security-.jar
  Required by:
      project :
> Could not find org.springframework.boot:spring-boot-starter-web:.
  Searched in the following locations:
      https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-web//spring-boot-starter-web-.pom
      https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-web//spring-boot-starter-web-.jar
      https://repo.spring.io/snapshot/org/springframework/boot/spring-boot-starter-web//spring-boot-starter-web-.pom
      https://repo.spring.io/snapshot/org/springframework/boot/spring-boot-starter-web//spring-boot-starter-web-.jar
      https://repo.spring.io/milestone/org/springframework/boot/spring-boot-starter-web//spring-boot-starter-web-.pom
      https://repo.spring.io/milestone/org/springframework/boot/spring-boot-starter-web//spring-boot-starter-web-.jar
您需要添加:

maven {
    url 'https://repo.spring.io/libs-snapshot'
}

到您的存储库块(main和buildscript)

这可能对某些依赖项有所帮助,但初学者pom仍然存在一个问题:两者都有。问题在于那些REPO中的启动器。它们是错误的:缺少]/spring boot starter aop-[VERSION MISSING].pomBUILD快照版本不在maven central中。您找错了位置。请看这里:发布您的整个build.gradle