Wednesday, January 16, 2019

Installing spring boot CLI and spring cloud on centos

wget http://repo.spring.io/release/org/springframework/boot/spring-boot-cli/2.1.2.RELEASE/spring-boot-cli-2.1.2.RELEASE-bin.zip
unzip spring-boot-cli-2.1.2.RELEASE-bin.zip

vi .bash_profile

export SPRING_HOME=/home/centos/spring-2.1.2.RELEASE/
PATH=$PATH:$SPRING_HOME
export PATH



to test, type:

spring version

Spring CLI v2.1.2.RELEASE

See also https://gist.github.com/diegopacheco/7623d6da015f588e4f11bee17d483569


vi app.groovy

@RestController
class WebApplication {

@RequestMapping("/")
String home() {
"Hello World!"
}

}


spring run app.groovy
curl http://localhost:8080/

Now you can install Spring Cloud:

spring install org.springframework.cloud:spring-cloud-cli:2.0.0.RELEASE



spring cloud configserver

I get

Caused by: java.lang.NoSuchMethodError: org.springframework.cloud.launcher.cli.LauncherCommand$LauncherOptionHandler.option(Ljava/util/Collection;Ljava/lang/String;)Ljoptsimple/OptionSpecBuilder;


ridiculous....
see here https://github.com/spring-cloud/spring-cloud-cli/issues/80


If I install an older version of Spring CLI, it works:
http://repo.spring.io/release/org/springframework/boot/spring-boot-cli/2.0.0.RELEASE/spring-boot-cli-2.0.0.RELEASE-bin.zip



More information on the Spring Cloud command here https://spring.io/blog/2016/11/02/introducing-the-spring-cloud-cli-launcher





No comments: