一、spring boot 入门

1、spring boot 简介

     简化spring应用开发的一个框架;

     整个spring技术栈的一个大整合;

     J2EE开发的的一站式解决方案;

2、微服务

     微服务:架构风格(服务微化)

    一个应用是一组小型服务,可以通过http的方式进行互通

    每个功能元素最终都是一个可以独立替换和独立升级的软件单元

3、环境准备

     java 

     maven

4、helloworld

  添加依赖

  @SpringBootApplication //主程需注解

5、部署

   配置mvn插件

   <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    mvn package

    java -jar 

6、spring-boot-parent详解

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>2.1.0.RELEASE</version>
        <relativePath>../../spring-boot-dependencies</relativePath>
    </parent>

    Spring boot 版本中心

7、spring-boot-starter-web

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

       Spring boot 场景启动器(配合版本中心)

8、@SpringbootApplication详解

    @java.lang.annotation.Target(value={java.lang.annotation.ElementType.TYPE})
@java.lang.annotation.Retention(value=java.lang.annotation.RetentionPolicy.RUNTIME)
@java.lang.annotation.Documented
@java.lang.annotation.Inherited
@org.springframework.boot.SpringBootConfiguration
@org.springframework.boot.autoconfigure.EnableAutoConfiguration
@org.springframework.context.annotation.ComponentScan(excludeFilters={@org.springframework.context.annotation.ComponentScan.Filter(),@org.springframework.context.annotation.ComponentScan.Filter()
public abstract @interface org.springframework.boot.autoconfigure.SpringBootApplication extends java.lang.annotation.Annotation {

SpringBootConfiguration:spring boot 配置类(配置类也是容器中的一个组件@configure(@component))

EnableAutoConfiguration:开启自动配置(@configure(@import))将springbootApplication所在包及以下所有组件扫描到spring 容器中

 


 

 

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值