Spring boot .vs. Spring mvc
spring boot extends spring mvc extends spring
Spring Boot uses Spring MVC! It's just autoconfigured and ready to use when you import the spring-boot-starter-web jar. So you'd basically are talking about whether to use Spring Boot or manually setup your Spring Application...
https://stackoverflow.com/questions/29479814/spring-mvc-or-spring-boot
Spring boot .vs. Spring cloud
Spring Boot就是一个内嵌Web服务器(tomcat/jetty)的可执行程序的框架。你开发的web应用不需要作为war包部署到web服务器中,而是作为一个可执行程序,启动时把Web服务器配置好,加载起来。
Spring Boot比较适合微服务部署方式,不再是把一堆应用放到一个Web服务器下,重启Web服务器会影响到其他应用,而是每个应用独立使用一个Web服务器,重启动和更新都很容易。
Spring Cloud是一套微服务开发和治理框架,来自Netflex的OSS,包含了微服务运行的功能,比如远程过程调用,动态服务发现,负载均衡,限流等。
https://www.zhihu.com/question/47304987
war包
jar:即Java Archive,Java的包,Java编译好之后生成class文件,但如果直接发布这些class文件的话会很不方便,所以就把许多的class文件打包成一个jar,jar中除了class文件还可以包括一些资源和配置文件,通常一个jar包就是一个java程序或者一个java库。
war:Web application Archive,与jar基本相同,但它通常表示这是一个Java的Web应用程序的包,tomcat这种Servlet容器会认出war包并自动部署。
https://www.zhihu.com/question/22129866
tomcat setup
https://dalanzg.github.io/tips-tutorials/mac/2015/11/21/how-to-install-tomcat-7-on-mac-os-x/
tomcat要自己安装配置
Jetty .vs. Tomcat
相同点:
1. Tomcat和Jetty都是一种Servlet引擎,他们都支持标准的servlet规范和JavaEE的规范。
不同点:
1. 架构比较
Jetty的架构比Tomcat的更为简单
Jetty的架构是基于Handler来实现的,主要的扩展功能都可以用Handler来实现,扩展简单。
Tomcat的架构是基于容器设计的,进行扩展是需要了解Tomcat的整体设计结构,不易扩展。
2. 性能比较
Jetty和Tomcat性能方面差异不大
Jetty可以同时处理大量连接而且可以长时间保持连接,适合于web聊天应用等等。
Jetty的架构简单,因此作为服务器,Jetty可以按需加载组件,减少不需要的组件,减少了服务器内存开销,从而提高服务器性能。
Jetty默认采用NIO结束在处理I/O请求上更占优势,在处理静态资源时,性能较高
Tomcat适合处理少数非常繁忙的链接,也就是说链接生命周期短的话,Tomcat的总体性能更高。
Tomcat默认采用BIO处理I/O请求,在处理静态资源时,性能较差。
总结:Jetty更满足公有云的分布式环境的需求,而Tomcat更符合企业级环境。
http://blog.sina.com.cn/s/blog_5c5d5cdf0101dvjn.html
http://www.jianshu.com/p/e6ef58e9500c
Intellij IDEA Maven
http://blog.csdn.net/lw_power/article/details/51142325
Maven .vs Gradle
虽然两者都是项目工具,但是maven现在已经是行业标准,Gradle是后起之秀,很多人对他的了解都是从android studio中得到的,Gradle抛弃了Maven的基于XML的繁琐配置,众所周知XML的阅读体验比较差,对于机器来说虽然容易识别,但毕竟是由人去维护的。取而代之的是Gradle采用了领域特定语言Groovy的配置,大大简化了构建代码的行数
https://www.zhihu.com/question/29338218/answer/51293828
http://www.infoq.com/cn/news/2011/04/xxb-maven-6-gradle
Maven tomcat plugin:
http://viralpatel.net/blogs/embed-tomcat-maven-project-run-tomcat-maven/
Spring Boot应用的打包和部署
通过mvn clean package命令打包应用程序
通过命令java -jar target/bookpub-0.0.1-SNAPSHOT.jar运行程序
(先通过maven-shade-plugin生成一个包含依赖的jar,再通过spring-boot-maven-plugin插件把spring boot loader相关的类,还有MANIFEST.MF打包到jar里。)
http://www.jianshu.com/p/afc31c34a99b
http://blog.csdn.net/hengyunabc/article/details/50120001#t0