spring suite搭建springboot操作

一、前言

有时候久了没开新项目了,重新开发一个新项目,搭建springboot的过程都有点淡忘了,所有温故知新。

二、搭建步骤

从0开始搭建springboot

1.创建work空间。步骤FileàNewàJava Working Set。

2.选择Java Working Set。

3.自定义Working set name 名称。

点击Finish 完成工作空间创建。左侧出现文件夹:

4.新建Spring Starter Project

5.一个springboot的基本信息。

6.点击Next,选择依赖组件

7.点击Finish,完成创建。

三、依赖pom样例

版本选择


    <properties>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
        <base.version>1.0-SNAPSHOT</base.version>
        <java.version>1.8</java.version>
        <spring-cloud.version>2021.0.1</spring-cloud.version>
        <spring-boot.version>2.6.2</spring-boot.version>
        <mysql.version>8.0.17</mysql.version>
        <druid.version>1.1.13</druid.version>
        <mybatisplus.version>3.4.3.4</mybatisplus.version>
        <mybatis-spring.version>2.2.0</mybatis-spring.version>
        <apollo.version>1.8.0</apollo.version>
        <dameng.version>7.6.0.142</dameng.version>
        <fastjson.version>1.2.83</fastjson.version>
        <swagger2.version>2.9.2</swagger2.version>
        <hutool.version>5.7.7</hutool.version>
        <poi.version>4.1.2</poi.version>
        <commons-lang3.version>3.8.1</commons-lang3.version>
        <xstream.version>1.4.18</xstream.version>
        <log4j-to-slf4j.version>2.15.0</log4j-to-slf4j.version>
        <java-jwt.version>3.8.2</java-jwt.version>
        <zxing.version>3.3.0</zxing.version>
        <barcode4j.version>2.1</barcode4j.version>
        <bcprov-jdk15to18.version>1.66</bcprov-jdk15to18.version>
        <rocketmq.version>4.7.1</rocketmq.version>
        <mq-http-sdk.version>1.0.3.2</mq-http-sdk.version>
        <aliyun-sdk-oss.version>3.13.2</aliyun-sdk-oss.version>
        <cos_api.version>5.6.89</cos_api.version>
        <sharding-sphere.version>4.0.0-RC2</sharding-sphere.version>
		<shardingsphere.version>5.0.0-beta</shardingsphere.version>
    </properties>

pom依赖


