網(wǎng)站首頁 編程語言 正文
文章目錄
- Eclipse創(chuàng)建maven項目
- Eclipse創(chuàng)建springboot項目先下載插件
Eclipse創(chuàng)建maven項目
- file > new > other 選擇maven project 下一步
2.修改路徑
- 選擇相關(guān)的項目文件org.apache.maven.achetypes maven-archetype-quickstart1.1文件
- 修改項目名稱,點擊finish
- 在resoures里面創(chuàng)建application.properties文件并配置
#語法介紹
## 1.YML 有層級效果.相同的key可以復(fù)用
## 2.YML 配置文件注意縮進
## 3.YML 配置文件支持中文 字符集編碼UTF-8
## 4.YML 數(shù)據(jù)結(jié)構(gòu) key:空格value
#配置端口號
server:
port: 8091
#管理數(shù)據(jù)源
spring:
datasource:
#高版本驅(qū)動使用
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/jt?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true
#設(shè)定用戶名和密碼
username: root
password: root
#SpringBoot整合Mybatis-plus
mybatis-plus:
#指定別名包
type-aliases-package: com.jt.pojo
#掃描指定路徑下的映射文件
mapper-locations: classpath:/mappers/*.xml
#開啟駝峰映射
configuration:
map-underscore-to-camel-case: true
# 一二級緩存默認開始 所以可以簡化
#打印mysql日志
logging:
level:
com.jt.mapper: debug
- 修改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>com.iwcoo</groupId>
<artifactId>adminpro</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>adminpro</name>
<url>http://maven.apache.org</url>
<!-- SpringBoot相關(guān)jar包 -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.5.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!-- SpringBoot核心jar包 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<!-- web開發(fā)包:包括了tomca和springmvc -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- springboot熱部署 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
<!-- Thymeleaf -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--mybatis依賴包-->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.2.0</version>
</dependency>
<!--spring整合mybatis-plus -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.4.3</version>
</dependency>
<!--jdbc依賴包-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!--添加lombok的包-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<!-- 加入jedis依賴 -->
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.9.0</version>
</dependency>
<!--這里就是redis的核心jar包-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<!-- 緩存連接池-->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
</dependency>
<!-- redis 存儲 json序列化 -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<jvmArguments>
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005
</jvmArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.3.7.RELEASE</version>
<configuration>
<mainClass>com.iwcoo.App</mainClass>
</configuration>
<executions>
<execution>
<id>repackage</id>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
- 更新maven
右鍵項目,點擊maven > update project
Eclipse創(chuàng)建springboot項目先下載插件
Help > Eclipse Marketplace > 搜索 sts
下載,等插件安裝完成后重啟eclipse生效
file > new > other 搜索 springboot 開始創(chuàng)建項目
原文鏈接:https://blog.csdn.net/weixin_45102029/article/details/127285788
相關(guān)推薦
- 2022-06-20 Go語言實現(xiàn)切片增刪改查的示例代碼_Golang
- 2022-03-03 編輯時使用Object.assign({},row) el-form表單無法編輯 el-select
- 2022-06-02 基于python的MD5腳本開發(fā)思路_python
- 2022-09-17 C++?中的異常拋出和捕獲方式_C 語言
- 2022-04-05 ORA-01779: 無法修改與非鍵值保存表對應(yīng)的列
- 2022-11-05 React+CSS?實現(xiàn)繪制豎狀柱狀圖_React
- 2022-10-14 nginx和apache的區(qū)別
- 2022-06-18 Go語言學(xué)習之時間函數(shù)使用詳解_Golang
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細win安裝深度學(xué)習環(huán)境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎(chǔ)操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區(qū)別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權(quán)
- redisson分布式鎖中waittime的設(shè)
- maven:解決release錯誤:Artif
- restTemplate使用總結(jié)
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務(wù)發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結(jié)構(gòu)-簡單動態(tài)字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應(yīng)用詳解
- 聊聊消息隊列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支