我的 Kotlin 项目无法解决对 Travis-CI 的依赖

Lua*_*tro 1 jvm gradle travis-ci kotlin

我在尝试将我的 Kotlin 项目与 Travis-CI 集成时,无法生成成功的构建,我收到消息说我的 gradle 没有找到存储库...

存储库在我的文件 build.gradle 中

version '1.0-SNAPSHOT'

buildscript {
    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.0.0-beta-4584"
    }
}

apply plugin: 'java'
apply plugin: 'kotlin'

sourceCompatibility = 1.5

repositories {
    mavenCentral()
    maven {
        url "http://repository.jetbrains.com/all"
    }
}

dependencies {
    testCompile 'org.spek:spek:0.1.188'
    compile "org.jetbrains.kotlin:kotlin-stdlib:1.0.0-beta-4584"
    testCompile group: 'junit', name: 'junit', version: '4.11'
}
Run Code Online (Sandbox Code Playgroud)

我的 travis 很简单

language: java
Run Code Online (Sandbox Code Playgroud)

收到的消息是

FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'dojo-s01e01-cheque-por-extenso'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Cannot resolve external dependency org.jetbrains.kotlin:kotlin-gradle-plugin:1.0.0-beta-4584 because no repositories are defined.
     Required by:
         :dojo-s01e01-cheque-por-extenso:unspecified
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Run Code Online (Sandbox Code Playgroud)

构建链接是 -> https://travis-ci.org/castrolol/dojo-s01e01-cheque-por-extenso.kotlin/builds/127235950

hot*_*key 5

添加

repositories {
     mavenCentral()
}
Run Code Online (Sandbox Code Playgroud)

buildscript { ... }适用于您的范围。

此外,请考虑使用较新的 Kotlin 版本,最新版本可在此处找到。