1,创建一个空的maven项目

2,添加parent

  1. <parent>
  2. <groupId>org.springframework.boot</groupId>
  3. <artifactId>spring-boot-starter-parent</artifactId>
  4. <version>2.0.2.RELEASE</version>
  5. </parent>

3,添加依赖

  1. <dependency>
  2. <groupId>org.springframework.boot</groupId>
  3. <artifactId>spring-boot-starter-web</artifactId>
  4. </dependency>

4,添加编译插件

  1. <build>
  2. <plugins>
  3. <plugin>
  4. <groupId>org.springframework.boot</groupId>
  5. <artifactId>spring-boot-maven-plugin</artifactId>
  6. </plugin>
  7. </plugins>
  8. </build>

5,添加启动类

  1. package com.googosoft.hystrix;
  2.  
  3. import org.springframework.boot.SpringApplication;
  4. import org.springframework.boot.autoconfigure.SpringBootApplication;
  5.  
  6. @SpringBootApplication
  7. public class HystrixApplication
  8. {
  9. public static void main( String[] args )
  10. {
  11. SpringApplication.run(HystrixApplication.class, args);
  12. }
  13. }

6,添加测试Controller

  1. package com.googosoft.hystrix;
  2.  
  3. import org.springframework.web.bind.annotation.RequestMapping;
  4. import org.springframework.web.bind.annotation.RestController;
  5.  
  6. /**
  7. * @author songyan
  8. * @version 2020年2月11日 上午10:37:44
  9. * @desc
  10. */
  11. @RestController
  12. public class TestController {
  13.  
  14. @RequestMapping("test")
  15. public Object test(){
  16. return 22;
  17. }
  18. }

7,重新制定jdk版本

8,完整pom

  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  3. <modelVersion>4.0.0</modelVersion>
  4.  
  5. <parent>
  6. <groupId>org.springframework.boot</groupId>
  7. <artifactId>spring-boot-starter-parent</artifactId>
  8. <version>2.0.2.RELEASE</version>
  9. </parent>
  10.  
  11. <groupId>com.googosoft</groupId>
  12. <artifactId>hystrix</artifactId>
  13. <version>0.0.1-SNAPSHOT</version>
  14. <packaging>jar</packaging>
  15.  
  16. <name>hystrix</name>
  17. <url>http://maven.apache.org</url>
  18.  
  19. <properties>
  20. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  21. </properties>
  22.  
  23. <dependencies>
  24. <dependency>
  25. <groupId>org.springframework.boot</groupId>
  26. <artifactId>spring-boot-starter-web</artifactId>
  27. </dependency>
  28. <dependency>
  29. <groupId>junit</groupId>
  30. <artifactId>junit</artifactId>
  31. <version>3.8.1</version>
  32. <scope>test</scope>
  33. </dependency>
  34. </dependencies>
  35. <build>
  36. <plugins>
  37. <plugin>
  38. <groupId>org.springframework.boot</groupId>
  39. <artifactId>spring-boot-maven-plugin</artifactId>
  40. </plugin>
  41. </plugins>
  42. </build>
  43. </project>

