Home > Software design >  WireMockEducation:test: Could not find com.github.JensPiegsa:wiremock-extension:0.4.0
WireMockEducation:test: Could not find com.github.JensPiegsa:wiremock-extension:0.4.0

Time:05-28

I tried to add the wiremock-extension to the project, but Gradle can't find the needed repository.

  • I take the repo from the official maven repo:

https://mvnrepository.com/artifact/com.github.JensPiegsa/wiremock-extension/0.4.0

  • build.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'
}

The error I received:

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

CodePudding user response:

First of all, mvnrepository isn't an "official repo". Rather, it is a site that aggregates information from multiple "real" maven repositories, and it might not contain the latest information.

If you look at the actual Mulesoft repository, you will find that the module is indeed not there anymore (except for some metadata):

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  

But from the project documentation, you can see that you should use the Jitpack repository instead of 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"
}
  • Related