我正在尝试将库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 auto构建它,我收到以下错误
警告:根项目'DB-Table-To-Orm':无法构建Kotlin项目配置详细信息:java.lang.reflect.InvocationTargetException:null引起:org.gradle.api.artifacts.ResolveException:无法解析所有依赖项for configuration':compileClasspath' . 引起:org.gradle.internal.resolve.ModuleVersionNotFoundException:找不到org.jetbrains.exposed:expposed: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必需:project:
所以,我看in the repo并且 exposed
目录之外没有 jetbrains
之外的路径 .
如何使用Gradle安装Exposed库?他们的路径写得不正确吗?我应该在项目中添加错误报告吗?或者我只是把 compile
声明放在错误的位置?
对不起,如果这看起来像是一个愚蠢的请求,我是 Javaland
和 Kotlin
和 IntelliJ
的新手 . 来到 .NET
世界 .
Update
这是 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"
}
1 回答
据我所知,Exposed不在主要的bintray repo(又名jcenter) . 要在Exposed的仓库中进行gradle搜索,您需要添加以下内容:
到你的
repositories
部分 .例:
然后只是重建,它应该工作得很好