【发布时间】:2017-09-06 19:55:25
【问题描述】:
我正在尝试将库 Exposed 添加到我的项目中。所以,它把我带到了the bintray page,它说要使用compile 'org.jetbrains.exposed:exposed:0.8.5'。我打开我的文件build.gradle 并将该文件放入dependencies 段中:
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
compile 'org.jetbrains.exposed:exposed:0.8.5'
}
IntelliJ 自动构建它,我收到以下错误
警告:根项目“DB-Table-To-Orm”:无法构建 Kotlin 项目配置详情: java.lang.reflect.InvocationTargetException: null 原因: org.gradle.api.artifacts.ResolveException:无法解决所有问题 配置“:compileClasspath”的依赖项。造成的: org.gradle.internal.resolve.ModuleVersionNotFoundException:不能 找到 org.jetbrains.exposed:exposed:0.8.5。在以下搜索 地点: https://repo1.maven.org/maven2/org/jetbrains/exposed/exposed/0.8.5/exposed-0.8.5.pom https://repo1.maven.org/maven2/org/jetbrains/exposed/exposed/0.8.5/exposed-0.8.5.jar 要求: 项目:
所以,我查看in the repo 并没有超出jetbrains 的路径与exposed 目录。
如何使用 Gradle 安装 Exposed 库?他们的路径写错了吗?我应该在项目中提交错误报告吗?还是我只是将compile 语句放在错误的位置?
抱歉,如果这看起来是一个愚蠢的请求,我是 Javaland 和 Kotlin 和 IntelliJ 的新手。为.NET 世界而来。
更新
这是build.gradle 的全部内容:
group 'com.awebsite.db-table-to-orm'
version '1.0-SNAPSHOT'
buildscript {
ext.kotlin_version = '1.1.4-2'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'kotlin'
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
compile 'org.jetbrains.exposed:exposed:0.8.5'
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
【问题讨论】:
-
你能发布你的 build.gradle 和 repositories 块吗?
-
@GabrieleMariotti 发布了
build.gradle文件。请注意,在该项目的bintray网页中,它表示该位置位于https://dl.bintray.com/kotlin/exposed
标签: gradle kotlin kotlin-exposed