亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Spring Tool Suite org.joda 在 Gradle 項目中無法解析

Spring Tool Suite org.joda 在 Gradle 項目中無法解析

慕標琳琳 2021-07-21 17:46:09
我已經使用 Spring Tool Suite 啟動了一個 Gradle 項目。按照本教程:https : //spring.io/guides/gs/gradle/ 它表明我應該在我的 build.gradle 文件中添加 org.joda 依賴項,在類中導入依賴項,構建包,然后它應該可以使用。但是,當我這樣做并重新構建項目并運行它時,出現錯誤:Exception in thread "main" java.lang.Error: Unresolved compilation problems:     LocalTime cannot be resolved to a type    LocalTime cannot be resolved to a type    at firstGradleProject.HelloWorld.main(HelloWorld.java:7)我的依賴項似乎已正確設置:dependencies {    compile('org.springframework.boot:spring-boot-starter')    testCompile('org.springframework.boot:spring-boot-starter-test')    compile('joda-time:joda-time:2.2')    testCompile('junit:junit:4.12')}如何在我的 Gradle Spring 項目中導入這個依賴項并讓它編譯?我的整個 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.8targetCompatibility = 1.8jar {    baseName = 'gs-gradle'    version =  '0.1.0'}repositories {    mavenCentral()}dependencies {    compile('org.springframework.boot:spring-boot-starter')    testCompile('org.springframework.boot:spring-boot-starter-test')    compile('joda-time:joda-time:2.2')    testCompile('junit:junit:4.12')}
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 331 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號