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.0</modelVersion>
  <groupId>springboot-framework</groupId>
  <artifactId>springboot-framework</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <description>springboot框架搭建,实现与mybatis整合</description>
     <!--spring-boot-starter-parent这个依赖提供了很多依赖的版本-->
     <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.4.1.RELEASE</version>
    </parent>
    <properties>
        <java.version>1.7</java.version>
        <mybatis-spring-boot>1.2.0</mybatis-spring-boot>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>
<properties>
        <java.version>1.7</java.version>
        <mybatis-spring-boot>1.2.0</mybatis-spring-boot>
</properties>

这个配置是由于在parent的POM包里面,配置了java.version(jdk的版本),如图:
这里写图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值