当前位置: 首页 > news >正文

一、springcloud 入门——笔记


1. 学习之前要知道的
springcloud 应用的技术
2. springboot 和 springcloud 的版本选型

官网介绍:https://spring.io/projects/spring-cloud/#overview

生成新的Spring Cloud项目
最简单的入门方法是访问start.spring.io,选择您的Spring Boot版本和要使用的Spring Cloud项目。生成项目时,这会将相应的Spring Cloud BOM版本添加到您的Maven / Gradle文件中。

将Spring Cloud添加到现有的Spring Boot应用程序
如果您现有的Spring Boot应用程序想要将Spring Cloud添加到该应用程序,则第一步是确定您应该使用的Spring Cloud版本。您在应用中使用的版本将取决于您使用的Spring Boot的版本

本文将使用 springboot 2.3.0.RELEASE 和 springcloud Hoxton.SR11 构建 springcloud 项目

springboot 与 springcloud 版本选择

更详细的介绍参考: https://start.spring.io/actuator/info

{"git": {"branch": "1e4d6a48a9df249322972d9c1c6de3d3e38db0e8","commit": {"id": "1e4d6a4","time": "2021-05-21T13:52:17Z"}},"build": {"version": "0.0.1-SNAPSHOT","artifact": "start-site","versions": {"spring-boot": "2.5.0","initializr": "0.11.0-SNAPSHOT"},"name": "start.spring.io website","time": "2021-05-21T13:53:46.862Z","group": "io.spring.start"},"bom-ranges": {"azure": {"2.2.4": "Spring Boot >=2.2.0.RELEASE and <2.3.0.M1","3.2.0": "Spring Boot >=2.3.0.M1 and <2.4.0-M1","3.4.0": "Spring Boot >=2.4.0.M1 and <2.5.0-M1"},"codecentric-spring-boot-admin": {"2.2.4": "Spring Boot >=2.2.0.RELEASE and <2.3.0.M1","2.3.1": "Spring Boot >=2.3.0.M1 and <2.5.0-M1"},"solace-spring-boot": {"1.0.0": "Spring Boot >=2.2.0.RELEASE and <2.3.0.M1","1.1.0": "Spring Boot >=2.3.0.M1 and <2.5.0-M1"},"solace-spring-cloud": {"1.0.0": "Spring Boot >=2.2.0.RELEASE and <2.3.0.M1","1.1.1": "Spring Boot >=2.3.0.M1 and <2.4.0-M1","2.0.0": "Spring Boot >=2.4.0.M1 and <2.5.0-M1"},"spring-cloud": {"Hoxton.SR11": "Spring Boot >=2.2.0.RELEASE and <2.3.12.BUILD-SNAPSHOT","Hoxton.BUILD-SNAPSHOT": "Spring Boot >=2.3.12.BUILD-SNAPSHOT and <2.4.0.M1","2020.0.0-M3": "Spring Boot >=2.4.0.M1 and <=2.4.0.M1","2020.0.0-M4": "Spring Boot >=2.4.0.M2 and <=2.4.0-M3","2020.0.0": "Spring Boot >=2.4.0.M4 and <=2.4.0","2020.0.2": "Spring Boot >=2.4.1 and <2.5.0-M1","2020.0.3-SNAPSHOT": "Spring Boot >=2.4.7-SNAPSHOT"},"spring-cloud-alibaba": {"2.2.1.RELEASE": "Spring Boot >=2.2.0.RELEASE and <2.3.0.M1"},"spring-cloud-gcp": {"2.0.0": "Spring Boot >=2.4.0-M1 and <2.5.0-M1"},"spring-cloud-services": {"2.2.6.RELEASE": "Spring Boot >=2.2.0.RELEASE and <2.3.0.RELEASE","2.3.0.RELEASE": "Spring Boot >=2.3.0.RELEASE and <2.4.0-M1","2.4.1": "Spring Boot >=2.4.0-M1 and <2.5.0-M1"},"spring-geode": {"1.2.12.RELEASE": "Spring Boot >=2.2.0.RELEASE and <2.3.0.M1","1.3.11.RELEASE": "Spring Boot >=2.3.0.M1 and <2.4.0-M1","1.4.6": "Spring Boot >=2.4.0-M1 and <2.5.0-M1","1.5.0": "Spring Boot >=2.5.0-M1"},"vaadin": {"14.6.1": "Spring Boot >=2.1.0.RELEASE and <2.5.0-M1"},"wavefront": {"2.0.2": "Spring Boot >=2.1.0.RELEASE and <2.4.0-M1","2.1.1": "Spring Boot >=2.4.0-M1 and <2.5.0-M1","2.2.0-RC1": "Spring Boot >=2.5.0-M1"}},"dependency-ranges": {"native": {"0.9.0": "Spring Boot >=2.4.3 and <2.4.4","0.9.1": "Spring Boot >=2.4.4 and <2.4.5","0.9.2": "Spring Boot >=2.4.5 and <2.5.0-M1","0.10.0-SNAPSHOT": "Spring Boot >=2.5.0-M1 and <2.6.0-M1"},"okta": {"1.4.0": "Spring Boot >=2.2.0.RELEASE and <2.4.0-M1","1.5.1": "Spring Boot >=2.4.0-M1 and <2.4.1","2.0.1": "Spring Boot >=2.4.1 and <2.5.0-M1"},"mybatis": {"2.1.4": "Spring Boot >=2.1.0.RELEASE and <2.5.0-M1"},"camel": {"3.3.0": "Spring Boot >=2.2.0.RELEASE and <2.3.0.M1","3.5.0": "Spring Boot >=2.3.0.M1 and <2.4.0-M1","3.10.0": "Spring Boot >=2.4.0.M1 and <2.5.0-M1"},"open-service-broker": {"3.1.1.RELEASE": "Spring Boot >=2.2.0.RELEASE and <2.3.0.M1","3.2.0": "Spring Boot >=2.3.0.M1 and <2.4.0-M1","3.3.0": "Spring Boot >=2.4.0-M1 and <2.5.0-M1"}}
}
3. 步骤

