1. File --> new --> spring Initializr(选择jdk,和默认的url)-->next-->通过dubbo调用的服务可以直接下一步,也可以选择web服务
springboot是默认大于配置.
2.创建出来的服务可以通过自动生成的main方法启动,通过控制台可以看到服务是否启动成功及所占用的端口号.测试成功就可以在pom.xml文件增加相应的jar包和在配置文件增加相应的配置,最后就可以进行正常的开发.
3.springboot内置了tomcat,所以除了通过上述的main方法启动之外,可以通过maven进行打包运行
1)将maven的目录配置到环境变量中,然后可以在项目的根目录下通过mvn install命令将项目打成jar包至target目录,接着进入target目录通过java 命令启动项目,完整的命令如下:
mvn install; cd target ; java -jar xxxx.jar
2)也可以通过idea的maven视图进行打包(maven projects --> lifecycle --> install) 至target目录.
1.pom.xml说明:
1)spring-boot-starter这是Spring Boot的核心启动器,包含了自动配置、日志和YAML。
2)spring-boot-starter-amqp通过spring-rabbit来支持AMQP协议(Advanced Message Queuing Protocol)。
3)spring-boot-starter-aop
支持面向方面的编程即AOP,包括spring-aop和AspectJ。4)spring-boot-starter-artemis通过Apache Artemis支持JMS的API(Java Message Service API)。
5)spring-boot-starter-batch支持Spring Batch,包括HSQLDB数据库
6)spring-boot-starter-cache支持Spring的Cache抽象。
7)spring-boot-starter-cloud-connectors支持Spring Cloud Connectors,简化了在像Cloud Foundry或Heroku这样的云平台上连接服务。
8)spring-boot-starter-data-elasticsearch支持ElasticSearch搜索和分析引擎,包括spring-data-elasticsearch。
9)spring-boot-starter-data-gemfire支持GemFire分布式数据存储,包括spring-data-gemfire。
10)spring-boot-starter-data-jpa支持JPA(Java Persistence API),包括spring-data-jpa、spring-orm、Hibernate。
11)spring-boot-starter-data-mongodb支持MongoDB数据,包括spring-data-mongodb
12)spring-boot-starter-data-rest通过spring-data-rest-webmvc,支持通过REST暴露Spring Data数据仓库。
13)spring-boot-starter-data-solr支持Apache Solr搜索平台,包括spring-data-solr。
14)spring-boot-starter-freemarker支持FreeMarker模板引擎。
15)spring-boot-starter-groovy-templates支持Groovy模板引擎。
16)spring-boot-starter-hateoas通过spring-hateoas支持基于HATEOAS的RESTful Web服务。
17)spring-boot-starter-hornetq通过HornetQ支持JMS。
18)spring-boot-starter-integration支持通用的spring-integration模块。
19)spring-boot-starter-jdbc支持JDBC数据库。
20)spring-boot-starter-jersey支持Jersey RESTful Web服务框架。
21)spring-boot-starter-jta-atomikos通过Atomikos支持JTA分布式事务处理。
22)spring-boot-starter-jta-bitronix通过Bitronix支持JTA分布式事务处理。
23)spring-boot-starter-mail支持javax.mail模块。
24)spring-boot-starter-mobile支持spring-mobile
25)spring-boot-starter-mustache支持Mustache模板引擎。
26)spring-boot-starter-redis支持Redis键值存储数据库,包括spring-redis。
27)spring-boot-starter-security支持spring-security。
28)spring-boot-starter-social-facebook支持spring-social-facebook
29)spring-boot-starter-social-linkedin支持pring-social-linkedin
30)spring-boot-starter-social-twitter支持pring-social-twitter
31)spring-boot-starter-test支持常规的测试依赖,包括JUnit、Hamcrest、Mockito以及spring-test模块
32)spring-boot-starter-thymeleaf支持Thymeleaf模板引擎,包括与Spring的集成。
33)spring-boot-starter-velocity
支持Velocity模板引擎。
34)spring-boot-starter-webS支持全栈式Web开发,包括Tomcat和spring-webmvc。
35)spring-boot-starter-websocket支持WebSocket开发。
36)spring-boot-starter-ws支持Spring Web Services。
Spring Boot应用启动器面向生产环境的还有2种,具体如下:
1)spring-boot-starter-actuator
增加了面向产品上线相关的功能,比如测量和监控。2)spring-boot-starter-remote-shell
增加了远程ssh shell的支持。最后,Spring Boot应用启动器还有一些替换技术的启动器,具体如下:
1)spring-boot-starter-jetty
引入了Jetty HTTP引擎(用于替换Tomcat)。2)spring-boot-starter-log4j
支持Log4J日志框架。3)spring-boot-starter-logging
引入了Spring Boot默认的日志框架Logback。4)spring-boot-starter-tomcat
引入了Spring Boot默认的HTTP引擎Tomcat。5)spring-boot-starter-undertow
引入了Undertow HTTP引擎(用于替换Tomcat)。
启动器相关说明转自:http://blog.sina.com.cn/s/blog_798f713f0102wiy5.html