# Spring Cloud Contract Maven Plugin – spring-cloud-contract:convert

## Spring Cloud Contract Maven Plugin

## spring-cloud-contract:convert

Full name:

org.springframework.cloud:spring-cloud-contract-maven-plugin:2.0.0.BUILD-SNAPSHOT:convert

Description:

Convert Spring Cloud Contract Verifier contracts into WireMock stubs mappings.

This goal allows you to generate `stubs-jar` or execute `spring-cloud-contract:run` with generated WireMock mappings.

Attributes:

- Binds by default to the lifecycle phase: `process-test-resources`.

### Optional Parameters

Name | Type | Since | Description
--- | --- | --- | ---
contractDependency | `Dependency` | `-` | (no description) User property is: `contractDependency`.
contractsDirectory | `File` | `-` | Directory containing Spring Cloud Contract Verifier contracts written using the GroovyDSL Default value is: `${project.basedir}/src/test/resources/contracts`. User property is: `spring.cloud.contract.verifier.contractsDirectory`.
contractsPath | `String` | `-` | The path in the JAR with all the contracts where contracts for this particular service lay. If not provided will be resolved to `groupid/artifactid`. Example: If `groupid` is `com.example` and `artifactid` is `service` then the resolved path will be `/com/example/artifactid` User property is: `contractsPath`.
contractsRepositoryUrl | `String` | `-` | The URL from which a JAR containing the contracts should get downloaded. If not provided but artifactid / coordinates notation was provided then the current Maven's build repositories will be taken into consideration User property is: `contractsRepositoryUrl`.
contractsWorkOffline | `boolean` | `-` | If `true` then JAR with contracts will be taken from local maven repository Default value is: `false`. User property is: `contractsWorkOffline`.
destination | `File` | `-` | (no description) Default value is: `${basedir}`. User property is: `stubsDirectory`.
excludeBuildFolders | `boolean` | `-` | If `true` then any file laying in a path that contains `build` or `target` will get excluded in further processing. Default value is: `false`. User property is: `excludeBuildFolders`.
skip | `boolean` | `-` | (no description) Default value is: `false`. User property is: `spring.cloud.contract.verifier.skip`.
source | `File` | `-` | Directory containing contracts written using the GroovyDSL This parameter is only used when goal is executed outside of maven project. Default value is: `${basedir}`. User property is: `contractsDirectory`.
stubsDirectory | `File` | `-` | Directory where the generated WireMock stubs from Groovy DSL should be placed. You can then mention them in your packaging task to create jar with stubs Default value is: `${project.build.directory}/stubs/`.

### Parameter Details

contractDependency:

(no description)

- Type: `org.apache.maven.model.Dependency`
- Required: `No`
- User Property: `contractDependency`

contractsDirectory:

Directory containing Spring Cloud Contract Verifier contracts written using the GroovyDSL

- Type: `java.io.File`
- Required: `No`
- User Property: `spring.cloud.contract.verifier.contractsDirectory`
- Default: `${project.basedir}/src/test/resources/contracts`

contractsPath:

The path in the JAR with all the contracts where contracts for this particular service lay. If not provided will be resolved to `groupid/artifactid`. Example:
If `groupid` is `com.example` and `artifactid` is `service` then the resolved path will be `/com/example/artifactid`

- Type: `java.lang.String`
- Required: `No`
- User Property: `contractsPath`

contractsRepositoryUrl:

The URL from which a JAR containing the contracts should get downloaded. If not provided but artifactid / coordinates notation was provided then the current Maven's build repositories will be taken into consideration

- Type: `java.lang.String`
- Required: `No`
- User Property: `contractsRepositoryUrl`

contractsWorkOffline:

If `true` then JAR with contracts will be taken from local maven repository

- Type: `boolean`
- Required: `No`
- User Property: `contractsWorkOffline`
- Default: `false`

destination:

(no description)

- Type: `java.io.File`
- Required: `No`
- User Property: `stubsDirectory`
- Default: `${basedir}`

excludeBuildFolders:

If `true` then any file laying in a path that contains `build` or `target` will get excluded in further processing.

- Type: `boolean`
- Required: `No`
- User Property: `excludeBuildFolders`
- Default: `false`

skip:

(no description)

- Type: `boolean`
- Required: `No`
- User Property: `spring.cloud.contract.verifier.skip`
- Default: `false`

source:

Directory containing contracts written using the GroovyDSL

This parameter is only used when goal is executed outside of maven project.

- Type: `java.io.File`
- Required: `No`
- User Property: `contractsDirectory`
- Default: `${basedir}`

stubsDirectory:

Directory where the generated WireMock stubs from Groovy DSL should be placed. You can then mention them in your packaging task to create jar with stubs

- Type: `java.io.File`
- Required: `No`
- Default: `${project.build.directory}/stubs/`