Fork me on GitHub

spring-cloud-contract:convert

Full name:

org.springframework.cloud:spring-cloud-contract-maven-plugin:3.1.8:convert

Description:

Convert Spring Cloud Contract Verifier contracts into stubs mappings.

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

Attributes:

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.
<contractsMode> StubRunnerProperties$StubsMode - Picks the mode in which stubs will be found and registered.
Default value is: CLASSPATH.
User property is: contractsMode.
<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.
<contractsProperties> Map - Map of properties that can be passed to custom StubDownloaderBuilder.
User property is: contractsProperties.
<contractsRepositoryPassword> String - The password to be used to connect to the repo with contracts.
User property is: contractsRepositoryPassword.
<contractsRepositoryProxyHost> String - The proxy host to be used to connect to the repo with contracts.
User property is: contractsRepositoryProxyHost.
<contractsRepositoryProxyPort> Integer - The proxy port to be used to connect to the repo with contracts.
User property is: contractsRepositoryProxyPort.
<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.
<contractsRepositoryUsername> String - The user name to be used to connect to the repo with contracts.
User property is: contractsRepositoryUsername.
<convertToYaml> boolean - If true then will convert contracts to a YAML representation.
Default value is: false.
User property is: convertToYaml.
<deleteStubsAfterTest> boolean - If set to false will NOT delete stubs from a temporary folder after running tests.
Default value is: true.
User property is: deleteStubsAfterTest.
<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.
<failOnNoContracts> boolean - When enabled, this flag will tell stub runner to throw an exception when no stubs / contracts were found.
Default value is: true.
User property is: failOnNoContracts.
<incrementalContractStubs> boolean - If set to true then stubs are created only when contracts have changed since last build.
Default value is: true.
User property is: incrementalContractStubs.
<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

<contractsMode>

Picks the mode in which stubs will be found and registered.
  • Type: org.springframework.cloud.contract.stubrunner.spring.StubRunnerProperties$StubsMode
  • Required: No
  • User Property: contractsMode
  • Default: CLASSPATH

<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

<contractsProperties>

Map of properties that can be passed to custom StubDownloaderBuilder.
  • Type: java.util.Map
  • Required: No
  • User Property: contractsProperties

<contractsRepositoryPassword>

The password to be used to connect to the repo with contracts.
  • Type: java.lang.String
  • Required: No
  • User Property: contractsRepositoryPassword

<contractsRepositoryProxyHost>

The proxy host to be used to connect to the repo with contracts.
  • Type: java.lang.String
  • Required: No
  • User Property: contractsRepositoryProxyHost

<contractsRepositoryProxyPort>

The proxy port to be used to connect to the repo with contracts.
  • Type: java.lang.Integer
  • Required: No
  • User Property: contractsRepositoryProxyPort

<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

<contractsRepositoryUsername>

The user name to be used to connect to the repo with contracts.
  • Type: java.lang.String
  • Required: No
  • User Property: contractsRepositoryUsername

<convertToYaml>

If true then will convert contracts to a YAML representation.
  • Type: boolean
  • Required: No
  • User Property: convertToYaml
  • Default: false

<deleteStubsAfterTest>

If set to false will NOT delete stubs from a temporary folder after running tests.
  • Type: boolean
  • Required: No
  • User Property: deleteStubsAfterTest
  • Default: true

<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

<failOnNoContracts>

When enabled, this flag will tell stub runner to throw an exception when no stubs / contracts were found.
  • Type: boolean
  • Required: No
  • User Property: failOnNoContracts
  • Default: true

<incrementalContractStubs>

If set to true then stubs are created only when contracts have changed since last build.
  • Type: boolean
  • Required: No
  • User Property: incrementalContractStubs
  • Default: true

<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/