我從http://start.spring.io創(chuàng)建了我的骨架項目。但是當我構(gòu)建應用程序時,Gradle 無法解析 HATEOAS 依賴項。這是我得到的錯誤:錯誤: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.8repositories { 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')}
2 回答

慕的地10843
TA貢獻1785條經(jīng)驗 獲得超8個贊
本聲明
compile('org.springframework.boot:spring-boot-starter-hateoas:2.0.4.RELEASE')
導致錯誤。改成
compile('org.springframework.boot:spring-boot-starter-hateoas')
這就是引擎蓋下的東西

MYYA
TA貢獻1868條經(jīng)驗 獲得超4個贊
您已經(jīng)在此處指定了 Spring Boot 組件的版本:
ext {
springBootVersion = '2.0.4.RELEASE'
}
因此,必須在沒有版本值的情況下指定所有啟動器依賴項。采用:
compile('org.springframework.boot:spring-boot-starter-hateoas')
代替
compile('org.springframework.boot:spring-boot-starter-hateoas:2.0.4.RELEASE')
希望這可以幫助
添加回答
舉報
0/150
提交
取消