(1)建 module
(2)改 pom
(3)写 yml
(4)主启动类
(5)业务代码

pom.xml

<?xml version="1.0" encoding="utf-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.test.wl</groupId><artifactId>springcloud</artifactId><version>0.0.1-SNAPSHOT</version><packaging>pom</packaging><modules><module>cloud-provider-payment8001</module></modules><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>2.3.0.RELEASE</version></parent><!-- 统一jar包管理 --><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><maven.compiler.source>1.8</maven.compiler.source><maven.compiler.traget>1.8</maven.compiler.traget><junit.version>4.12</junit.version><log4j.version>1.2.17</log4j.version><lombok.version>1.18.12</lombok.version><mysql.version>8.0.23</mysql.version><druid.verison>1.1.22</druid.verison><mybatis.spring.boot.version>2.1.4</mybatis.spring.boot.version><spring.boot.starter.web>2.3.0.RELEASE</spring.boot.starter.web><spring.boot.starter.jdbc>2.3.0.RELEASE</spring.boot.starter.jdbc><spring.boot.starter.actuator>2.3.0.RELEASE</spring.boot.starter.actuator><spring.boot.starter.test>2.3.0.RELEASE</spring.boot.starter.test><spring.boot.devtools>2.3.0.RELEASE</spring.boot.devtools></properties><dependencyManagement><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-dependencies</artifactId><version>2.3.0.RELEASE</version></dependency><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-dependencies</artifactId><version>Hoxton.SR11</version><type>pom</type><scope>import</scope></dependency><dependency><groupId>com.alibaba.cloud</groupId><artifactId>spring-cloud-alibaba-dependencies</artifactId><version>2.2.1.RELEASE</version><type>pom</type><scope>import</scope></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-jdbc</artifactId><version>${spring.boot.starter.jdbc}</version></dependency><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>${mysql.version}</version></dependency><dependency><groupId>com.alibaba</groupId><artifactId>druid</artifactId><version>${druid.verison}</version></dependency><dependency><groupId>org.mybatis.spring.boot</groupId><artifactId>mybatis-spring-boot-starter</artifactId><version>${mybatis.spring.boot.version}</version></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><version>${lombok.version}</version></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId><version>${spring.boot.starter.web}</version></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-actuator</artifactId><version>${spring.boot.starter.actuator}</version></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><version>${spring.boot.starter.test}</version></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-devtools</artifactId><version>${spring.boot.devtools}</version><scope>runtime</scope><optional>true</optional></dependency></dependencies></dependencyManagement><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><version>2.3.0.RELEASE</version><configuration><fork>true</fork><addResources>true</addResources></configuration></plugin></plugins></build>
</project>

