搭建SpringBoot服务器,在公司内网中使用。
来源:互联网 发布:sd卡损坏怎么恢复数据 编辑:程序博客网 时间:2024/04/30 06:58
前言:
使用Spring Initializer构建Springboot项目是十分快速的,但是在公司内网中连接不上https://start.spring.io,所以要搭建一个和https://start.spring.io一样的服务器。
1.下载项目源码
https://github.com/spring-io/initializr
2.已知你已经装JDK1.8和Maven了(建议最新版)。
3.把项目导出eclipse中。
4.导入后等待它自动构建,或者如下图。
5.构建完成后,找到InitializrService这个启动类,右键run Application。
6.查看启动结果
. ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v1.4.7.RELEASE)2017-12-26 14:41:18.580 INFO 1028 --- [ restartedMain] i.s.i.service.InitializrService : Starting InitializrService on DESKTOP-PA94KGI with PID 1028 (E:\initializr-master\initializr-service\target\classes started by founder in E:\initializr-master\initializr-service)2017-12-26 14:41:18.584 INFO 1028 --- [ restartedMain] i.s.i.service.InitializrService : No active profile set, falling back to default profiles: default2017-12-26 14:41:18.690 INFO 1028 --- [ restartedMain] ationConfigEmbeddedWebApplicationContext : Refreshing ....此处省略几十行.....2017-12-26 14:41:26.785 INFO 1028 --- [ restartedMain] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/mappings || /mappings.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()2017-12-26 14:41:26.785 INFO 1028 --- [ restartedMain] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/health || /health.json],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint.invoke(java.security.Principal)2017-12-26 14:41:26.786 INFO 1028 --- [ restartedMain] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/trace || /trace.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()2017-12-26 14:41:27.045 INFO 1028 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 357292017-12-26 14:41:27.215 INFO 1028 --- [ restartedMain] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup2017-12-26 14:41:27.248 INFO 1028 --- [ restartedMain] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 02017-12-26 14:41:27.531 INFO 1028 --- [ restartedMain] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)2017-12-26 14:41:27.542 INFO 1028 --- [ restartedMain] i.s.i.service.InitializrService : Started InitializrService in 10.046 seconds (JVM running for 10.729)
出现此图说明你已经成功90%了
7.打包发布
阅读全文