From 82d0e6eb7a3491acaeb10b3fd7aab6d7f23cb5ee Mon Sep 17 00:00:00 2001 From: Ankur Shukla Date: Tue, 15 Dec 2020 02:41:13 +0530 Subject: [PATCH 1/4] Added a section "Cloning the repository on Windows" for issue#1567 (#1575) * Added a section "Cloning the repository on Windows" * Changes to incorporate feedback from Buzzardo * Formatting as per feedback from Buzzardo * removing bullet points. * Presenting user with unnumbered list for git config options * fixing a small typo * adding code-fences and Co-authored-by: Ankur Shukla fixes gh-1567 --- docs/src/main/asciidoc/_building.adoc | 35 ++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/docs/src/main/asciidoc/_building.adoc b/docs/src/main/asciidoc/_building.adoc index 57c00a928d..6a4eb1cc6c 100644 --- a/docs/src/main/asciidoc/_building.adoc +++ b/docs/src/main/asciidoc/_building.adoc @@ -1,5 +1,38 @@ == How to Build Spring Cloud Contract +=== Cloning the repository on Windows + +While cloning this project on Windows, some files in the git repository may exceed the Windows maximum file path limit of 255 characters, which may +result in an incorrectly (probably partially) checked out repository. + +To resolve this issue, you can set the `core.longPaths` attribute to `true` or clone the Spring Cloud Contract repository. + +To set the `core.longPaths` attribute to `true`, you have three options: + +- Change it for all users of the machine (doing so requires administrator privileges): + + +[source,bash] +---- +git config --system core.longPaths true +git clone https://github.com/spring-cloud/spring-cloud-contract.git +---- + +- Change it for the current user (no administrative privileges required): + +[source,bash] +---- +git config --global core.longPaths true +git clone https://github.com/spring-cloud/spring-cloud-contract.git +---- + +- Change for just this repository (administrative privileges depend on where the repository is being cloned to): + +[source,bash] +---- +git clone -c core.longPaths true https://github.com/spring-cloud/spring-cloud-contract.git +---- + IMPORTANT: You need to have all the necessary Groovy plugins installed for your IDE to properly resolve the sources. For example, in Intellij IDEA, having both the Eclipse Groovy Compiler Plugin and the GMavenPlus Intellij @@ -80,7 +113,7 @@ run the following command: ./scripts/parallelBuild.sh ``` -To use eight 8 cores, run thke following command: +To use eight 8 cores, run the following command: ``` CORES=8 ./scripts/parallelBuild.sh From e3d0de106b1413f757ddf7145b90e8787321e4d3 Mon Sep 17 00:00:00 2001 From: Sudhir Tumati Date: Tue, 15 Dec 2020 15:19:05 +0800 Subject: [PATCH 2/4] Add javadoc for AutoConfigureWireMock (#1584) --- .../wiremock/AutoConfigureWireMock.java | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/spring-cloud-contract-wiremock/src/main/java/org/springframework/cloud/contract/wiremock/AutoConfigureWireMock.java b/spring-cloud-contract-wiremock/src/main/java/org/springframework/cloud/contract/wiremock/AutoConfigureWireMock.java index 72154793b9..3e667e4c19 100644 --- a/spring-cloud-contract-wiremock/src/main/java/org/springframework/cloud/contract/wiremock/AutoConfigureWireMock.java +++ b/spring-cloud-contract-wiremock/src/main/java/org/springframework/cloud/contract/wiremock/AutoConfigureWireMock.java @@ -46,12 +46,50 @@ import org.springframework.context.annotation.Import; @Inherited public @interface AutoConfigureWireMock { + /** + * Configures WireMock instance to listen on specified port. + *

+ * Set this value to 0 for WireMock to listen to a random port. + *

