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() pactSource = 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 pro

Artifact Version Name Latest uploaded at
3.5.10 pact-jvm-provider-gradle_2.11 2017-11-21 21:55:58 UTC
3.5.9 pact-jvm-provider-gradle_2.11 2017-11-15 04:02:47 UTC
3.5.8 pact-jvm-provider-gradle_2.11 2017-10-13 02:41:32 UTC
3.5.7-jre7.0 pact-jvm-provider-gradle_2.11 2017-10-03 05:51:28 UTC
3.5.7 pact-jvm-provider-gradle_2.11 2017-10-03 00:47:46 UTC
3.5.6-jre7.0 pact-jvm-provider-gradle_2.11 2017-09-28 05:15:57 UTC
3.5.6 pact-jvm-provider-gradle_2.11 2017-09-27 02:05:14 UTC
3.5.5-jre7.0 pact-jvm-provider-gradle_2.11 2017-09-14 02:36:22 UTC
3.5.5 pact-jvm-provider-gradle_2.11 2017-09-11 23:11:20 UTC
3.5.4-jre7.0 pact-jvm-provider-gradle_2.11 2017-08-19 07:58:11 UTC
3.5.4 pact-jvm-provider-gradle_2.11 2017-08-18 05:37:14 UTC
2.4.19 pact-jvm-provider-gradle_2.11 2017-08-17 00:02:49 UTC
3.5.3-jre7.0 pact-jvm-provider-gradle_2.11 2017-08-10 00:30:14 UTC
3.5.3 pact-jvm-provider-gradle_2.11 2017-08-06 07:57:43 UTC
3.5.2 pact-jvm-provider-gradle_2.11 2017-07-12 01:11:37 UTC
3.5.2-jre7.0 pact-jvm-provider-gradle_2.11 2017-07-12 00:37:26 UTC
3.5.1 pact-jvm-provider-gradle_2.11 2017-07-09 08:17:38 UTC
3.5.1-jre7.1 pact-jvm-provider-gradle_2.11 2017-07-09 06:56:10 UTC
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