我在我的 gradle 项目中收到此警告/错误:
Unsupported Modules Detected: Compilation is not supported for following modules: io.github.dogo-Dogo, Dogo_main, Dogo_test. Unfortunately you can't have non-Gradle Java modules and Android-Gradle modules in one project.
我对 Gradle 并不完全熟悉,我搜索了这样的错误,只是在 Android 环境中找到了这些东西,但我只使用了 Kotlin 和一些库。
buildscript {
ext.kotlin_version = '1.3.11'
ext.ktor_version = '1.0.1'
ext.dokka_version = '0.9.17'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.17"
}
}
plugins {
id "org.jetbrains.dokka" version '0.9.17'
}
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'application'
apply plugin: 'maven'
group 'io.github.dogo'
version '1.0-SNAPSHOT'
mainClassName = "io.github.dogo.core.boot.BootKt"
sourceCompatibility = 1.8
repositories {
mavenCentral()
jcenter()
maven {url 'https://jitpack.io'}
maven {
name = 'sponge'
url = 'https://repo.spongepowered.org/maven'
}
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-reflect"
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compile "io.ktor:ktor-server-core:$ktor_version"
compile "io.ktor:ktor-server-netty:$ktor_version"
compile 'net.dv8tion:JDA:3.8.1_447'
compile 'org.mongodb:mongodb-driver:3.6.3'
compile 'org.spongepowered:configurate-json:3.6'
compile 'com.fasterxml.jackson.core:jackson-databind:2.0.1'
compile 'com.mashape.unirest:unirest-java:1.3.1'
compile 'org.slf4j:slf4j-simple:1.6.1'
compile 'org.apache.logging.log4j:log4j-core:2.11.1'
compile 'org.apache.logging.log4j:log4j-api:2.11.1'
compile 'org.jetbrains.kotlin:kotlin-script-runtime:1.3.11'
compile 'org.jetbrains.kotlin:kotlin-script-util:1.3.11'
compile 'org.jetbrains.kotlin:kotlin-compiler-embeddable:1.3.11'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.1'
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
jar {
manifest {
attributes 'Main-Class': 'io.github.dogo.core.boot.BootKt'
}
from {
configurations.compile
.findAll { !it.name.endsWith('pom') }
.collect { it.isDirectory() ? it : zipTree(it) }
}
}
dokka {
outputFormat = 'html'
outputDirectory = "$buildDir/docs"
}
那么,我该如何解决这个错误/警告信息?我不确定,但我认为当我添加 Dokka(Kotlin 文档工具)时它开始出现