搭建SpringBoot服务器,在公司内网中使用。

前言:

使用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: default
2017-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 35729
2017-12-26 14:41:27.215  INFO 1028 --- [  restartedMain] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2017-12-26 14:41:27.248  INFO 1028 --- [  restartedMain] o.s.c.support.DefaultLifecycleProcessor  : Starting beans in phase 0
2017-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.删除掉initializr-service项目中pom文件报错的部分
如图:
这里写图片描述



8.进入命令行,进入initializr-master目录下,执行
mvn clean install -Pfull
这里写图片描述

。。。等待。。。。

这里写图片描述
如上图 ,说明你已经成功了。。。。

9.进入C:\Users\founder.m2\repository\io\spring\initializr\initializr-service\0.5.0.BUILD-SNAPSHOT目录找到initializr-service-0.5.0.BUILD-SNAPSHOT.jar。(这是小编的,进入你的maven仓库,找到这个jar)。



10.在命令行执行
java -jar initializr-service-0.5.0.BUILD-SNAPSHOT.jar --server.port=8081

这里写图片描述

在idea中可以使用了

最后附上小遍的jar
http://download.csdn.net/download/z3881006/10174151
所需资源10分,给个辛苦分。

  • 0
    点赞
  • 25
    收藏
    觉得还不错? 一键收藏
  • 9
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值