使用 buildkite 代理(AWS EC2 Linux2)运行构建,遇到错误:
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'apply-service'.
> Could not resolve all files for configuration ':classpath'.
> Could not resolve org.springframework.boot:spring-boot-gradle-plugin:2.1.3.RELEASE.
Required by:
project :
> Could not resolve org.springframework.boot:spring-boot-gradle-plugin:2.1.3.RELEASE.
> Could not parse POM https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-gradle-plugin/2.1.3.RELEASE/spring-boot-gradle-plugin-2.1.3.RELEASE.pom
...
在代码中:
构建.Gradle
buildscript {
ext {
kotlinVersion = '1.2.60'
springBootVersion = '2.0.4.RELEASE'
gradlePluginVersion = '1.0.0'
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}")
classpath("org.jetbrains.kotlin:kotlin-allopen:${kotlinVersion}")
classpath("org.junit.platform:junit-platform-gradle-plugin:${gradlePluginVersion}")
classpath("org.jetbrains.kotlin:kotlin-noarg:${kotlinVersion}")
}
}
plugins {
id 'org.jetbrains.kotlin.plugin.jpa' version '1.3.21'
id 'org.springframework.boot' version '2.1.3.RELEASE'
id 'org.jetbrains.kotlin.jvm' version '1.3.21'
id 'org.jetbrains.kotlin.plugin.spring' version '1.3.21'
id "io.gitlab.arturbosch.detekt" version "1.0.0.RC8"
id "org.sonarqube" version "2.7"
id "org.flywaydb.flyway" version "5.1.4"
}
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'kotlin'
apply plugin: 'kotlin-spring'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'org.junit.platform.gradle.plugin'
apply plugin: 'jacoco'
apply plugin: 'kotlin-jpa'
gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-4.5.1-all.zip
试过:
- 重建它,构建通过。
想知道为什么会失败?是不是因为网络问题?