From 080b4f77df71ad31cc680951054667d2e5a2587b Mon Sep 17 00:00:00 2001 From: buildmaster Date: Tue, 23 Oct 2018 15:43:52 +0000 Subject: [PATCH 1/5] Update SNAPSHOT to 2.0.2.RELEASE --- docs/pom.xml | 2 +- pom.xml | 4 ++-- spring-cloud-commons-dependencies/pom.xml | 4 ++-- spring-cloud-commons/pom.xml | 2 +- spring-cloud-context-integration-tests/pom.xml | 2 +- spring-cloud-context/pom.xml | 2 +- spring-cloud-starter/pom.xml | 2 +- spring-cloud-test-support/pom.xml | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index edfba75c..bf6ffe3d 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -8,7 +8,7 @@ org.springframework.cloud spring-cloud-commons-parent - 2.0.2.BUILD-SNAPSHOT + 2.0.2.RELEASE pom Spring Cloud Commons Docs diff --git a/pom.xml b/pom.xml index 5e39cc04..d6be1476 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.springframework.cloud spring-cloud-commons-parent - 2.0.2.BUILD-SNAPSHOT + 2.0.2.RELEASE pom Spring Cloud Commons Parent Spring Cloud Commons Parent @@ -11,7 +11,7 @@ org.springframework.cloud spring-cloud-build - 2.0.3.RELEASE + 2.0.4.RELEASE diff --git a/spring-cloud-commons-dependencies/pom.xml b/spring-cloud-commons-dependencies/pom.xml index ea634b9d..66e0b60c 100644 --- a/spring-cloud-commons-dependencies/pom.xml +++ b/spring-cloud-commons-dependencies/pom.xml @@ -5,11 +5,11 @@ spring-cloud-dependencies-parent org.springframework.cloud - 2.0.3.RELEASE + 2.0.4.RELEASE spring-cloud-commons-dependencies - 2.0.2.BUILD-SNAPSHOT + 2.0.2.RELEASE pom spring-cloud-commons-dependencies Spring Cloud Commons Dependencies diff --git a/spring-cloud-commons/pom.xml b/spring-cloud-commons/pom.xml index a4c7a419..6a10b26d 100644 --- a/spring-cloud-commons/pom.xml +++ b/spring-cloud-commons/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-commons-parent - 2.0.2.BUILD-SNAPSHOT + 2.0.2.RELEASE .. spring-cloud-commons diff --git a/spring-cloud-context-integration-tests/pom.xml b/spring-cloud-context-integration-tests/pom.xml index 58fee792..87051612 100644 --- a/spring-cloud-context-integration-tests/pom.xml +++ b/spring-cloud-context-integration-tests/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-commons-parent - 2.0.2.BUILD-SNAPSHOT + 2.0.2.RELEASE .. spring-cloud-context-integration-tests diff --git a/spring-cloud-context/pom.xml b/spring-cloud-context/pom.xml index 3684942b..5702ab77 100644 --- a/spring-cloud-context/pom.xml +++ b/spring-cloud-context/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-commons-parent - 2.0.2.BUILD-SNAPSHOT + 2.0.2.RELEASE .. spring-cloud-context diff --git a/spring-cloud-starter/pom.xml b/spring-cloud-starter/pom.xml index c153f105..353c1d2d 100644 --- a/spring-cloud-starter/pom.xml +++ b/spring-cloud-starter/pom.xml @@ -5,7 +5,7 @@ org.springframework.cloud spring-cloud-commons-parent - 2.0.2.BUILD-SNAPSHOT + 2.0.2.RELEASE spring-cloud-starter spring-cloud-starter diff --git a/spring-cloud-test-support/pom.xml b/spring-cloud-test-support/pom.xml index ddf021d1..0ef22763 100644 --- a/spring-cloud-test-support/pom.xml +++ b/spring-cloud-test-support/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-commons-parent - 2.0.2.BUILD-SNAPSHOT + 2.0.2.RELEASE .. spring-cloud-test-support From 8c6e38b7899949bf35e129bacd25ffd0487f2b63 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Tue, 23 Oct 2018 15:46:50 +0000 Subject: [PATCH 2/5] Going back to snapshots --- docs/pom.xml | 2 +- pom.xml | 4 ++-- spring-cloud-commons-dependencies/pom.xml | 4 ++-- spring-cloud-commons/pom.xml | 2 +- spring-cloud-context-integration-tests/pom.xml | 2 +- spring-cloud-context/pom.xml | 2 +- spring-cloud-starter/pom.xml | 2 +- spring-cloud-test-support/pom.xml | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index bf6ffe3d..edfba75c 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -8,7 +8,7 @@ org.springframework.cloud spring-cloud-commons-parent - 2.0.2.RELEASE + 2.0.2.BUILD-SNAPSHOT pom Spring Cloud Commons Docs diff --git a/pom.xml b/pom.xml index d6be1476..5e39cc04 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.springframework.cloud spring-cloud-commons-parent - 2.0.2.RELEASE + 2.0.2.BUILD-SNAPSHOT pom Spring Cloud Commons Parent Spring Cloud Commons Parent @@ -11,7 +11,7 @@ org.springframework.cloud spring-cloud-build - 2.0.4.RELEASE + 2.0.3.RELEASE diff --git a/spring-cloud-commons-dependencies/pom.xml b/spring-cloud-commons-dependencies/pom.xml index 66e0b60c..ea634b9d 100644 --- a/spring-cloud-commons-dependencies/pom.xml +++ b/spring-cloud-commons-dependencies/pom.xml @@ -5,11 +5,11 @@ spring-cloud-dependencies-parent org.springframework.cloud - 2.0.4.RELEASE + 2.0.3.RELEASE spring-cloud-commons-dependencies - 2.0.2.RELEASE + 2.0.2.BUILD-SNAPSHOT pom spring-cloud-commons-dependencies Spring Cloud Commons Dependencies diff --git a/spring-cloud-commons/pom.xml b/spring-cloud-commons/pom.xml index 6a10b26d..a4c7a419 100644 --- a/spring-cloud-commons/pom.xml +++ b/spring-cloud-commons/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-commons-parent - 2.0.2.RELEASE + 2.0.2.BUILD-SNAPSHOT .. spring-cloud-commons diff --git a/spring-cloud-context-integration-tests/pom.xml b/spring-cloud-context-integration-tests/pom.xml index 87051612..58fee792 100644 --- a/spring-cloud-context-integration-tests/pom.xml +++ b/spring-cloud-context-integration-tests/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-commons-parent - 2.0.2.RELEASE + 2.0.2.BUILD-SNAPSHOT .. spring-cloud-context-integration-tests diff --git a/spring-cloud-context/pom.xml b/spring-cloud-context/pom.xml index 5702ab77..3684942b 100644 --- a/spring-cloud-context/pom.xml +++ b/spring-cloud-context/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-commons-parent - 2.0.2.RELEASE + 2.0.2.BUILD-SNAPSHOT .. spring-cloud-context diff --git a/spring-cloud-starter/pom.xml b/spring-cloud-starter/pom.xml index 353c1d2d..c153f105 100644 --- a/spring-cloud-starter/pom.xml +++ b/spring-cloud-starter/pom.xml @@ -5,7 +5,7 @@ org.springframework.cloud spring-cloud-commons-parent - 2.0.2.RELEASE + 2.0.2.BUILD-SNAPSHOT spring-cloud-starter spring-cloud-starter diff --git a/spring-cloud-test-support/pom.xml b/spring-cloud-test-support/pom.xml index 0ef22763..ddf021d1 100644 --- a/spring-cloud-test-support/pom.xml +++ b/spring-cloud-test-support/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-commons-parent - 2.0.2.RELEASE + 2.0.2.BUILD-SNAPSHOT .. spring-cloud-test-support From e80bb61107d77a6051a54a470e756ff7d538ffa7 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Tue, 23 Oct 2018 15:46:50 +0000 Subject: [PATCH 3/5] Bumping versions to 2.0.3.BUILD-SNAPSHOT after release --- docs/pom.xml | 2 +- pom.xml | 4 ++-- spring-cloud-commons-dependencies/pom.xml | 4 ++-- spring-cloud-commons/pom.xml | 2 +- spring-cloud-context-integration-tests/pom.xml | 2 +- spring-cloud-context/pom.xml | 2 +- spring-cloud-starter/pom.xml | 2 +- spring-cloud-test-support/pom.xml | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index edfba75c..8c82458e 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -8,7 +8,7 @@ org.springframework.cloud spring-cloud-commons-parent - 2.0.2.BUILD-SNAPSHOT + 2.0.3.BUILD-SNAPSHOT pom Spring Cloud Commons Docs diff --git a/pom.xml b/pom.xml index 5e39cc04..5183cc8d 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.springframework.cloud spring-cloud-commons-parent - 2.0.2.BUILD-SNAPSHOT + 2.0.3.BUILD-SNAPSHOT pom Spring Cloud Commons Parent Spring Cloud Commons Parent @@ -11,7 +11,7 @@ org.springframework.cloud spring-cloud-build - 2.0.3.RELEASE + 2.0.4.RELEASE diff --git a/spring-cloud-commons-dependencies/pom.xml b/spring-cloud-commons-dependencies/pom.xml index ea634b9d..006f947d 100644 --- a/spring-cloud-commons-dependencies/pom.xml +++ b/spring-cloud-commons-dependencies/pom.xml @@ -5,11 +5,11 @@ spring-cloud-dependencies-parent org.springframework.cloud - 2.0.3.RELEASE + 2.0.4.RELEASE spring-cloud-commons-dependencies - 2.0.2.BUILD-SNAPSHOT + 2.0.3.BUILD-SNAPSHOT pom spring-cloud-commons-dependencies Spring Cloud Commons Dependencies diff --git a/spring-cloud-commons/pom.xml b/spring-cloud-commons/pom.xml index a4c7a419..c6a74c50 100644 --- a/spring-cloud-commons/pom.xml +++ b/spring-cloud-commons/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-commons-parent - 2.0.2.BUILD-SNAPSHOT + 2.0.3.BUILD-SNAPSHOT .. spring-cloud-commons diff --git a/spring-cloud-context-integration-tests/pom.xml b/spring-cloud-context-integration-tests/pom.xml index 58fee792..e2780645 100644 --- a/spring-cloud-context-integration-tests/pom.xml +++ b/spring-cloud-context-integration-tests/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-commons-parent - 2.0.2.BUILD-SNAPSHOT + 2.0.3.BUILD-SNAPSHOT .. spring-cloud-context-integration-tests diff --git a/spring-cloud-context/pom.xml b/spring-cloud-context/pom.xml index 3684942b..3fd76f16 100644 --- a/spring-cloud-context/pom.xml +++ b/spring-cloud-context/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-commons-parent - 2.0.2.BUILD-SNAPSHOT + 2.0.3.BUILD-SNAPSHOT .. spring-cloud-context diff --git a/spring-cloud-starter/pom.xml b/spring-cloud-starter/pom.xml index c153f105..2f45e8f6 100644 --- a/spring-cloud-starter/pom.xml +++ b/spring-cloud-starter/pom.xml @@ -5,7 +5,7 @@ org.springframework.cloud spring-cloud-commons-parent - 2.0.2.BUILD-SNAPSHOT + 2.0.3.BUILD-SNAPSHOT spring-cloud-starter spring-cloud-starter diff --git a/spring-cloud-test-support/pom.xml b/spring-cloud-test-support/pom.xml index ddf021d1..769e00dc 100644 --- a/spring-cloud-test-support/pom.xml +++ b/spring-cloud-test-support/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-commons-parent - 2.0.2.BUILD-SNAPSHOT + 2.0.3.BUILD-SNAPSHOT .. spring-cloud-test-support From e2e1450ea7f95749cc74abc8cf59ba947a602bf1 Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Tue, 23 Oct 2018 17:07:01 -0400 Subject: [PATCH 4/5] Updates to s-c-build 2.0.5.BUILD-SNAPSHOT --- pom.xml | 2 +- spring-cloud-commons-dependencies/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 5183cc8d..b8285cf3 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ org.springframework.cloud spring-cloud-build - 2.0.4.RELEASE + 2.0.5.BUILD-SNAPSHOT diff --git a/spring-cloud-commons-dependencies/pom.xml b/spring-cloud-commons-dependencies/pom.xml index 006f947d..7353f410 100644 --- a/spring-cloud-commons-dependencies/pom.xml +++ b/spring-cloud-commons-dependencies/pom.xml @@ -5,7 +5,7 @@ spring-cloud-dependencies-parent org.springframework.cloud - 2.0.4.RELEASE + 2.0.5.BUILD-SNAPSHOT spring-cloud-commons-dependencies From 791a8807b5d09853c2a74f83a3e84f3ebc6d92bc Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Wed, 24 Oct 2018 12:07:01 -0400 Subject: [PATCH 5/5] Adds test for existence of ManagementServerProperties class. fixes gh-435 --- .../discovery/ManagementServerPortUtils.java | 12 +++-- .../ManagementServerPortUtilsTests.java | 48 +++++++++++++++++++ 2 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 spring-cloud-commons/src/test/java/org/springframework/cloud/client/discovery/ManagementServerPortUtilsTests.java diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/ManagementServerPortUtils.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/ManagementServerPortUtils.java index 1bf66d45..4bdff639 100644 --- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/ManagementServerPortUtils.java +++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/ManagementServerPortUtils.java @@ -27,16 +27,22 @@ import org.springframework.web.context.WebApplicationContext; * @author Spencer Gibb */ public class ManagementServerPortUtils { - private static final boolean hasActuator; + /** for testing */ static final boolean hasActuator; static { + boolean hasEndpointClass = hasClass("org.springframework.boot.actuate.endpoint.annotation.Endpoint"); + boolean hasManagementServerPropertiesClass = hasClass("org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties"); + hasActuator = hasEndpointClass && hasManagementServerPropertiesClass; + } + + private static boolean hasClass(String className) { boolean hasClass; try { - Class.forName("org.springframework.boot.actuate.endpoint.annotation.Endpoint"); + Class.forName(className); hasClass = true; } catch (ClassNotFoundException e) { hasClass = false; } - hasActuator = hasClass; + return hasClass; } public static ManagementServerPort get(BeanFactory beanFactory) { diff --git a/spring-cloud-commons/src/test/java/org/springframework/cloud/client/discovery/ManagementServerPortUtilsTests.java b/spring-cloud-commons/src/test/java/org/springframework/cloud/client/discovery/ManagementServerPortUtilsTests.java new file mode 100644 index 00000000..e4a0b7a8 --- /dev/null +++ b/spring-cloud-commons/src/test/java/org/springframework/cloud/client/discovery/ManagementServerPortUtilsTests.java @@ -0,0 +1,48 @@ +/* + * Copyright 2013-2018 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.cloud.client.discovery; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import org.springframework.boot.SpringBootConfiguration; +import org.springframework.boot.WebApplicationType; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.cloud.test.ClassPathExclusions; +import org.springframework.cloud.test.ModifiedClassPathRunner; +import org.springframework.context.ConfigurableApplicationContext; + +import static org.assertj.core.api.Assertions.assertThat; + +@RunWith(ModifiedClassPathRunner.class) +@ClassPathExclusions({ "spring-boot-actuator-autoconfigure-*" }) +public class ManagementServerPortUtilsTests { + + @Test + public void contextStarts() { + try (ConfigurableApplicationContext context = new SpringApplicationBuilder() + .web(WebApplicationType.NONE).sources(TestApp.class).run()) { + + assertThat(ManagementServerPortUtils.hasActuator).isFalse(); + } + } + + @SpringBootConfiguration + @EnableAutoConfiguration + protected static class TestApp {} +} \ No newline at end of file