无法在 Kotlin 上导入 gradle 依赖项的类

Nat*_*nPB 5 import dependencies intellij-idea gradle kotlin

我在使用 Gradle 时遇到问题,我的依赖项下载并包含在“外部库”中就好了,但我无法在 IntelliJ IDEA 中导入它的类。

请看以下图片:

外部图书馆

导入错误

这是我的 build.gradle:

buildscript {
ext.kotlin_version = '1.2.50'

repositories {
    mavenCentral()
}
dependencies {
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

group 'cf.dogo'
version '1.0-SNAPSHOT'

apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'application'
apply plugin: 'maven'

mainClassName = "cf.dogo.core.boot.BootKt"

sourceCompatibility = 1.8

repositories {
    mavenCentral()
    jcenter()
    maven {url 'https://jitpack.io'}
}

dependencies {
    compile "org.jetbrains.kotlin:kotlin-reflect"
    compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
    compile 'net.dv8tion:JDA:3.6.0_376'
    compile 'org.mongodb:mongodb-driver:3.6.3'
    compile 'com.github.NathanPB:DogoAPI:master-SNAPSHOT' //That one is the problematic dependency
}

compileKotlin {
    kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
    kotlinOptions.jvmTarget = "1.8"
}

jar {
    manifest {
        attributes 'Main-Class': 'cf.dogo.core.boot.BootKt'
    }
    from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
}
Run Code Online (Sandbox Code Playgroud)

请注意,它来自JitPack

提前致谢。