+ * @return port to which WireMock instance should listen to + */ int port() default 8080; + /** + * If specified, configures WireMock instance to enable HTTPS on specified + * port. + *

+ * Set this value to 0 for WireMock to listen to a random port. + *

+ * @return port to which WireMock instance should listen to + */ int httpsPort() default -1; + /** + * The resource locations to use for loading WireMock mappings. + *

+ * When none specified, src/test/resources/mappings is used as default + * location. + *

+ *

+ * To customize the location, this attribute must be set to the directory where + * mappings are stored. + *

+ * @return locations to read WireMock mappings from + */ String[] stubs() default { "" }; + /** + * The resource locations to use for loading WireMock response bodies. + *

+ * When none specified, src/test/resources/__files is used as default. + *

+ *

+ * To customize the location, this attribute must be set to the parent directory of + * __files directory. + *

+ * @return locations to read WireMock response bodies from + */ String[] files() default { "" }; } From ab9d80c483574418b80728489cb4fc9ac4460568 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Fri, 11 Dec 2020 23:00:43 +0000 Subject: [PATCH 3/4] Workaround for https://github.com/spring-projects/spring-amqp/issues/1285 --- .../restdocs/http-server/build.gradle | 3 -- .../build.gradle | 1 - .../main/java/com/example/RabbitManager.java | 35 +++++++++---------- 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/samples/standalone/restdocs/http-server/build.gradle b/samples/standalone/restdocs/http-server/build.gradle index 0368266f77..b44ec67bcc 100644 --- a/samples/standalone/restdocs/http-server/build.gradle +++ b/samples/standalone/restdocs/http-server/build.gradle @@ -5,9 +5,6 @@ buildscript { maven { url "https://repo.spring.io/snapshot" } maven { url "https://repo.spring.io/milestone" } maven { url "https://repo.spring.io/release" } - maven { url 'https://repo.spring.io/plugins-snapshot' } - maven { url "https://repo.spring.io/plugins-release-local" } - maven { url "https://repo.spring.io/plugins-staging-local/" } } dependencies { classpath "org.springframework.boot:spring-boot-gradle-plugin:${findProperty('bootVersion') ?: bootVersion}" diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/build.gradle b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/build.gradle index d4d589f5cc..197c69ae04 100644 --- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/build.gradle +++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/build.gradle @@ -2,7 +2,6 @@ buildscript { repositories { mavenCentral() mavenLocal() - maven { url 'https://repo.spring.io/plugins-release' } if (project.hasProperty('fatJar')) { jcenter() } diff --git a/tests/samples-messaging-amqp/src/main/java/com/example/RabbitManager.java b/tests/samples-messaging-amqp/src/main/java/com/example/RabbitManager.java index fadc312d30..7b1012b927 100644 --- a/tests/samples-messaging-amqp/src/main/java/com/example/RabbitManager.java +++ b/tests/samples-messaging-amqp/src/main/java/com/example/RabbitManager.java @@ -18,7 +18,6 @@ package com.example; import java.util.LinkedList; import java.util.List; -import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -29,7 +28,7 @@ import org.springframework.amqp.rabbit.annotation.QueueBinding; import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.messaging.handler.annotation.Headers; +import org.springframework.messaging.handler.annotation.Header; import org.springframework.stereotype.Component; interface BookService { @@ -61,26 +60,26 @@ public class RabbitManager { this.rabbitTemplate = rabbitTemplate; } - @RabbitListener( - bindings = @QueueBinding( - value = @Queue, exchange = @Exchange(value = "input", - durable = "true", autoDelete = "false", type = "topic"), - key = "event")) - public void newBook(Book book, @Headers Map headers) { + @RabbitListener(bindings = @QueueBinding(value = @Queue, + exchange = @Exchange(value = "input", durable = "true", autoDelete = "false", type = "topic"), + key = "event")) + // Workaround for https://github.com/spring-projects/spring-amqp/issues/1285 + // public void newBook(Book book, @Headers Map headers) { + public void newBook(Book book, @Header("amqp_replyTo") String replyTo) { LOG.info("Received new book with bookname = " + book.getName()); - LOG.info("Headers = " + headers); - this.service.sendBook(book, headers.get("amqp_replyTo")); +// LOG.info("Headers = " + headers); + this.service.sendBook(book, replyTo); } - @RabbitListener( - bindings = @QueueBinding( - value = @Queue, exchange = @Exchange(value = "input", - durable = "true", autoDelete = "false", type = "topic"), - key = "event2")) - public void newBook2(Book book, @Headers Map headers) { + @RabbitListener(bindings = @QueueBinding(value = @Queue, + exchange = @Exchange(value = "input", durable = "true", autoDelete = "false", type = "topic"), + key = "event2")) + // Workaround for https://github.com/spring-projects/spring-amqp/issues/1285 + // public void newBook2(Book book, @Headers Map headers) { + public void newBook2(Book book, @Header("amqp_replyTo") String replyTo) { LOG.info("newBook2 Received new book with bookname = " + book.getName()); - LOG.info("newBook2 Headers = " + headers); - this.service.sendBook(book, headers.get("amqp_replyTo")); +// LOG.info("newBook2 Headers = " + headers); + this.service.sendBook(book, replyTo); } } From fcde7ee58de39072971301173f8ac8c248ec4579 Mon Sep 17 00:00:00 2001 From: Olga Maciaszek-Sharma Date: Fri, 22 Jan 2021 10:20:21 +0100 Subject: [PATCH 4/4] Use org security policy. --- SECURITY.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 0468595639..0000000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security Policy - -## Reporting a Vulnerability - -To report security vulnerabilities, please go to https://pivotal.io/security.