Updates to remove hystrix and boot 2.3 compatibility.

This commit is contained in:
Spencer Gibb
2020-01-23 19:08:31 -05:00
parent 11df6d715d
commit fc533bfe2b
26 changed files with 76 additions and 288 deletions

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-cli-parent</artifactId>
<version>2.2.2.BUILD-SNAPSHOT</version>
<version>3.0.0.BUILD-SNAPSHOT</version>
</parent>
<packaging>pom</packaging>
<name>Spring Cloud Cli Docs</name>

13
pom.xml
View File

@@ -5,11 +5,11 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-cli-parent</artifactId>
<version>2.2.2.BUILD-SNAPSHOT</version>
<version>3.0.0.BUILD-SNAPSHOT</version>
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-build</artifactId>
<version>2.2.2.BUILD-SNAPSHOT</version>
<version>3.0.0.BUILD-SNAPSHOT</version>
<relativePath/>
</parent>
<packaging>pom</packaging>
@@ -29,8 +29,8 @@
<bintray.package>cli</bintray.package>
<docs.main>spring-cloud-cli</docs.main>
<main.basedir>${basedir}/..</main.basedir>
<spring-boot.version>2.2.2.RELEASE</spring-boot.version>
<spring-cloud.version>Hoxton.BUILD-SNAPSHOT</spring-cloud.version>
<spring-boot.version>2.3.0.BUILD-SNAPSHOT</spring-boot.version>
<spring-cloud.version>Ilford.BUILD-SNAPSHOT</spring-cloud.version>
</properties>
<modules>
<module>spring-cloud-launcher</module>
@@ -132,6 +132,11 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.sf.jopt-simple</groupId>
<artifactId>jopt-simple</artifactId>
<version>5.0.4</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>

View File

@@ -13,7 +13,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-cli-parent</artifactId>
<version>2.2.2.BUILD-SNAPSHOT</version>
<version>3.0.0.BUILD-SNAPSHOT</version>
</parent>
<dependencyManagement>
@@ -45,6 +45,11 @@
<version>1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>

View File

