/**
*
- * Copyright 2013-2016 the original author or authors.
+ * Copyright 2013-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -284,7 +348,7 @@
/**
*
- * Copyright 2013-2016 the original author or authors.
+ * Copyright 2013-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -318,7 +382,7 @@
/**
*
- * Copyright 2013-2016 the original author or authors.
+ * Copyright 2013-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -369,6 +433,13 @@ org.springframework.cloud.contract.spec.Contract.make {
Define a package in which base classes are placed. In this case we define
+a package called hello. If there’s a contract under /contracts/hello/V1/Contract.groovy` then
+we’ll search for a HelloV1Base base class. We’re taking two last folders
+from the path and combine them into a class name.
A setup of a repo that contains all common contracts. It can exclude the target / build
+folder that gets created when you’re installing stubs locally as a consumer.
+
+
+
+
<properties>
+ <!-- We don't want the tests to be executed cause we're just build stubs -->
+ <skipTests>true</skipTests>
+ <!-- The target / build folder needs to be excluded - we don't want to check its contents -->
+ <excludeBuildFolders>true</excludeBuildFolders>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.cloud</groupId>
+ <artifactId>spring-cloud-contract-maven-plugin</artifactId>
+ <configuration>
+ <!-- By default it would search under src/test/resources/ -->
+ <contractsDirectory>${project.basedir}</contractsDirectory>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
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.
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.
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.
+
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.
@@ -352,12 +410,37 @@ create jar with stubs Default value is: ${project.build.director
This parameter is only used when goal is executed outside of
maven project.
Default value is: ${basedir}. User property is: contractsDirectory.
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/.
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
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
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
+
If true then any file laying in a path that contains
+build or target will get excluded in
+further processing.
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
As you can see there are no dependencies other than the Spring Cloud Contract Verifier Maven plugin.
+
As you can see there are no dependencies other than the Spring Cloud Contract Maven Plugin.
Those poms are necessary for the consumer side to run mvn clean install -DskipTests to locally install
stubs of the producer project.
@@ -3528,7 +3528,7 @@ Let’s take a look at the following example:
<baseClassMapping>
<contractPackageRegex>.*com.*</contractPackageRegex>
<baseClassFQN>com.example.TestBase</baseClassFQN>
- </baseClassMapping >
+ </baseClassMapping>
</baseClassMappings>
</configuration>
</plugin>
@@ -3549,7 +3549,7 @@ will be extending the com.example.ComBase whereas the rest of tests
Invoking generated tests
-
Spring Cloud Contract Verifier Maven Plugin generates verification code into directory /generated-test-sources/contractVerifier and attach this directory to testCompile goal.
+
Spring Cloud Contract Maven Plugin generates verification code into directory /generated-test-sources/contractVerifier and attach this directory to testCompile goal.