https://docs.spring.io/spring-boot/docs/current/reference/html/getting-started-installing-spring-boot.html#getting-started-installing-the-cli
Descargamos la ultima versión estable, la descomprimimos.
Creamos un lugar donde instalaremos los archivos
bext@bext-VPCF13WFX:~/Downloads$ sudo mkdir /opt/spring-boot
bext@bext-VPCF13WFX:~/Downloads$ sudo tar xzf spring-boot-cli-2.2.0.BUILD-20190708.150652-418-bin.tar.gz -C /opt/spring-boot bext@bext-VPCF13WFX:~/Downloads$ ls /opt/spring-boot spring-2.2.0.BUILD-SNAPSHOT
Editamos el archivo /etc/profile para agregarle
export SPRING_HOME=/opt/spring-boot/spring-2.2.0.BUILD-SNAPSHOT export PATH=$SPRING_HOME/bin:$PATH
bext@bext-VPCF13WFX:~/Downloads$ sudo nano /etc/profileActualizamos el cambio
bext@bext-VPCF13WFX:~/Downloads$ source /etc/profile
Probamos la instalación
bext@bext-VPCF13WFX:~/Downloads$ spring --version Spring CLI v2.2.0.BUILD-SNAPSHOT
Creamos una sencillisima app web en Groovy para probar la instalación
bext@bext-VPCF13WFX:~$ nano app.groovy bext@bext-VPCF13WFX:~$ cat app.groovy @RestController class ClaseAEjecutar { @RequestMapping("/") String home() { "Corriendo app en Groovy!!" } } bext@bext-VPCF13WFX:~$ spring run app.groovy Resolving dependencies................................................. . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.2.0.BUILD-SNAPSHOT) 2019-07-08 18:09:49.484 INFO 8298 --- [ runner-0] o.s.boot.SpringApplication : Starting application on bext-VPCF13WFX with PID 8298 (started by bext in /home/bext) 2019-07-08 18:09:49.498 INFO 8298 --- [ runner-0] o.s.boot.SpringApplication : No active profile set, falling back to default profiles: default 2019-07-08 18:09:51.839 INFO 8298 --- [ runner-0] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2019-07-08 18:09:51.854 INFO 8298 --- [ runner-0] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2019-07-08 18:09:51.854 INFO 8298 --- [ runner-0] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.21] 2019-07-08 18:09:51.895 INFO 8298 --- [ runner-0] org.apache.catalina.loader.WebappLoader : Unknown class loader [org.springframework.boot.cli.compiler.ExtendedGroovyClassLoader$DefaultScopeParentClassLoader@412e5c28] of class [class org.springframework.boot.cli.compiler.ExtendedGroovyClassLoader$DefaultScopeParentClassLoader] 2019-07-08 18:09:51.947 INFO 8298 --- [ runner-0] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2019-07-08 18:09:51.947 INFO 8298 --- [ runner-0] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1997 ms 2019-07-08 18:09:52.388 INFO 8298 --- [ runner-0] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor' 2019-07-08 18:09:53.129 INFO 8298 --- [ runner-0] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path '' 2019-07-08 18:09:53.135 INFO 8298 --- [ runner-0] o.s.boot.SpringApplication : Started application in 4.673 seconds (JVM running for 62.847) 2019-07-08 18:10:08.445 INFO 8298 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet' 2019-07-08 18:10:08.446 INFO 8298 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' 2019-07-08 18:10:08.459 INFO 8298 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 13 ms
Probamos en browser
eot
No hay comentarios:
Publicar un comentario