跟尚硅谷大佬(阳哥)一起学 springcloud
视频链接:https://www.bilibili.com/video/BV18E411x7eT?from=search&seid=11397380345672811627
我的项目地址:https://gitee.com/wl_projects/springcloud.git

最后编辑于:2024-12-10 21:05:46


喜欢的朋友记得点赞、收藏、关注哦!!!

相关文章:

一、springcloud 入门——笔记

1. 学习之前要知道的 springcloud 应用的技术 2. springboot 和 springcloud 的版本选型 官网介绍&#xff1a;https://spring.io/projects/spring-cloud/#overview 生成新的Spring Cloud项目 最简单的入门方法是访问start.spring.io&#xff0c;选择您的Spring Boot版本和要使…...

思考:VSCode 的宏观工作原理 快速入门 VSCodium (****)

23个常用的VSCode快捷键&#xff08;动图演示&#xff09;> https://www.php.cn/faq/441696.html VSCodium AppImage 版 使用记录 https://blog.csdn.net/ken2232/article/details/143591323 **** 初步比较&#xff1a;VSCode > pk < VSCodium << 在下…...

C++ day8——模版

笔记脑图 作业 template <class T> class mylist{ public:// 这是一个链表的节点struct Link{T val;Link* next; } 增 &#xff1a;insert(T val) 在链表中创建新节点&#xff0c;节点上保存的数据为 val删&#xff1a;remove(T val) 移除链表中数据为 val 的节点改…...

【CSS in Depth 2 精译_080】 13.1:CSS 渐变效果(中)——不同色彩空间的颜色插值算法在 CSS 渐变中的应用

当前内容所在位置&#xff08;可进入专栏查看其他译好的章节内容&#xff09; 第四部分 视觉增强技术 ✔️【第 13 章 渐变、阴影与混合模式】 ✔️ 13.1 渐变 ✔️ 13.1.1 使用多个颜色节点&#xff08;上&#xff09;13.1.2 颜色插值方法&#xff08;中&#xff09; ✔️13.1…...

红日靶场1(搭建打靶)

搭建 靶场下载&#xff1a; http://vulnstack.qiyuanxuetang.net/vuln/detail/2/ (13G&#xff0c;需要百度网盘会员) 下载好靶场文件后直接解压 直接用虚拟机打开靶场 更改网络ip 需要模拟内网和外网两个网段&#xff0c; Win7 虚拟机相当于网关服务器&#xff0c;所以需要…...

LivePortrait 部署笔记

LivePortrait 开源地址&#xff1a; https://github.com/KwaiVGI/LivePortrait 模型下载&#xff1a; export HF_ENDPOINThttps://hf-mirror.com huggingface-cli download --resume-download KwaiVGI/LivePortrait --local-dir models--KwaiVGI--LivePortrait...

Greenhills Lib操作-查看Lib信息与将lib中的data段link到指定区域

文章目录 前言Greenhillls中gsize的用法修改ld文件将lib中的data段指定区域示例定义与链接总结 前言 项目开发过程中&#xff0c;遇到客户开发ASW&#xff0c;提供Lib进行集成&#xff0c;但ASW中的标定量没有定义对应的data段&#xff0c;导致无法将标定量指定到特定的内存。…...

【十进制整数转换为其他进制数——短除形式的贪心算法】

之前写过一篇用贪心算法计算十进制转换二进制的方法&#xff0c;详见&#xff1a;用贪心算法计算十进制数转二进制数&#xff08;整数部分&#xff09;_短除法求二进制-CSDN博客 经过一段时间的研究&#xff0c;本人又发现两个规律&#xff1a; 1、不仅仅十进制整数转二进制可…...

【JavaEE】网络(2)

一、网络编程套接字 1.1 基础概念 【网络编程】指网络上的主机&#xff0c;通过不同的进程&#xff0c;以编程的方式实现网络通信&#xff1b;当然&#xff0c;我们只要满足进程不同就行&#xff0c;所以即便是同一个主机&#xff0c;只要是不同进程&#xff0c;基于网络来传…...

AI for Science 的完美实践——科研文献的智慧化提取获得“综述性文摘”的软件开发

实践是检验真理的唯一标准&#xff01;show your codes! 1 综述性文摘的需求 再简单不过了。 甲方&#xff08;综述性文摘&#xff09;需求&#xff1a;针对项目特征或描述&#xff0c;从几百篇相关的科研论文&#xff08;PDF&#xff09;中智能提取相关内容&#xff0c;包括…...

前端使用xlsx.js实现 Excel 文件的导入与导出功能

前端使用xlsx.js实现 Excel 文件的导入与导出功能 在现代的 Web 开发中&#xff0c;处理文件上传和导出功能已经变得越来越常见&#xff0c;尤其是 Excel 文件的导入与导出。 我们将使用 Vue.js 和 XLSX.js 库来处理 Excel 文件的读取和生成。XLSX.js 是一个强大的 JavaScrip…...

React简单了解

原理简化了解 import React from "react" import { createRoot } form "react-dom/client"const element React.createElement(p,{id: hello},Hello World! )const container document.querySelector(#root) const root createRoot(container) root.r…...

backbone 和Run-Length Encoding (RLE)含义

在深度学习中&#xff0c;特别是在图像分割任务中&#xff0c;backbone&#xff08;主干网络&#xff09;是指用于特征提取的预训练神经网络模型。Backbone 的主要作用是从输入图像中提取有用的特征&#xff0c;这些特征随后会被用于更高层次的任务&#xff0c;如分类、检测或分…...

在Centos7上安装MySQL数据库 How to install MySQL on Centos 7

执行以下命令&#xff0c;下载并安装MySQL。 wget http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm && yum -y install mysql57-community-release-el7-10.noarch.rpm && yum install -y mysql-community-server --nogpgcheck执行以下…...

Linux docker-20.10.9安装

Linux Docker20.10.9安装 解压文件 tar -xvf docker-20.10.9.tgz 给docker执行文件赋予可执行权限 chmod 755 -R docker/复制docker到/usr/bin/目录下,使docker命令可以执行 cp docker/* /usr/bin/将Docker注册为service&#xff0c;创建docker.service文件 vim /etc/syst…...

操作系统(13)虚拟存储器

前言 操作系统中的虚拟存储器是一项关键技术&#xff0c;它为用户提供了一个远大于实际物理内存容量的逻辑内存空间。 一、定义与原理 虚拟存储器是具有请求调入功能和置换功能&#xff0c;能从逻辑上对内存容量加以扩充的存储器系统。其逻辑容量由内存容量与外存容量之和决定&…...

《面向对象综合训练01~05》

《面向对象综合训练01~05》 训练01&#xff1a;文字版格斗游戏 第一步&#xff1a;创建游戏角色的javabean类 public class Role {private String name;private int blood;private char gender;private String face;//长相是随机的//创建男女长相的随机数组String[] boyfaces…...

电脑为什么会提示“msvcr120.dll缺失”?“找不到msvcr120.dll文件”要怎么解决?

电脑故障排查指南&#xff1a;揭秘“msvcr120.dll缺失”的真相与解决方案 在软件开发与日常维护的广阔天地里&#xff0c;遇到系统报错或文件缺失的情况可谓家常便饭。今天&#xff0c;我将带领大家深入探讨一个常见的系统提示——“msvcr120.dll缺失”&#xff0c;并揭秘其背…...

huggingface NLP-微调一个预训练模型

微调一个预训练模型 1 预处理数据 1.1 处理数据 1.1.1 fine-tune 使用tokenizer后的token 进行训练 batch tokenizer(sequences, paddingTrue, truncationTrue, return_tensors"pt")# This is new batch["labels"] torch.tensor([1, 1])optimizer A…...

【BUG记录】Apifox 参数传入 + 号变成空格的 BUG

文章目录 1. 问题描述2. 原因2.1 编码2.2 解码 3. 解决方法 1. 问题描述 之前写了一个接口&#xff0c;用 Apifox 请求&#xff0c;参数传入一个 86 的电话&#xff0c;结果到服务器 就变成空格了。 Java 接收请求的接口&#xff1a; 2. 原因 2.1 编码 进行 URL 请求的…...

Spring AI API 介绍

目录&#xff1a; Spring AI 框架介绍 Spring AI API 核心API简介 Spring AI 提供了很多便利的功能&#xff0c;主要如下&#xff1a; AI Model API “Model API” 提供了聊天、文本转图像、音频转录、文本转语音、嵌入等功能&#xff0c;且不局限于某个固定的大模型提供商…...

【MySQL】Linux使用C语言连接安装

&#x1f4e2;博客主页&#xff1a;https://blog.csdn.net/2301_779549673 &#x1f4e2;欢迎点赞 &#x1f44d; 收藏 ⭐留言 &#x1f4dd; 如有错误敬请指正&#xff01; &#x1f4e2;本文由 JohnKi 原创&#xff0c;首发于 CSDN&#x1f649; &#x1f4e2;未来很长&#…...

2024年第十五届蓝桥杯青少组C++国赛—割点

割点 题目描述 一张棋盘由n行 m 列的网格矩阵组成&#xff0c;每个网格中最多放一颗棋子。当前棋盘上已有若干棋子。所有水平方向或竖直方向上相邻的棋子属于同一连通块。 现给定棋盘上所有棋子的位置&#xff0c;如果要使棋盘上出现两个及以上的棋子连通块&#xff0c;请问…...

【软件开发】做出技术决策

文章目录 专注于核心业务除非绝对必要,不要重写代码保持技术栈简单尽量减少依赖避免范围蔓延按照业务实际情况确定优先级在做出高风险决策前构建原型跨职能团队协作信任你的团队在过去的二十年里,我曾在多家初创企业担任软件开发人员、技术负责人以及首席技术官(包括创办自己…...

Airborne使用教程

1.安装环境 前提条件&#xff1a;系统已安装Ruby 打开终端输入如下命令 gem install airborne 或者在Gemfile添加 gem airborne 然后运行bundle install 2.编写脚本 在项目中新建api_tests_spec.rb文件 以GET接口"https://www.thunderclient.com/welcome"为…...

WPF实现曲线数据展示【案例:震动数据分析】

wpf实现曲线数据展示&#xff0c;函数曲线展示&#xff0c;实例&#xff1a;震动数据分析为例。 如上图所示&#xff0c;如果你想实现上图中的效果&#xff0c;请详细参考我的内容&#xff0c;创作不易&#xff0c;给个赞吧。 一共有两种方式来实现&#xff0c;一种是使用第三…...

EasyExcel 动态设置表格的背景颜色和排列

项目中使用EasyExcel把数据以excel格式导出&#xff0c;其中设置某一行、某一列单元格的背景颜色、排列方式十分常用&#xff0c;记录下来方便以后查阅。 1. 导入maven依赖&#xff1a; <dependency><groupId>com.alibaba</groupId><artifactId>easy…...

【 C++11 】类的新功能

C类的新功能 一、默认成员函数二、类成员变量初始化三、default关键字四、delete关键字六、final关键字七、override关键字 一、默认成员函数 八个默认成员函数 在C11之前&#xff0c;一个类中有如下六个默认成员函数&#xff1a; 构造函数。析构函数。拷贝构造函数。拷贝赋值…...

防止SQL注入:PHP安全最佳实践

防止SQL注入&#xff1a;PHP安全最佳实践 SQL注入是一种常见的网络攻击方式&#xff0c;攻击者通过向应用程序的SQL查询中插入恶意代码&#xff0c;来获取、操控或破坏数据库中的数据。为了保护PHP应用免受SQL注入攻击&#xff0c;开发者需要遵循一系列安全最佳实践。本文将介…...

自动化生产或质量检测准备工作杂记

自动化生产或质量检测一个流程是&#xff1a; 上料位上料&#xff1a; “上料位”指的是物料被放置以供机器或设备处理的位置。“上料”指的是将物料从存储位置移动到加工或检测位置的过程。移动到对位相机位置&#xff1a; “对位相机”是一种高精度相机&#xff0c;用于精确…...