pact-foundation / pact-jvm

JVM version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.
https://docs.pact.io
Apache License 2.0
1.08k stars 479 forks source link

Dependencies broken since 4.4.0-beta.8 #1639

Closed octopus-prime closed 10 months ago

octopus-prime commented 1 year ago

Trying out '4.4.0-beta.8'

Execution failed for task ':compileTestJava'.
> Could not resolve all files for configuration ':testCompileClasspath'.
   > Could not find com.michael-bull.kotlin-result:kotlin-result:.
     Required by:
         project : > au.com.dius.pact.provider:junit5:4.4.0-beta.8 > au.com.dius.pact:provider:4.4.0-beta.8
         project : > au.com.dius.pact.provider:junit5:4.4.0-beta.8 > au.com.dius.pact.core:pactbroker:4.4.0-beta.8
   > Could not find io.github.microutils:kotlin-logging-jvm:.
     Required by:
         project : > au.com.dius.pact.provider:junit5:4.4.0-beta.8 > au.com.dius.pact.core:support:4.4.0-beta.8
   > Could not find com.michael-bull.kotlin-result:kotlin-result-jvm:.
     Required by:
         project : > au.com.dius.pact.provider:junit5:4.4.0-beta.8 > au.com.dius.pact.core:support:4.4.0-beta.8
   > Could not find io.github.microutils:kotlin-logging:.
     Required by:
         project : > au.com.dius.pact.provider:junit5:4.4.0-beta.8 > au.com.dius.pact.core:pactbroker:4.4.0-beta.8

Trying out '4.4.0'

Execution failed for task ':compileTestJava'.
> Could not resolve all files for configuration ':testCompileClasspath'.
   > Could not find com.michael-bull.kotlin-result:kotlin-result:.
     Required by:
         project : > au.com.dius.pact.provider:junit5:4.4.0 > au.com.dius.pact:provider:4.4.0
         project : > au.com.dius.pact.provider:junit5:4.4.0 > au.com.dius.pact.core:pactbroker:4.4.0
   > Could not find io.github.microutils:kotlin-logging-jvm:.
     Required by:
         project : > au.com.dius.pact.provider:junit5:4.4.0 > au.com.dius.pact.core:support:4.4.0
   > Could not find com.michael-bull.kotlin-result:kotlin-result-jvm:.
     Required by:
         project : > au.com.dius.pact.provider:junit5:4.4.0 > au.com.dius.pact.core:support:4.4.0
   > Could not find io.github.microutils:kotlin-logging:.
     Required by:
         project : > au.com.dius.pact.provider:junit5:4.4.0 > au.com.dius.pact.core:pactbroker:4.4.0

No problems with '4.4.0-beta.7'

rholshausen commented 1 year ago

Can you try 4.4.1?

WeronikaJargielo commented 1 year ago

Also problem with 4.4.1 :/

Execution failed for task ':compileTestKotlin'.
> Error while evaluating property 'filteredArgumentsMap' of task ':compileTestKotlin'
   > Could not resolve all files for configuration ':testCompileClasspath'.
      > Could not find org.apache.httpcomponents.client5:httpclient5:.
        Required by:
            project : > au.com.dius.pact:consumer:4.4.1
            project : > au.com.dius.pact.core:model:4.4.1 > au.com.dius.pact.core:support:4.4.1
            project : > au.com.dius.pact.core:model:4.4.1 > au.com.dius.pact.core:pactbroker:4.4.1
      > Could not find org.json:json:.
        Required by:
            project : > au.com.dius.pact:consumer:4.4.1
      > Could not find org.apache.httpcomponents.client5:httpclient5-fluent:.
        Required by:
            project : > au.com.dius.pact.core:model:4.4.1 > au.com.dius.pact.core:support:4.4.1
rholshausen commented 1 year ago

What are you running? Is this in your project, or are you running the Pact-JVM project build?

octopus-prime commented 1 year ago

Version 4.4.1 works fine here. Thanks!

WeronikaJargielo commented 1 year ago

What are you running? Is this in your project, or are you running the Pact-JVM project build?

Sorry, in my project.

jenssuhr commented 1 year ago