@@ -34,11 +34,13 @@ import org.junit.Assume;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
import org.springframework.boot.cli.command.AbstractCommand;
import org.springframework.boot.cli.command.OptionParsingCommand;
import org.springframework.boot.cli.command.archive.JarCommand;
import org.springframework.boot.cli.command.grab.GrabCommand;
import org.springframework.boot.cli.command.run.RunCommand;
import org.springframework.boot.test.system.OutputCaptureRule;
import org.springframework.util.SocketUtils;
/**
@@ -50,7 +52,7 @@ import org.springframework.util.SocketUtils;
*/
public class CliTester implements TestRule {
private final OutputCapture outputCapture = new OutputCapture();
private final OutputCaptureRule outputCapture = new OutputCaptureRule();
private long timeout = TimeUnit.MINUTES.toMillis(6);

View File

@@ -12,7 +12,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-cli-parent</artifactId>
<version>2.2.2.BUILD-SNAPSHOT</version>
<version>3.0.0.BUILD-SNAPSHOT</version>
</parent>
<dependencies>
@@ -26,6 +26,11 @@
<artifactId>spring-cloud-stream</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.sf.jopt-simple</groupId>
<artifactId>jopt-simple</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-rsa</artifactId>
@@ -46,6 +51,11 @@
<version>${spring-boot.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>

View File

@@ -28,7 +28,7 @@ import org.springframework.boot.cli.compiler.GenericBomAstTransformation;
@GroovyASTTransformation(phase = CompilePhase.CONVERSION)
public class SpringCloudBomAstTransformation extends GenericBomAstTransformation {
private static final String SPRING_CLOUD_VERSION = "Hoxton.BUILD-SNAPSHOT";
private static final String SPRING_CLOUD_VERSION = "Ilford.BUILD-SNAPSHOT";
@Override
protected String getBomModule() {

View File

@@ -17,11 +17,12 @@ package org.springframework.cloud.cli.command.url;
import org.junit.Rule;
import org.junit.Test;
import org.springframework.boot.cli.command.Command;
import org.springframework.boot.cli.command.status.ExitStatus;
import org.springframework.boot.test.rule.OutputCapture;
import org.springframework.boot.test.system.OutputCaptureRule;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
/**
* @author William Witt
@@ -30,7 +31,7 @@ public class UrlDecodeCommandTest {
Command command = new UrlDecodeCommand();
@Rule
public OutputCapture capture = new OutputCapture();
public OutputCaptureRule capture = new OutputCaptureRule();
@Test
public void urlDecodeNoSpecialChars() throws Exception {

View File

@@ -17,11 +17,12 @@ package org.springframework.cloud.cli.command.url;
import org.junit.Rule;
import org.junit.Test;
import org.springframework.boot.cli.command.Command;
import org.springframework.boot.cli.command.status.ExitStatus;
import org.springframework.boot.test.rule.OutputCapture;
import org.springframework.boot.test.system.OutputCaptureRule;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
/**
* @author William Witt
@@ -30,7 +31,7 @@ public class UrlEncodeCommandTest {
Command command = new UrlEncodeCommand();
@Rule
public OutputCapture capture = new OutputCapture();
public OutputCaptureRule capture = new OutputCaptureRule();
@Test
public void urlEncodeNoSpecialChars() throws Exception {

View File

@@ -5,7 +5,7 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-launcher</artifactId>
<version>2.2.2.BUILD-SNAPSHOT</version>
<version>3.0.0.BUILD-SNAPSHOT</version>
<packaging>pom</packaging>
<name>spring-cloud-launcher</name>
@@ -14,7 +14,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-cli-parent</artifactId>
<version>2.2.2.BUILD-SNAPSHOT</version>
<version>3.0.0.BUILD-SNAPSHOT</version>
</parent>
<properties>
@@ -29,8 +29,7 @@
<!--<module>spring-cloud-launcher-dataflow</module>-->
<module>spring-cloud-launcher-eureka</module>
<module>spring-cloud-launcher-h2</module>
<module>spring-cloud-launcher-hystrixdashboard</module>
<module>spring-cloud-launcher-kafka</module>
<!--<module>spring-cloud-launcher-kafka</module>-->
<module>spring-cloud-launcher-stubrunner</module>
</modules>

View File

@@ -13,7 +13,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-launcher</artifactId>
<version>2.2.2.BUILD-SNAPSHOT</version>
<version>3.0.0.BUILD-SNAPSHOT</version>
</parent>
<properties>
@@ -31,12 +31,27 @@
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-cli</artifactId>
<version>${spring-boot.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.sf.jopt-simple</groupId>
<artifactId>jopt-simple</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
@@ -48,6 +63,11 @@
<version>1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>

View File

@@ -19,6 +19,8 @@ package org.springframework.cloud.launcher.cli;
import org.junit.Rule;
import org.junit.Test;
import org.springframework.boot.test.system.OutputCaptureRule;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.junit.Assert.assertThat;
@@ -29,7 +31,7 @@ import static org.junit.Assert.assertThat;
public class LauncherCommandTests {
@Rule
public OutputCapture output = new OutputCapture();
public OutputCaptureRule output = new OutputCaptureRule();
@Test
public void testCreateClassLoaderAndListDeployables() throws Exception {

View File

@@ -13,7 +13,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-launcher</artifactId>
<version>2.2.2.BUILD-SNAPSHOT</version>
<version>3.0.0.BUILD-SNAPSHOT</version>
</parent>
<dependencies>

View File

@@ -13,7 +13,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-launcher</artifactId>
<version>2.2.2.BUILD-SNAPSHOT</version>
<version>3.0.0.BUILD-SNAPSHOT</version>
</parent>
<properties>

View File

@@ -14,7 +14,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-launcher</artifactId>
<version>2.2.2.BUILD-SNAPSHOT</version>
<version>3.0.0.BUILD-SNAPSHOT</version>
</parent>
<properties>

View File

@@ -20,6 +20,8 @@ import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.springframework.boot.test.system.OutputCaptureRule;
import static org.hamcrest.CoreMatchers.containsString;
import static org.junit.Assert.assertThat;
@@ -29,7 +31,7 @@ import static org.junit.Assert.assertThat;
public class DeployerApplicationTests {
@Rule
public OutputCapture output = new OutputCapture();
public OutputCaptureRule output = new OutputCaptureRule();
@Test
@Ignore("I don't know how to change the stored deployer version")

View File

@@ -1,127 +0,0 @@
/*
* Copyright 2012-2014 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
*
* https://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.launcher.deployer;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
/**
* Capture output from System.out and System.err.
*
* @author Phillip Webb
*/
public class OutputCapture implements TestRule {
private CaptureOutputStream captureOut;
private CaptureOutputStream captureErr;
private ByteArrayOutputStream copy;
@Override
public Statement apply(final Statement base, Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
captureOutput();
try {
base.evaluate();
}
finally {
releaseOutput();
}
}
};
}
protected void captureOutput() {
this.copy = new ByteArrayOutputStream();
this.captureOut = new CaptureOutputStream(System.out, this.copy);
this.captureErr = new CaptureOutputStream(System.err, this.copy);
System.setOut(new PrintStream(this.captureOut));
System.setErr(new PrintStream(this.captureErr));
}
protected void releaseOutput() {
System.setOut(this.captureOut.getOriginal());
System.setErr(this.captureErr.getOriginal());
this.copy = null;
}
public void flush() {
try {
this.captureOut.flush();
this.captureErr.flush();
}
catch (IOException ex) {
// ignore
}
}
@Override
public String toString() {
flush();
return this.copy.toString();
}
private static class CaptureOutputStream extends OutputStream {
private final PrintStream original;
private final OutputStream copy;
CaptureOutputStream(PrintStream original, OutputStream copy) {
this.original = original;
this.copy = copy;
}
@Override
public void write(int b) throws IOException {
this.copy.write(b);
this.original.write(b);
this.original.flush();
}
@Override
public void write(byte[] b) throws IOException {
write(b, 0, b.length);
}
@Override
public void write(byte[] b, int off, int len) throws IOException {
this.copy.write(b, off, len);
this.original.write(b, off, len);
}
public PrintStream getOriginal() {
return this.original;
}
@Override
public void flush() throws IOException {
this.copy.flush();
this.original.flush();
}
}
}

View File

@@ -14,7 +14,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-launcher</artifactId>
<version>2.2.2.BUILD-SNAPSHOT</version>
<version>3.0.0.BUILD-SNAPSHOT</version>
</parent>
<dependencies>

View File

@@ -14,7 +14,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-launcher</artifactId>
<version>2.2.2.BUILD-SNAPSHOT</version>
<version>3.0.0.BUILD-SNAPSHOT</version>
</parent>
<dependencies>

View File

@@ -1,55 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.cloud.launcher</groupId>
<artifactId>spring-cloud-launcher-hystrixdashboard</artifactId>
<packaging>jar</packaging>
<name>spring-cloud-launcher-hystrixdashboard</name>
<description>Spring Cloud Launcher Hystrix Dashboard</description>
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-launcher</artifactId>
<version>2.2.2.BUILD-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bus-kafka</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,44 +0,0 @@
/*
* Copyright 2013-2016 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
*
* https://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.launcher.hystrixdashboard;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
/**
* @author Spencer Gibb
*/
@EnableDiscoveryClient
@EnableHystrixDashboard
@SpringBootApplication
@Controller
public class HystrixDashboardApplication {
@RequestMapping(path = "/", method = RequestMethod.GET)
public String home() {
return "redirect:/hystrix";
}
public static void main(String[] args) {
SpringApplication.run(HystrixDashboardApplication.class, args);
}
}

View File

@@ -1,2 +0,0 @@
exclusions.spring-cloud-starter-bus-kafka: org.springframework.cloud:spring-cloud-starter-bus-kafka
dependencies.spring-cloud-starter-bus-amqp: org.springframework.cloud:spring-cloud-starter-bus-amqp

View File

@@ -1,11 +0,0 @@
server:
port: 7979
eureka:
instance:
status-page-url-path: /hystrix #allows you to click on the link in eureka dashboard
info:
artifactId: "@project.artifactId@"
description: "@project.description@"
version: "@project.version@"

View File

@@ -1,3 +0,0 @@
spring:
application:
name: hystrixdashboard

View File

@@ -1,17 +0,0 @@
package org.springframework.cloud.launcher.hystrixdashboard;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest({ "spring.cloud.bus.enabled=false", "eureka.client.enabled=false" })
public class DeployerApplicationTests {
@Test
public void contextLoads() {
}
}

View File

@@ -13,7 +13,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-launcher</artifactId>
<version>2.2.2.BUILD-SNAPSHOT</version>
<version>3.0.0.BUILD-SNAPSHOT</version>
</parent>
<dependencies>

View File

@@ -13,7 +13,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-launcher</artifactId>
<version>2.2.2.BUILD-SNAPSHOT</version>
<version>3.0.0.BUILD-SNAPSHOT</version>
</parent>
<dependencies>