Versions of artifact au.com.dius:pact-jvm-provider-gradle_2.11

pact-jvm-provider-gradle_2.11

pact-jvm-provider-gradle ======================== Gradle plugin for verifying pacts against a provider. The Gradle plugin creates a task `pactVerify` to your build which will verify all configured pacts against your provider. ## To Use It ### For Gradle versions prior to 2.1 #### 1.1. Add the pact-jvm-provider-gradle jar file to your build script class path: ```groovy buildscript { repositories { mavenCentral() } dependencies { classpath 'au.com.dius:pact-jvm-provider-gradle_2.10:3.2.11' } } ``` #### 1.2. Apply the pact plugin ```groovy apply plugin: 'au.com.dius.pact' ``` ### For Gradle versions 2.1+ ```groovy plugins { id "au.com.dius.pact" version "3.2.11" } ``` ### 2. Define the pacts between your consumers and providers ```groovy pact { serviceProviders { // You can define as many as you need, but each must have a unique name provider1 { // All the provider properties are optional, and have sensible defaults (shown below) protocol = 'http' host = 'localhost' port = 8080 path = '/' // Again, you can define as many consumers for each provider as you need, but each must have a unique name hasPactWith('consumer1') { // currently supports a file path using file() or a URL using url() pactFile = file('path/to/provider1-consumer1-pact.json') } // Or if you have many pact files in a directory hasPactsWith('manyConsumers') { // Will define a consumer for each pact file in the directory. // Consumer name is read from contents of pact file pactFileLocation = file('path/to/pacts') } } } } ``` ### 3. Execute `gradle pactVerify` ## Specifying the provider hostname at runtime If you need to calculate the provider hostname at runtime, you can give a Closure as the provider `host`. ```groovy pact { serviceProviders { provider1 { host = { lookupHostName() } hasPactWith('consumer1') { pactFile = file('path/to/provider1-consumer1-pact.json') } } } } ``` _Since version 3.3.2+/2.4.17+_ you can also give a Closure as the provider `port`. ## Specifying the pact file or URL at runtime [versions 3.2.7/2.4.9+] If you need to calculate the pact file or URL at runtime, you can give a Closure as the provider `pactFile`. ```groovy pact { serviceProviders { provider1 { host = 'localhost' hasPactWith('consumer1') { pactFile = { lookupPactFile() } } } } } ``` ## Starting and shutting down your provider If you need to start-up or shutdown your provider, define Gradle tasks for each action and set `startProviderTask` and `terminateProviderTask` properties of each provider. You could use the jetty tasks here if you provider is built as a WAR file. ```groovy // This will be called before the provider task task('startTheApp') { doLast { // start up your provider here } } // This will be called after the provider task task('killTheApp') { doLast { // kill your provider here } } pact { serviceProviders { provider1 { startProviderTask = startTheApp terminateProviderTask = killTheApp hasPactWith('consumer1') { pactFile = file('path/to/provider1-consumer1-pact.json') } } } } ``` Following typical Gradle behaviour, you can set the provider task properties to the actual tasks, or to the task names as a string (for the case when they haven't been defined yet). ## Preventing the chaining of provi

Artifact Version Name Latest uploaded at
3.5.0-jre7.1 pact-jvm-provider-gradle_2.11 2017-06-24 13:16:41 UTC
3.5.0-jre7 pact-jvm-provider-gradle_2.11 2017-06-24 11:26:44 UTC
3.5.0 pact-jvm-provider-gradle_2.11 2017-06-24 08:11:35 UTC
3.5.0-rc.3 pact-jvm-provider-gradle_2.11 2017-06-20 23:40:46 UTC
3.5.0-rc.2 pact-jvm-provider-gradle_2.11 2017-06-11 07:13:29 UTC
3.4.1 pact-jvm-provider-gradle_2.11 2017-06-11 02:03:31 UTC
3.5.0-rc.1 pact-jvm-provider-gradle_2.11 2017-05-25 03:43:20 UTC
3.4.0 pact-jvm-provider-gradle_2.11 2017-05-18 05:38:55 UTC
3.3.10 pact-jvm-provider-gradle_2.11 2017-05-18 04:02:34 UTC
3.5.0-beta.4 pact-jvm-provider-gradle_2.11 2017-05-14 11:50:29 UTC
3.3.9 pact-jvm-provider-gradle_2.11 2017-05-08 11:34:44 UTC
3.3.8 pact-jvm-provider-gradle_2.11 2017-04-14 03:55:38 UTC
3.3.7 pact-jvm-provider-gradle_2.11 2017-03-27 04:36:52 UTC
3.5.0-beta.3 pact-jvm-provider-gradle_2.11 2017-02-05 05:58:23 UTC
3.3.6 pact-jvm-provider-gradle_2.11 2017-01-26 06:40:23 UTC
3.3.5 pact-jvm-provider-gradle_2.11 2017-01-14 06:51:27 UTC
3.3.4 pact-jvm-provider-gradle_2.11 2017-01-04 05:05:17 UTC
2.4.18 pact-jvm-provider-gradle_2.11 2016-12-30 01:48:03 UTC
3.3.3 pact-jvm-provider-gradle_2.11 2016-11-06 03:47:44 UTC
2.5.0-beta.0 pact-jvm-provider-gradle_2.11 2016-10-22 12:56:11 UTC
3.3.2 pact-jvm-provider-gradle_2.11 2016-10-22 08:58:41 UTC
2.4.17 pact-jvm-provider-gradle_2.11 2016-10-22 07:02:07 UTC
3.3.1 pact-jvm-provider-gradle_2.11 2016-10-02 03:50:20 UTC
2.4.16 pact-jvm-provider-gradle_2.11 2016-10-01 21:37:54 UTC
3.5.0-beta.2 pact-jvm-provider-gradle_2.11 2016-09-21 12:37:52 UTC
3.3.0 pact-jvm-provider-gradle_2.11 2016-09-07 10:52:05 UTC
3.5.0-beta.1 pact-jvm-provider-gradle_2.11 2016-08-28 11:18:57 UTC
2.4.15 pact-jvm-provider-gradle_2.11 2016-08-23 12:56:19 UTC
3.2.13 pact-jvm-provider-gradle_2.11 2016-08-14 01:53:04 UTC
3.2.12 pact-jvm-provider-gradle_2.11 2016-08-07 04:39:30 UTC