我嘗試將wiremock-extension 添加到專案中,但Gradle 找不到所需的存盤庫。
- 我從官方 maven repo 獲取 repo:
https://mvnrepository.com/artifact/com.github.JensPiegsa/wiremock-extension/0.4.0
- 構建.gradle:
plugins {
id "java"
}
....
repositories{
mavenCentral()
maven {
url "https://repository.mulesoft.org/nexus/content/repositories/public/"
}
}
dependencies {
...
//wiremock
testImplementation "com.github.tomakehurst:wiremock-jre8-standalone:2.24.1"
testImplementation group: 'com.github.JensPiegsa', name: 'wiremock-extension', version: '0.4.0'
}
我收到的錯誤:
WireMockEducation:test: Could not find com.github.JensPiegsa:wiremock-extension:0.4.0. Searched in the following locations: - https://repo.maven.apache.org/maven2/com/github/JensPiegsa/wiremock-extension/0.4.0/wiremock-extension-0.4.0.pom - https://repository.mulesoft.org/nexus/content/repositories/public/com/github/JensPiegsa/wiremock-extension/0.4.0/wiremock-extension-0.4.0.pom
uj5u.com熱心網友回復:
首先, mvnrepository 不是“官方倉庫”。相反,它是一個聚合來自多個“真實”maven 存盤庫的資訊的站點,它可能不包含最新資訊。
如果您查看實際的Mulesoft 存盤庫,您會發現該模塊確實不再存在(除了一些元資料):
Index of /repositories/public/com/github/JensPiegsa/wiremock-extension
Name Last Modified Size Description
Parent Directory
maven-metadata.xml.md5 Mon Sep 13 04:55:04 UTC 2021 33
maven-metadata.xml.sha-256 Mon Sep 13 04:55:04 UTC 2021 65
maven-metadata.xml.sha-512 Mon Sep 13 04:55:04 UTC 2021 129
maven-metadata.xml.sha1 Mon Sep 13 04:55:04 UTC 2021 41
但是從專案檔案中,您可以看到您應該使用 Jitpack 存盤庫而不是 Mulesoft:
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
}
dependencies {
testImplementation "com.github.tomakehurst:wiremock-jre8-standalone:2.24.1"
testImplementation "com.github.JensPiegsa:wiremock-extension:0.4.0"
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/481853.html
