From 8826f0a255b20411bc479376ba236e4735e69ec0 Mon Sep 17 00:00:00 2001 From: Eric Deandrea Date: Mon, 21 Jun 2021 16:12:40 -0400 Subject: [PATCH] Removing spring boot service discovery (#63) Part of openshift-labs/learn-katacoda#1060 & openshift-labs/learn-katacoda#1191 --- .../bin/main/bootstrap.properties | 2 - .../eureka-client/build.gradle | 55 ------ .../service-discovery/eureka-client/pom.xml | 101 ---------- .../java/hello/EurekaClientApplication.java | 36 ---- .../src/main/resources/bootstrap.properties | 2 - .../hello/EurekaClientApplicationTests.java | 67 ------- .../bin/main/application.properties | 8 - .../eureka-service/build.gradle | 58 ------ .../service-discovery/eureka-service/pom.xml | 92 ---------- .../java/hello/EurekaServiceApplication.java | 14 -- .../src/main/resources/application.properties | 8 - .../hello/EurekaServiceApplicationTests.java | 32 ---- .../gradle/wrapper/gradle-wrapper.properties | 5 - spring/service-discovery/gradlew | 172 ------------------ spring/service-discovery/gradlew.bat | 84 --------- spring/service-discovery/pom.xml | 16 -- spring/service-discovery/service.json | 19 -- spring/service-discovery/settings.gradle | 4 - 18 files changed, 775 deletions(-) delete mode 100644 spring/service-discovery/eureka-client/bin/main/bootstrap.properties delete mode 100644 spring/service-discovery/eureka-client/build.gradle delete mode 100644 spring/service-discovery/eureka-client/pom.xml delete mode 100644 spring/service-discovery/eureka-client/src/main/java/hello/EurekaClientApplication.java delete mode 100644 spring/service-discovery/eureka-client/src/main/resources/bootstrap.properties delete mode 100644 spring/service-discovery/eureka-client/src/test/java/hello/EurekaClientApplicationTests.java delete mode 100644 spring/service-discovery/eureka-service/bin/main/application.properties delete mode 100644 spring/service-discovery/eureka-service/build.gradle delete mode 100644 spring/service-discovery/eureka-service/pom.xml delete mode 100644 spring/service-discovery/eureka-service/src/main/java/hello/EurekaServiceApplication.java delete mode 100644 spring/service-discovery/eureka-service/src/main/resources/application.properties delete mode 100644 spring/service-discovery/eureka-service/src/test/java/hello/EurekaServiceApplicationTests.java delete mode 100644 spring/service-discovery/gradle/wrapper/gradle-wrapper.properties delete mode 100644 spring/service-discovery/gradlew delete mode 100644 spring/service-discovery/gradlew.bat delete mode 100644 spring/service-discovery/pom.xml delete mode 100644 spring/service-discovery/service.json delete mode 100644 spring/service-discovery/settings.gradle diff --git a/spring/service-discovery/eureka-client/bin/main/bootstrap.properties b/spring/service-discovery/eureka-client/bin/main/bootstrap.properties deleted file mode 100644 index b4c15bf..0000000 --- a/spring/service-discovery/eureka-client/bin/main/bootstrap.properties +++ /dev/null @@ -1,2 +0,0 @@ -spring.application.name=a-bootiful-client - diff --git a/spring/service-discovery/eureka-client/build.gradle b/spring/service-discovery/eureka-client/build.gradle deleted file mode 100644 index ce669ce..0000000 --- a/spring/service-discovery/eureka-client/build.gradle +++ /dev/null @@ -1,55 +0,0 @@ -buildscript { - ext { - springBootVersion = '2.0.1.RELEASE' - } - repositories { - mavenCentral() - } - dependencies { - classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") - } -} - -apply plugin: 'java' -apply plugin: 'eclipse' -apply plugin: 'idea' -apply plugin: 'org.springframework.boot' -apply plugin: 'io.spring.dependency-management' - -bootJar { - baseName = 'eureka-client' - version = '0.0.1-SNAPSHOT' -} -sourceCompatibility = 1.8 -targetCompatibility = 1.8 - -repositories { - mavenCentral() -} - -dependencyManagement { - imports { - mavenBom 'org.springframework.cloud:spring-cloud-dependencies:Finchley.M9' - } -} - -dependencies { - compile('org.springframework.cloud:spring-cloud-starter-netflix-eureka-client') - compile('org.springframework.boot:spring-boot-starter-web') - testCompile('org.springframework.boot:spring-boot-starter-test') - testCompile('org.springframework.cloud:spring-cloud-starter-netflix-eureka-server') -} - -repositories { - maven { - url 'https://repo.spring.io/libs-milestone' - } -} - -eclipse { - classpath { - containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER') - containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8' - } -} - diff --git a/spring/service-discovery/eureka-client/pom.xml b/spring/service-discovery/eureka-client/pom.xml deleted file mode 100644 index 6ffb30f..0000000 --- a/spring/service-discovery/eureka-client/pom.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - 4.0.0 - - com.example - eureka-client - 0.0.1-SNAPSHOT - jar - - - org.springframework.boot - spring-boot-starter-parent - 2.1.3.RELEASE - - - - - UTF-8 - 1.8 - - - - - org.springframework.cloud - spring-cloud-starter-netflix-eureka-client - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.cloud - spring-cloud-starter-netflix-eureka-server - test - - - - - - - org.springframework.cloud - spring-cloud-dependencies - Finchley.M9 - pom - import - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - - spring-milestones - Spring Milestones - https://repo.spring.io/libs-milestone - - false - - - - - - - openshift - - - - io.fabric8 - fabric8-maven-plugin - 3.5.40 - - - fmp - - resource - build - - - - - - - - - - - diff --git a/spring/service-discovery/eureka-client/src/main/java/hello/EurekaClientApplication.java b/spring/service-discovery/eureka-client/src/main/java/hello/EurekaClientApplication.java deleted file mode 100644 index 39c0ad3..0000000 --- a/spring/service-discovery/eureka-client/src/main/java/hello/EurekaClientApplication.java +++ /dev/null @@ -1,36 +0,0 @@ -package hello; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.client.ServiceInstance; -import org.springframework.cloud.client.discovery.DiscoveryClient; -import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -@EnableDiscoveryClient -@SpringBootApplication -public class EurekaClientApplication { - - public static void main(String[] args) { - SpringApplication.run(EurekaClientApplication.class, args); - } -} - -@RestController -class ServiceInstanceRestController { - - @Autowired - private DiscoveryClient discoveryClient; - - @RequestMapping("/service-instances/{applicationName}") - public List serviceInstancesByApplicationName( - @PathVariable String applicationName) { - return this.discoveryClient.getInstances(applicationName); - } - //TODO: Add load balance endpoint here -} diff --git a/spring/service-discovery/eureka-client/src/main/resources/bootstrap.properties b/spring/service-discovery/eureka-client/src/main/resources/bootstrap.properties deleted file mode 100644 index b4c15bf..0000000 --- a/spring/service-discovery/eureka-client/src/main/resources/bootstrap.properties +++ /dev/null @@ -1,2 +0,0 @@ -spring.application.name=a-bootiful-client - diff --git a/spring/service-discovery/eureka-client/src/test/java/hello/EurekaClientApplicationTests.java b/spring/service-discovery/eureka-client/src/test/java/hello/EurekaClientApplicationTests.java deleted file mode 100644 index c377fab..0000000 --- a/spring/service-discovery/eureka-client/src/test/java/hello/EurekaClientApplicationTests.java +++ /dev/null @@ -1,67 +0,0 @@ -package hello; - -import static org.assertj.core.api.BDDAssertions.*; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.boot.web.server.LocalServerPort; -import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; -import org.springframework.context.ConfigurableApplicationContext; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.junit4.SpringRunner; - -/** - * @author Marcin Grzejszczak - */ -@RunWith(SpringRunner.class) -@SpringBootTest(classes = EurekaClientApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -@ActiveProfiles("test") -public class EurekaClientApplicationTests { - - static ConfigurableApplicationContext eurekaServer; - - @BeforeClass - public static void startEureka() { - eurekaServer = SpringApplication.run(EurekaServer.class, - "--server.port=8761", - "--eureka.instance.leaseRenewalIntervalInSeconds=1"); - } - - @AfterClass - public static void closeEureka() { - eurekaServer.close(); - } - - @LocalServerPort - private int port; - - @Autowired - private TestRestTemplate testRestTemplate; - - @Test - public void shouldRegisterClientInEurekaServer() throws InterruptedException { - // registration has to take place... - Thread.sleep(3000); - - ResponseEntity response = this.testRestTemplate.getForEntity("http://localhost:" + this.port + "/service-instances/a-bootiful-client", String.class); - - then(response.getStatusCode()).isEqualTo(HttpStatus.OK); - then(response.getBody()).contains("a-bootiful-client"); - } - - @Configuration - @EnableAutoConfiguration - @EnableEurekaServer - static class EurekaServer { - } -} diff --git a/spring/service-discovery/eureka-service/bin/main/application.properties b/spring/service-discovery/eureka-service/bin/main/application.properties deleted file mode 100644 index aeb3360..0000000 --- a/spring/service-discovery/eureka-service/bin/main/application.properties +++ /dev/null @@ -1,8 +0,0 @@ -server.port=8761 - -eureka.client.register-with-eureka=false -eureka.client.fetch-registry=false - -logging.level.com.netflix.eureka=OFF -logging.level.com.netflix.discovery=OFF - diff --git a/spring/service-discovery/eureka-service/build.gradle b/spring/service-discovery/eureka-service/build.gradle deleted file mode 100644 index 3292935..0000000 --- a/spring/service-discovery/eureka-service/build.gradle +++ /dev/null @@ -1,58 +0,0 @@ -buildscript { - ext { - springBootVersion = '2.0.1.RELEASE' - } - repositories { - mavenCentral() - } - dependencies { - classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") - } -} - -apply plugin: 'java' -apply plugin: 'eclipse' -apply plugin: 'idea' -apply plugin: 'org.springframework.boot' -apply plugin: 'io.spring.dependency-management' - -bootJar { - baseName = 'eureka-service' - version = '0.0.1-SNAPSHOT' -} -sourceCompatibility = 1.8 -targetCompatibility = 1.8 - -repositories { - mavenCentral() -} - - -dependencyManagement { - imports { - mavenBom 'org.springframework.cloud:spring-cloud-dependencies:Finchley.M9' - } -} - -dependencies { - compile('org.springframework.cloud:spring-cloud-starter-netflix-eureka-server') - testCompile('org.springframework.boot:spring-boot-starter-test') -} - -repositories { - maven { url 'https://repo.spring.io/libs-snapshot' } -} - -repositories { - maven { - url 'https://repo.spring.io/libs-milestone' - } -} - -eclipse { - classpath { - containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER') - containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8' - } -} - diff --git a/spring/service-discovery/eureka-service/pom.xml b/spring/service-discovery/eureka-service/pom.xml deleted file mode 100644 index 32a91c1..0000000 --- a/spring/service-discovery/eureka-service/pom.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - 4.0.0 - - com.example - eureka-service - 0.0.1-SNAPSHOT - jar - - - org.springframework.boot - spring-boot-starter-parent - 2.1.3.RELEASE - - - - - UTF-8 - 1.8 - - - - - org.springframework.cloud - spring-cloud-starter-netflix-eureka-server - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - - org.springframework.cloud - spring-cloud-dependencies - Finchley.M9 - pom - import - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - - spring-milestones - Spring Milestones - https://repo.spring.io/libs-milestone - - false - - - - - - - openshift - - - - io.fabric8 - fabric8-maven-plugin - 3.5.40 - - - fmp - - resource - build - - - - - - - - - - diff --git a/spring/service-discovery/eureka-service/src/main/java/hello/EurekaServiceApplication.java b/spring/service-discovery/eureka-service/src/main/java/hello/EurekaServiceApplication.java deleted file mode 100644 index b183e25..0000000 --- a/spring/service-discovery/eureka-service/src/main/java/hello/EurekaServiceApplication.java +++ /dev/null @@ -1,14 +0,0 @@ -package hello; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; - -@EnableEurekaServer -@SpringBootApplication -public class EurekaServiceApplication { - - public static void main(String[] args) { - SpringApplication.run(EurekaServiceApplication.class, args); - } -} diff --git a/spring/service-discovery/eureka-service/src/main/resources/application.properties b/spring/service-discovery/eureka-service/src/main/resources/application.properties deleted file mode 100644 index aeb3360..0000000 --- a/spring/service-discovery/eureka-service/src/main/resources/application.properties +++ /dev/null @@ -1,8 +0,0 @@ -server.port=8761 - -eureka.client.register-with-eureka=false -eureka.client.fetch-registry=false - -logging.level.com.netflix.eureka=OFF -logging.level.com.netflix.discovery=OFF - diff --git a/spring/service-discovery/eureka-service/src/test/java/hello/EurekaServiceApplicationTests.java b/spring/service-discovery/eureka-service/src/test/java/hello/EurekaServiceApplicationTests.java deleted file mode 100644 index 940f5af..0000000 --- a/spring/service-discovery/eureka-service/src/test/java/hello/EurekaServiceApplicationTests.java +++ /dev/null @@ -1,32 +0,0 @@ -package hello; - -import static org.assertj.core.api.BDDAssertions.*; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.boot.web.server.LocalServerPort; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -public class EurekaServiceApplicationTests { - - @LocalServerPort - private int port; - - @Autowired - private TestRestTemplate testRestTemplate; - - @Test - public void shouldStartEurekaServer() { - ResponseEntity entity = this.testRestTemplate.getForEntity( - "http://localhost:" + this.port + "/eureka/apps", String.class); - - then(entity.getStatusCode()).isEqualTo(HttpStatus.OK); - } -} diff --git a/spring/service-discovery/gradle/wrapper/gradle-wrapper.properties b/spring/service-discovery/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index bf3de21..0000000 --- a/spring/service-discovery/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/spring/service-discovery/gradlew b/spring/service-discovery/gradlew deleted file mode 100644 index cccdd3d..0000000 --- a/spring/service-discovery/gradlew +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/env sh - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "$*" -} - -die () { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=$(save "$@") - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - -exec "$JAVACMD" "$@" diff --git a/spring/service-discovery/gradlew.bat b/spring/service-discovery/gradlew.bat deleted file mode 100644 index f955316..0000000 --- a/spring/service-discovery/gradlew.bat +++ /dev/null @@ -1,84 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/spring/service-discovery/pom.xml b/spring/service-discovery/pom.xml deleted file mode 100644 index 2003ff9..0000000 --- a/spring/service-discovery/pom.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - 4.0.0 - - org.springframework - gs-service-registration-and-discovery - 0.1.0 - pom - - - eureka-client - eureka-service - - - diff --git a/spring/service-discovery/service.json b/spring/service-discovery/service.json deleted file mode 100644 index 2e9b655..0000000 --- a/spring/service-discovery/service.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "kind": "Service", - "apiVersion": "v1", - "metadata": { - "name": "discovery-service" - }, - "spec": { - "selector": { - "name":"auto-discover" - }, - "ports": [ - { - "protocol": "TCP", - "port": 8888, - "targetPort": 8080 - } - ] - } -} \ No newline at end of file diff --git a/spring/service-discovery/settings.gradle b/spring/service-discovery/settings.gradle deleted file mode 100644 index cf5e583..0000000 --- a/spring/service-discovery/settings.gradle +++ /dev/null @@ -1,4 +0,0 @@ -rootProject.name = 'gs-service-registration-and-discovery' - -include 'eureka-client' -include 'eureka-service'