当前位置: 首页 > 知识库问答 >
问题:

Boot 2.0.0出错。使用Gradle的build-snapshot

缪兴腾
2023-03-14

我从https://start.spring.io创建了一个版本为2.0.0.build-snapshot的Gradle引导项目,并且没有做任何更改,只是尝试使用以下方法运行应用程序

    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}标记有问题,如图所示:

https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-acture/[WHERE IS THE version???]/spring-boot-starter-acture-[WHERE IS THE version???].pom

下面是我配置的回购(粗体部分不是由initialzr生成的:

repositories {
    mavenCentral()
    maven { url 'https://repo.spring.io/libs-snapshot' }
    maven { url "https://repo.spring.io/snapshot" }
    maven { url "https://repo.spring.io/milestone" }
}
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

共有1个答案

子车勇锐
2023-03-14

您需要添加:

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

存储库块(main和buildscript)

 类似资料:
  • ionic build android错误gradle错误 线程“main”中出现异常 java.lang.RuntimeException: java.util.zip.ZipException: 打开 zip 文件时出错 位于org . grad le . wrapper . exclusivefileaccessmanager . access(exclusivefileaccessmana

  • 操作:我遇到了这个问题,似乎处理了同样的问题,我有。不幸的是,我的文件中没有行。 我的错误显示 但是返回 我尝试在真实的JAVA_HOME和gradle试图使用的一个符号链接之间创建符号链接,但gradle试图使用的一个符号链接不是真实的,因此我得到错误 我试着在gradlew文件周围挖掘,发现了我认为可能是违规代码,但我不是100%确定它是如何工作的,而且当我编辑文件并执行时,我的所有更改都被抹

  • 我目前正在处理这个android项目,它刚刚从eclipse移植到android Studio。使用android studio IDE构建APKs工作良好,但最近我想尝试使用terminal(mac osx)来构建APKs,但事情并不顺利。即使是最基本的命令 或 根本不起作用并且在同一点上不断失败。下面是错误的stacktrace

  • 问题内容: 以下是Gradle规格: 摇篮4.6 Android Gradle插件3.1.1 启用并行执行 启用缓存 从gradle.com阅读有关gradle构建优化的信息后,我下载了最新的稳定JVM(9.0.4),并在Android Studio(默认- 嵌入式)中交换了JVM(Java 8)。完成并执行之后,我进入了终端。以下是完整的堆栈跟踪。 因此,我切换回Android Studio随附