I've got the same issue in my project using 4.4.1 (using both Junit5 consumer and provider dependencies):

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileIntegrationTestKotlin'.
> Error while evaluating property 'filteredArgumentsMap' of task ':app:compileIntegrationTestKotlin'
   > Could not resolve all files for configuration ':app:integrationTestCompileClasspath'.
      > Could not find org.json:json:.
        Required by:
            project :app > au.com.dius.pact.consumer:junit5:4.4.1 > au.com.dius.pact:consumer:4.4.1
      > Could not find org.apache.httpcomponents.client5:httpclient5-fluent:.
        Required by:
            project :app > au.com.dius.pact.provider:junit5:4.4.1 > au.com.dius.pact.core:support:4.4.1
artamonovkirill commented 1 year ago

Also fails in this project: PR, CI run

rholshausen commented 1 year ago

@WeronikaJargielo @artamonovkirill I have released 4.4.2 with the corrected dependency constraints for org.json:json and org.apache.httpcomponents.client5:httpclient5-fluent

jenssuhr commented 1 year ago

4.4.2 works fine, thank you for the quick fix!

mu2in commented 1 year ago

Also problem with 4.4.2

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileTestKotlin'.
> Error while evaluating property 'filteredArgumentsMap' of task ':app:compileTestKotlin'
   > Could not resolve all files for configuration ':app:testCompileClasspath'.
      > Could not resolve au.com.dius.pact.provider:junit5:4.4.2.
        Required by:
            project :app
         > Could not resolve au.com.dius.pact.provider:junit5:4.4.2.
            > Failed to add into filestore '/root/.gradle/caches/modules-2/metadata-2.97/descriptors' at 'au.com.dius.pact.provider/junit5/4.4.2/a8be1fe3b3911d3d3425fe720cf42835/descriptor.bin' 
               > java.lang.NullPointerException (no error message)
MahatmaFatalError commented 1 year ago

I am facing the same issue as @mu2in

* What went wrong:
Execution failed for task ':my-service-pact:compileTestJava'.
> Could not resolve all files for configuration ':my-service-pact:testCompileClasspath'.
   > Could not resolve au.com.dius.pact.consumer:junit5:4.4.2.
     Required by:
         project :my-service-pact
      > Could not resolve au.com.dius.pact.consumer:junit5:4.4.2.
         > Failed to add into filestore '/home/gradle/.gradle/caches/modules-2/metadata-2.97/descriptors' at 'au.com.dius.pact.consumer/junit5/4.4.2/39b9944dde76b5f9987586cd566e2325/descriptor.bin' 
            > java.lang.NullPointerException (no error message)
      > Could not resolve au.com.dius.pact.consumer:junit5:4.4.2.
         > Failed to add into filestore '/home/gradle/.gradle/caches/modules-2/metadata-2.97/descriptors' at 'au.com.dius.pact.consumer/junit5/4.4.2/a8be1fe3b3911d3d3425fe720cf42835/descriptor.bin' 
            > java.lang.NullPointerException (no error message)
   > Could not resolve au.com.dius.pact.provider:junit5:4.4.2.
     Required by:
         project :my-service-pact
      > Could not resolve au.com.dius.pact.provider:junit5:4.4.2.
         > Failed to add into filestore '/home/gradle/.gradle/caches/modules-2/metadata-2.97/descriptors' at 'au.com.dius.pact.provider/junit5/4.4.2/39b9944dde76b5f9987586cd566e2325/descriptor.bin' 
            > java.lang.NullPointerException (no error message)
      > Could not resolve au.com.dius.pact.provider:junit5:4.4.2.
         > Failed to add into filestore '/home/gradle/.gradle/caches/modules-2/metadata-2.97/descriptors' at 'au.com.dius.pact.provider/junit5/4.4.2/a8be1fe3b3911d3d3425fe720cf42835/descriptor.bin' 
            > java.lang.NullPointerException (no error message)

Note that this issue only occurs in the jenkins ci pipeline. Locally it seems to work. Java 11.0.16 with gradle-7.1.1

EDIT: problem seems to be specific to the gradle version. After update to latest gradle(w) it works

rholshausen commented 1 year ago

For people having this issue, upgrade Gradle to either 6.9.3 or 7.5.1. This looks to be an issue with Gradle loading the Gradle module metadata that is published along side the actual artifacts.