英文:
Issue while setting up the spring boot with gradle
问题
我在尝试在IntelliJ中设置一个Spring Boot Gradle项目。如果我尝试在Gradle面板上使用重新加载按钮,它会给我一个关于setting.gradle
文件的错误,但是setting.gradle
文件已经在根目录中存在。
当我在终端上尝试运行./gradlew clean build
时,出现以下错误:
build.gradle
文件内容如下:
plugins {
id 'java'
id 'org.springframework.boot' version '3.0.0'
}
group 'com'
version '1.0'
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
implementation 'org.springframework.boot:spring-boot-starter'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
test {
useJUnitPlatform()
}
java {
sourceCompatibility = JavaVersion.toVersion('11')
targetCompatibility = JavaVersion.toVersion('11')
}
我尝试了但无法找出我漏掉了什么。请提供建议。
更新: 我尝试从系统中删除Gradle安装,并执行另一个之前正常工作的应用程序,但即使下载了Gradle版本后,仍然出现与上述相同的错误。
我尝试了使用Spring Initializr创建Maven项目,它成功构建,因此似乎是与我的机器上的Gradle设置有关的问题,但不确定要检查什么。
祝好!
英文:
I am trying to setting up a Spring boot gradle project in intelliJ. If I am trying with reload button on the gradle pane, it's giving me error for setting.gradle
but setting.gradle file is already there is the root directory.
When I tried ./gradlew clean build
on terminal getting the below error:
build.gradle
plugins {
id 'java'
id 'org.springframework.boot' version '3.0.0'
}
group 'com'
version '1.0'
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
implementation 'org.springframework.boot:spring-boot-starter'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
test {
useJUnitPlatform()
}
java {
sourceCompatibility = JavaVersion.toVersion('11')
targetCompatibility = JavaVersion.toVersion('11')
}
I tried but couldn't figure out what I am missing. Please suggest.
Update: I tried to delete gradle installation from the system and executed one another application which was working fine earlier but not even after downloading the gradle version, getting the same error as mentioned above.
I tried Maven project with spring initializr and it successfully build so It seems to be an issue regarding gradle setup on my machine but not sure what to check.**
Regards
答案1
得分: 0
不确定为什么错误信息不够清晰。与证书问题有关。我在Java cacerts密钥库中添加了一些组织特定的证书,解决了Gradle插件下载的问题。
感谢所有尝试帮助的人。
英文:
Not Sure why error message was not that clear. It was related to certificate issue. I added some organization specific certificate in java cacerts keystore and it resolved the gradle issue with plugin download.
Thanks to All who tried to help.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论