我正在嘗試在我的 kotlin gradle 專案中使用SimpleNativeHooks。我使用的是 kotlin gradle dsl,但是 SimpleNativeHooks 無法找到和下載。我得到的錯誤是:
:KJ:launch:test: Could not find org.repeats.simplenativehooks:simplenativehooks:0.0.1.
Required by:
project :KJ:launch
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
我目前用于回購的代碼是:
dependencyResolutionManagement {
repositories{
maven {
url = java.net.URI("https://raw.github.com/repeats/SimpleNativeHooks/maven-export/")
}
}
}
但在 github README 中,maven 示例還包括其他一些示例。我想知道我在 gradle 構建中出現錯誤的原因是否是因為我沒有正確地將 maven 代碼轉換為 gradle,可能是因為我錯過了其中一些欄位(比如 repo id,我沒有知道如何包含在 gradle 中)。
uj5u.com熱心網友回復:
這個 URL 不是一個公平的 maven 存盤庫(它回傳 400:301:永久重定向后的無效請求),所以你需要給 Gradle 一個提示,在哪里尋找工件元資料 - 在這種情況下,根目錄中有pom.xml:
maven {
url = uri("https://raw.github.com/repeats/SimpleNativeHooks/maven-export/")
metadataSources {
mavenPom()
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/405294.html
標籤:
上一篇:無法識別的函式或變數
下一篇:在VBAExcel中組合兩個宏
