SpringBoot的理解

1 概念

   官网上的解释:
   Features
       Create stand-alone Spring applications
       Embed Tomcat, Jetty or Undertow directly (no need to deploy WAR files)
       Provide opinionated 'starter' POMs to simplify your Maven configuration
       Automatically configure Spring whenever possible
       Provide production-ready features such as metrics, health checks and externalized configuration
       Absolutely no code generation and no requirement for XML configuration


       能够创建独立的spring应用
       内置了Tomcat, Jetty or Undertow这些服务器,也不需要部署war文件,也就是不需要web.xml
       提供了一系列的starter poms(依赖)来简化maven的配置(依赖有:
       http://blog.csdn.net/whatlookingfor/article/details/51393398)
       自动配置spring
       提供了一些生产环境的特性,比如metrics, health checks and externalized configuration
       绝对没有代码生成和XML配置要求

2 快速搭建一个springboot 的框架

POM.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0modelVersion>
  <groupId>springboot-frameworkgroupId>
  <artifactId>springboot-frameworkartifactId>
  <version>0.0.1-SNAPSHOTversion>
  <description>springboot框架搭建,实现与mybatis整合description>
     
     <parent>
        <groupId>org.springframework.bootgroupId>
        <artifactId>spring-boot-starter-parentartifactId>
        <version>1.4.1.RELEASEversion>
    parent>
    <properties>
        <java.version>1.7java.version>
        <mybatis-spring-boot>1.2.0mybatis-spring-boot>
    properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-starter-webartifactId>
        dependency>
    dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.bootgroupId>
                <artifactId>spring-boot-maven-pluginartifactId>
            plugin>
        plugins>
    build>
project>
<properties>
        <java.version>1.7java.version>
        <mybatis-spring-boot>1.2.0mybatis-spring-boot>
properties>

这个配置是由于在parent的POM包里面,配置了java.version(jdk的版本),如图:
SpringBoot的理解_第1张图片

你可能感兴趣的:(web,springboot)