eclipse快速创建一个Spring Boot应用的更多相关文章

  1. 社区版Intelij IDEA快速创建一个spring boot项目(找不到sping Initializer选项)

    首先作为一个初学spring boot的小白,在学习过程中肯定会遇到各种问题... So,问题出现:在我想快速创建spring boot项目时,却在新建列表中找不到sping Initializer这 ...

  2. 快速搭建一个Spring Boot + MyBatis的开发框架

    前言:Spring Boot的自动化配置确实非常强大,为了方便大家把项目迁移到Spring Boot,特意总结了一下如何快速搭建一个Spring Boot + MyBatis的简易文档,下面是简单的步 ...

  3. 创建一个 Spring Boot 项目,你会几种方法?

    我最早是 2016 年底开始写 Spring Boot 相关的博客,当时使用的版本还是 1.4.x ,文章发表在 CSDN 上,阅读量最大的一篇有 42W+,如下图: 2017 年由于种种原因,就没有 ...

  4. 快速创建一个 spring mvc 示例

    1. 创建一个 servlet 项目 参考 http://www.cnblogs.com/zno2/p/5908589.html 2. 引入 spring mvc 依赖 <dependency& ...

  5. 手动创建一个Spring Boot 2.x项目

    spring boot 2.1.9版本quick start参考文档地址:https://docs.spring.io/spring-boot/docs/2.1.9.RELEASE/reference ...

  6. 只需两步!Eclipse+Maven快速构建第一个Spring Boot项目

     随着使用Spring进行开发的个人和企业越来越多,Spring从一个单一简介的框架变成了一个大而全的开源软件,最直观的变化就是Spring需要引入的配置也越来越多.配置繁琐,容易出错,让人无比头疼, ...

  7. spring boot学习01【搭建环境、创建第一个spring boot项目】

    1.给eclipse安装spring boot插件 Eclipse中安装Spring工具套件(STS): Help -> Eclipse Marketplace... 在Search标签或者Po ...

  8. 年轻人的第一个 Spring Boot 应用,太爽了!

    Spring Boot 大家都知道是啥吧? 还有不知道的来看这篇扫下盲:告诉你,Spring Boot 真是个牛逼货!. 顺便再往下看,栈长给你带来年轻人的第一个 Spring Boot 应用,撸码史 ...

  9. 快速开发架构Spring Boot 从入门到精通 附源码

    导读 篇幅较长,干货十足,阅读需花费点时间.珍惜原创,转载请注明出处,谢谢! Spring Boot基础 Spring Boot简介 Spring Boot是由Pivotal团队提供的全新框架,其设计 ...

随机推荐

  1. Python函数装饰器

    装饰器的原则 1)不修改被修饰函数的源代码: 2)不修改被修饰函数的调用方式: 装饰器的知识点 = 高阶函数 + 函数嵌套 + 闭包 1. 只用高阶函数写装饰器--->有瑕疵 import ti ...

  2. mysql错误:Column count doesn't match value count at row 1解决办法

    这个错误的意思是存储的数据与数据库表的字段类型定义不匹配,解决办法如下: 1.查看插入数据的类型与表中字段的类型是否匹配2.插入数据的顺序与字段顺序是否匹配3.检查SQL是否拼写错误4.在insert ...

  3. C# 引入Sqlite 未能加载文件或程序集“System.Data.SQLite

    个人博客 地址:https://www.wenhaofan.com/article/20190501224046 问题 在Visual Studio 中 使用NuGet 通过 install-pack ...

  4. Codeforces 1304F2 Animal Observation (hard version) 代码(dp滑动窗口线段树区间更新优化)

    https://codeforces.com/contest/1304/problem/F2 #include<bits/stdc++.h> using namespace std; ; ...

  5. 2017 ACM-ICPC 亚洲区(乌鲁木齐赛区)网络赛 Banana

    签到题 50的规模,随便搞搞都能过,用stl的string的搜索直接做了 #include <bits/stdc++.h> using namespace std; typedef lon ...

  6. JDK线程池和Spring线程池的使用

    JDK线程池和Spring线程池实例,异步调用,可以直接使用 (1)JDK线程池的使用,此处采用单例的方式提供,见示例: public class ThreadPoolUtil { private s ...

  7. Oracle库基本操作

    --oracle 获取表名称,字段 with vA as ( SELECT USER_TAB_COLS.TABLE_NAME as 表名,USER_TAB_COLS.COLUMN_NAME as 列名 ...

  8. 杭电oj_2047——阿牛的EOF牛肉串(java实现)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2047 思路:先是列出了四个,但是没发现规律,然后开始画递归树,在其中找到了规律,算出递归式为f(n) ...

  9. BandwagonHost VPS CentOS7系统启用EPEL源

    BandwagonHost默认安装好了EPEL源,只是默认没有启用,所以很多软件都无法安装.我们需要手动启用一下,才能安装里面的软件. # vim /etc/yum.repos.d/epel.repo ...

  10. Could not connect to SMTP host: smtp.qq.com, port: 465, response: -1 SpringBoot发送邮件

    解决方案 换端口 QQ邮箱可以把端口换成587 设置属性 spring.mail.properties.mail.smtp.ssl.enable=true 原因 465端口是为SMTPS(SMTP-o ...