前言:
使用Spring Initializer构建Springboot项目是十分快速的,但是在公司内网中连接不上https://start.spring.io,所以要搭建一个和https://start.spring.io一样的服务器。
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分,给个辛苦分。