Spring Boot项目的Gradle Build失败

时间:2018-03-04 16:29:15

标签: java spring-boot gradle

我是Gradle的新手。我正在使用Gradle 4.3版本。我正在尝试使用gradle配置spring -boot应用程序但是在项目构建阶段它失败了。

请在我的 build.gradle 文件下面找到:

plugins {
  id "org.springframework.boot" version "1.5.10.RELEASE"
}
apply plugin: 'java-library'
repositories {
   mavenCentral()
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
   testImplementation 'junit:junit:4.12'
   compile(
        'org.springframework.boot:spring-boot-starter-actuator',
        'org.springframework.boot:spring-boot-starter-web',
        'org.apache.tomcat.embed:tomcat-embed-jasper',
        'org.springframework.boot:spring-boot-starter-thymeleaf'
     )
    }
   }

在从eclipse建立gradle期间我正在使用build命令,我在eclipse控制台中遇到以下错误:

Working Directory: D:\Maven_Workspace\AddGradleViewer
Gradle User Home: C:\Users\Sumit\.gradle
Gradle Distribution: Local installation at C:\Users\Sumit\.gradle\wrapper\dists\gradle-4.3
Gradle Version: 4.3
Java Home: C:\Java\Java8\Jre8
JVM Arguments: None
Program Arguments: None
Build Scans Enabled: true
Offline Mode Enabled: false
Gradle Tasks: build

:compileJava FAILED
 FAILURE: Build failed with an exception.

 * What went wrong:
 Could not resolve all files 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 
    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
       Required by:
       project :
 > Could not find org.apache.tomcat.embed:tomcat-embed-jasper:.
       Searched in the following locations:
       https://repo1.maven.org/maven2/org/apache/tomcat/embed/tomcat-embed-jasper//tomcat-embed-jasper-.pom
       https://repo1.maven.org/maven2/org/apache/tomcat/embed/tomcat-embed-jasper//tomcat-embed-jasper-.jar
       Required by:
       project :
 > Could not find org.springframework.boot:spring-boot-starter-thymeleaf:.
       Searched in the following locations:
       https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-thymeleaf//spring-boot-starter-thymeleaf-.pom
       https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-thymeleaf//spring-boot-starter-thymeleaf-.jar
       Required by:
       project :

任何人都可以为此提供任何合适的解决方案吗?

0 个答案:

没有答案