java - Gradle 无法解析 Spring Boot HATEOAS 依赖项

标签 java spring spring-boot gradle

我从 http://start.spring.io 创建了我的骨架项目。但是当我构建应用程序时,Gradle 无法解析 HATEOAS 依赖项。这是我得到的错误:

Error:java: Illegal char <:> at index 78: C:\Users\TempUser\Downloads\hateoas\Could not resolve org.springframework.boot:spring-boot-starter-hateoas:2.0.4.RELEASE.

这是我的 build.gradle 文件:

buildscript {
    ext {
        springBootVersion = '2.0.4.RELEASE'
    }
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8

repositories {
    mavenCentral()
}


dependencies {
    compile('org.springframework.boot:spring-boot-starter-data-jpa')
    compile('org.springframework.boot:spring-boot-starter-hateoas:2.0.4.RELEASE')
    compile('org.springframework.boot:spring-boot-starter-web')
    testCompile('org.springframework.boot:spring-boot-starter-test')
}

最佳答案

本声明

compile('org.springframework.boot:spring-boot-starter-hateoas:2.0.4.RELEASE')

导致错误。更改为

compile('org.springframework.boot:spring-boot-starter-hateoas')

这就是引擎盖下的内容 enter image description here

关于java - Gradle 无法解析 Spring Boot HATEOAS 依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51949475/

相关文章:

java - 是否可以使用 Spring @Scheduled 注释安排作业每小时运行一次,但每次随机运行?

html - Bootstrap 4 webjar css 不适用于 Spring Boot + Thymeleaf

java - Spring Boot 不加载静态资源

java - 识别点击了三个部分重叠的图像中的哪一个

java - Jboss As 5 和 activemq

java - 在 JSTL/EL 中如何获取集合中的第一个元素?

java - spring boot Autowiring 和在 Autowiring 类上使用 new 关键字的区别?

java - Swing 事件线程 Java

java - 如何让 Spring 打印出哪些 Spring 配置文件处于 Activity 状态?

java - Spring Rest 操作将响应转换为类