我的Kotlin项目依赖于我从githut克隆并修改的Java Maven项目。假设它位于文件夹d:\code\otherproject
中。我该如何在我的build.gradle.kts文件中表示呢?还是我必须将其全部移动到公共目录树中并将该项目也从Maven转换为Gradle?
这是到目前为止我的build.gradle.kts的内容:
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
java
kotlin("jvm") version "1.3.20"
}
group = "com.myproject"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
jcenter()
maven { setUrl("https://dl.bintray.com/kotlin/exposed") }
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
testCompile("junit", "junit", "4.12")
compile("io.github.microutils:kotlin-logging:1.6.20")
compile("com.xenomachina:kotlin-argparser:2.0.7")
compile("commons-io:commons-io:2.6")
compile("org.jetbrains.exposed:exposed:0.11.2")
compile("org.postgresql:postgresql:42.2.5")
compile("com.zaxxer:HikariCP:3.2.0")
compile("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.1")
compile("com.google.guava:guava:27.0.1-jre")
compile("ch.qos.logback:logback-classic:1.3.0-alpha4")
compile("ch.qos.logback:logback-core:1.3.0-alpha4")
compile("org.fusesource.jansi:jansi:1.17.1")
compile("org.apache.commons:commons-csv:1.6")
compile("de.erichseifert.vectorgraphics2d:VectorGraphics2D:0.13")
compile("org.apache.commons:commons-compress:1.18")
compile("org.jsoup:jsoup:1.11.3")
}
configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_8
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}