<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>
	<parent>
	    <artifactId>xxx-member-plat</artifactId>
        <groupId>cn.xxx</groupId>
        <version>1.0-SNAPSHOT</version>
	</parent>
	<artifactId>member-business</artifactId>
	<packaging>jar</packaging>
	<dependencies>

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

		<dependency>
			<groupId>cn.ctg</groupId>
			<artifactId>base-common</artifactId>
			<version>1.0-SNAPSHOT</version>
		</dependency>

		<dependency>
			<groupId>cn.ctg</groupId>
			<artifactId>base-interceptor</artifactId>
			<version>1.0-SNAPSHOT</version>
		</dependency>

		<dependency>
			<groupId>org.postgresql</groupId>
			<artifactId>postgresql</artifactId>
		</dependency>

		<!-- apollo -->
		<dependency>
			<groupId>com.ctrip.framework.apollo</groupId>
			<artifactId>apollo-client</artifactId>
			<version>${apollo.version}</version>
		</dependency>

		<dependency>
			<groupId>com.ctrip.framework.apollo</groupId>
			<artifactId>apollo-core</artifactId>
			<version>${apollo.version}</version>
		</dependency>

		<dependency>
			<groupId>io.springfox</groupId>
			<artifactId>springfox-swagger2</artifactId>
			<version>${swagger2.version}</version>
		</dependency>

		<dependency>
			<groupId>io.springfox</groupId>
			<artifactId>springfox-swagger-ui</artifactId>
			<version>${swagger2.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-bootstrap</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
			<exclusions>
				<exclusion>
					<groupId>com.thoughtworks.xstream</groupId>
					<artifactId>xstream</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>com.thoughtworks.xstream</groupId>
			<artifactId>xstream</artifactId>
			<version>${xstream.version}</version>
		</dependency>

		<dependency>
			<groupId>com.baomidou</groupId>
			<artifactId>mybatis-plus-boot-starter</artifactId>
			<version>${mybatisplus.version}</version>
		</dependency>

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

		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-openfeign</artifactId>
		</dependency>

		<!--oss -->
		<dependency>
			<groupId>com.aliyun.oss</groupId>
			<artifactId>aliyun-sdk-oss</artifactId>
			<version>${aliyun-sdk-oss.version}</version>
		</dependency>
		
		<!--cos -->
		<dependency>
			<groupId>com.qcloud</groupId>
			<artifactId>cos_api</artifactId>
			<version>${cos_api.version}</version>
		</dependency>
		
        <dependency>
            <groupId>org.apache.rocketmq</groupId>
            <artifactId>rocketmq-client</artifactId>
            <version>${rocketmq.version}</version>
        </dependency>
        
		<dependency>
			 <groupId>org.apache.rocketmq</groupId>
			 <artifactId>rocketmq-acl</artifactId>
			 <version>${rocketmq.version}</version>
		</dependency>
		
		<dependency>
		    <groupId>com.aliyun.mq</groupId>
		    <artifactId>mq-http-sdk</artifactId>
		    <!--以下版本号请替换为Java SDK的最新版本号-->
		    <version>${mq-http-sdk.version}</version> 
		    <classifier>jar-with-dependencies</classifier>
		</dependency>
		
	   <!-- 分库分表 -->
	   <!--  
		<dependency>
			<groupId>org.apache.shardingsphere</groupId>
			<artifactId>sharding-jdbc-spring-boot-starter</artifactId>
			<version>${sharding-sphere.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.shardingsphere</groupId>
			<artifactId>sharding-jdbc-spring-namespace</artifactId>
			<version>${sharding-sphere.version}</version>
		</dependency>
		-->
	</dependencies>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.springframework.cloud</groupId>
				<artifactId>spring-cloud-dependencies</artifactId>
				<version>${spring-cloud.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<finalName>${project.artifactId}</finalName>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<skipTests>true</skipTests>
				</configuration>
			</plugin>

			<plugin>
				<artifactId>maven-antrun-plugin</artifactId>
				<executions>
					<execution>
						<id>copy</id>
						<phase>package</phase>
						<configuration>
							<target>
								<copy todir="../deploy" overwrite="true">
									<fileset dir="${project.build.directory}">
										<include name="${project.artifactId}.jar" />
									</fileset>
								</copy>
							</target>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>

四、springboot简介

SpringBoot是一个基于Spring框架的开源JavaWeb开发框架,它简化了Spring应用的初始搭建以及开发过程。通过使用特定的方式来进行配置,从而使开发人员不再需要定义样板化的配置。通过这种方式,SpringBoot致力于在蓬勃发展的快速应用开发领域(rapid application development)成为领导者。

SpringBoot的主要优点包括:

  1. 创建独立的Spring应用程序:SpringBoot可以轻松地创建可以“运行”的独立的、生产级别的基于Spring的应用程序,无需外部特定的部署环境。
  2. 嵌入式Web服务器:SpringBoot内嵌了Tomcat、Jetty等Servlet容器,无需以war包形式部署。
  3. 自动配置:SpringBoot根据添加的jar依赖自动配置您的Spring应用程序。例如,如果H2数据库在您的classpath上,并且您没有手动配置任何数据库连接beans,那么SpringBoot将自动配置一个内存型数据库。
  4. 提供生产就绪型功能:如指标、健康检查和外部化配置。
  5. 无代码生成和XML配置:SpringBoot不是一个全新的框架,它默认配置了很多框架的使用方式,就像Maven整合了所有的jar包一样,SpringBoot整合了所有的框架的使用方式,就像Maven整合了所有的jar包,Spring Boot中使用了特定的方式来进行配置,从而使开发人员不再需要定义样板化的配置。

总之,SpringBoot是一个简化Spring应用开发过程的框架,通过自动配置、嵌入式Web服务器等功能,使得开发者能够更加高效地进行JavaWeb应用的开发。 

五、springboot的优点

SpringBoot的优点主要体现在以下几个方面:

  1. 快速搭建项目:SpringBoot提供了丰富的默认配置和代码生成工具,使得开发人员可以快速构建项目,大大缩短了开发周期。这些默认配置和代码生成工具可以帮助开发人员快速启动项目,减少了很多繁琐的配置和编码工作。
  2. 简化配置:SpringBoot通过约定优于配置的方式,极大地简化了配置文件的编写。开发人员只需按照约定的方式编写代码和配置文件,就可以实现快速的应用开发和部署。此外,SpringBoot还支持通过注解和配置文件进行自定义配置,使得配置过程更加灵活和方便。
  3. 内嵌服务器:SpringBoot内置了多种常用的服务器,如Tomcat、Jetty等,使得应用可以打包成一个可执行的JAR文件,无需额外部署服务器。这大大简化了应用程序的部署过程,提高了部署效率。
  4. 易于维护:SpringBoot的项目结构清晰,代码规范,易于维护和扩展。通过合理的项目结构和代码规范,SpringBoot使得开发人员可以更加高效地进行代码维护和升级工作。
  5. 良好的生态系统和社区支持:SpringBoot作为Spring Framework的衍生项目,拥有庞大的社区支持和活跃的开发者社区。这意味着开发人员可以获取到大量的文档、教程和解决方案,遇到问题时可以快速找到答案并得到帮助。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/469674.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

微信小程序接口请求出错:request:fail url not in domain list:xxxxx

一、微信小程序后台和开发者工具配的不一样导致了这个错误 先说结论&#xff1a; 开发者工具配置了https://www.xxx.cn/prod-api/ 微信后台配置了 https://www.xxx.cn 一、最开始 开发者工具配置了https://www.xxx.cn:7500 微信后台配置了 https://www.xxx.cn 报错:reques…

OPTEE v3.20.0 FVP环境搭建

目录 一、前提条件 二、下载fvp代码 三、下载工具链 四、下载Foundation_Platform FVP平台 五、编译及运行 一、前提条件 1、安装如下的依赖工具 sudo apt-get install android-tools-adb android-tools-fastboot autoconf \ automake bc bison build-essential ccache c…

2024精灵传信系统支持电脑PC端+小程序双端源码

2024精灵传信系统支持电脑PC端小程序双端源码 精灵传信支持在线提交发送短信&#xff0c;查看回复短信&#xff0c;在线购买额度&#xff0c;自定义对接易支付&#xff0c;设置违禁词&#xff0c;支持网站小程序双端。 搭建环境&#xff1a; PHP > 73 MySQL>5.6 Nginx…

当两会热词碰上“人工智能+”,你知道哪些企业算是行业弄潮儿吗?

最近正值全国“两会”的召开&#xff0c;一大批新词热词涌现&#xff0c;聚焦了各行各业的发展&#xff0c;也一定程度上代表了未来的主要发展方向。“未来产业”、“人工智能”、“全国一体化算力体系”等热词的出圈充分表明了信息技术行业是一大发展重点&#xff0c;尤其是人…

护航容器安全:私有Registry在镜像审核中的关键角色与实战策略

在容器化技术日益普及的今天&#xff0c;Docker镜像的质量与安全性成为了构建稳定、可靠应用的关键要素。私有Registry作为镜像的集中存储和分发中心&#xff0c;不仅可以提供镜像的统一管理&#xff0c;还能通过集成镜像审核机制&#xff0c;确保进入生产环境的镜像符合安全与…

如何解决MySQL死锁(看懂MySQL锁日志)

有时候系统在生产运行着&#xff0c;会突然爆出 [40001][1213] Deadlock found when trying to get lock; try restarting transaction 这个时候每个人都会很紧张&#xff0c;因为死锁会影响DB性能&#xff0c;严重时甚至拖垮整个系统。在实际的环境中&#xff0c;很多服务会共…

【电路笔记】-达林顿晶体管

达林顿晶体管 文章目录 达林顿晶体管1、概述2、基本达林顿晶体管配置3、示例4、达林顿晶体管应用5、Sziklai 晶体管对6、ULN2003A 达林顿晶体管阵列7、总结两个双极晶体管的达林顿晶体管配置可针对给定基极电流提供更大的电流切换。 1、概述 达林顿晶体管以其发明者 Sidney Da…

文件包含漏洞之包含NGINX日志文件(常用)

条件&#xff1a;知道目标服务器的日志文件存贮路径&#xff0c;并且存在文件包含漏洞 首先对目标服务器发送一次含有木马的请求&#xff0c;目的是让目标服务器日志中生成含有木马的日志记录。因为发送过程中&#xff0c;使用了url编码&#xff0c;我们抓包进行更改成能够执行…

【Python爬虫】详解BeautifulSoup()及其方法

文章目录 &#x1f354;准备工作&#x1f339;BeautifulSoup()⭐代码实现✨打印标签里面的内容✨快速拿到一个标签里的属性✨打印整个文档&#x1f386;获取特定标签的特定内容 &#x1f339;查找标签&#x1f388;在文档查找标签 find_all&#x1f388;正则表达式搜索 &#x…

echarts geo地图加投影两种方法

方法1&#xff0c;geo中加多个地图图形&#xff0c;叠加。缩放时 可能会不一致&#xff0c;需要捕捉georoam事件&#xff0c;使下层的geo随着上层的geo一起缩放拖曳 geo: [{zlevel: 3,//geo显示级别&#xff0c;默认是0 【最顶层图形】map: BJ,//地图名roam: true,scaleLimit: …

虚拟机VMware上 centos7 的网络配置

第一步&#xff1a;权限的切换 由普通用户切换到管理者/超级用户 用户名为&#xff1a;root 密码为&#xff1a;自己安装 linux 时第一次设置的密码 su -root管理者/超级用户的命令提示符是“#”&#xff0c;普通用户的命令提示符是“$”。当看到你的命令提示符为“$”时&…

VScode 设置个性化背景(保姆级教程)

VS Code设置个性化背景的作用主要体现在以下几个方面&#xff1a; 提升编程体验&#xff1a;个性化背景能够让编程环境更符合个人的审美和习惯&#xff0c;使得长时间在VS Code中进行代码编辑时&#xff0c;能够保持愉悦的心情&#xff0c;从而提高编程效率。减少视觉疲劳&…

微隔离是什么,有什么作用

传统的网络安全架构通常是基于较大的安全区域&#xff08;如子网或虚拟局域网&#xff09;&#xff0c;在这些区域内的设备可以相互通信。然而&#xff0c;这也意味着一旦内部的设备被威胁或遭到入侵&#xff0c;攻击者可能会在整个安全区域内进行横向移动和渗透。 微隔离通过…

GNSS载波相位平滑伪距基本原理

相位平滑技术&#xff1a;削弱伪距欢测值的随机误差影响 差分技术&#xff1a;削弱欢测方程中的系统误差影响 相位平滑伪距原理&#xff1a; GPS接收机除了提供伪距测量外&#xff0c;可同时提供载波相位测量&#xff0c;由于载波相位测量的精度比码相位的测量精度高2个数量…

蓝桥杯嵌入式第十届省赛 真题+代码

led.c文件 #include "led.h"void Led(uint16_t addr,uint16_t enable) {static uint16_t temp 0x0000;static uint16_t temp_old 0xffff;HAL_GPIO_WritePin(GPIOC, GPIO_PIN_All, GPIO_PIN_SET);if(enable)temp | 0x0100 << addr;elsetemp & ~(0x0100 &…

在sql server 2016 always on集群里新增一个数据库节点

本篇博客有对应的word版本&#xff0c;有需要的可以点击这里下载。 一 环境介绍 二 操作步骤 2.1 在新节点上安装sql server软件 略 2.2 在新节点上开启‘故障转移群集功能’ 打开‘服务管理器’&#xff1a; 点击‘添加角色和功能’&#xff1a; 勾选’DNS服务器’&#…

【Godot4.2】2D导航01 - AStar2D及其使用方法

概述 对于2D平台跳跃或飞机大战&#xff0c;以及一些直接用键盘方向键操控玩家的游戏&#xff0c;是根本用不到寻路的&#xff0c;因为只需要检测碰撞就可以了。 但是对于像RTS或战棋这样需要操控玩家到地图指定位置的移动方式&#xff0c;就绝对绕不开寻路了。 导航、碰撞与…

企业培训考试系统数字化解决方案优势有哪些?

企业员工内部培训考试系统&#xff0c;用数字技术和互联网平台&#xff0c;为企业提供高效、便捷、个性化的员工培训服务的解决方案。 企业员工培训考试数字化解决方案不仅能够提供更加高效、灵活和互动的学习体验&#xff0c;还能够帮助企业实现长期的人才发展战略&#xff0…

好委屈,东方甄选为何总是被供应商骗?

东方甄选最近很委屈。 315晚会过后&#xff0c;知名打假人王海爆料&#xff0c;称315晚会曝光的槽头肉扣肉在东方甄选和小杨哥的直播间里销售过。 东方甄选赶忙去问了问供应商情况。 供应商的回答让他感到暖心&#xff0c;表示虽然315晚会曝光了我们公司违规使用糟头肉&…

如何在三个简单步骤中为对象检测标注图像

初始通过彻底清洗和处理原始图像数据来奠定有效对象检测注释的基础。选择适合的工具、方法和清晰的注释过程指南来建立注释工作空间。通过在图像中划定对象并附上类别标签来执行注释&#xff0c;随后进行细致的核验&#xff0c;以确保数据集的精确性和完整性。 图像注释是计算…