vscode配置springboot
LYT
首页
分类
标签
项目
留言
友链
关于

vscode配置springboot

2025年11月21日14时16分
2025年11月21日14时19分
java
java springboot maven
浏览量:
总浏览量:
0

配置jdk21环境

openjdk21或者orclejdk21都可以。下载好源文件把下面路径复制到环境变量path里面,bin的意义是可执行二进制文件,把此文件路径放入path里面才能让系统识别到java命令

C:\Program Files\Java\jdk-21\bin

alt text

在终端运行下面指令验证java安装正确

java --verison

配置maven环境

maven官网下载二进制包,然后把下面路径放入环境变量path里面

D:\develop\tool\maven\apache-maven-3.8.9-bin\apache-maven-3.8.9\bin

然后输入下面命令验证maven安装正确

mvn -v

配置maven本地仓库

在如下位置写上本地仓库的路径

<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd"> <!-- localRepository | The path to the local repository maven will use to store artifacts. | | Default: ${user.home}/.m2/repository <localRepository>/path/to/local/repo</localRepository> --> <localRepository>D:\develop\tool\maven\apache-maven-3.8.9-bin\registry</localRepository>

配置maven国内镜像

在下面位置替换原有的镜像

<mirrors> <!-- mirror | Specifies a repository mirror site to use instead of a given repository. The repository that | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used | for inheritance and direct lookup purposes, and must be unique across the set of mirrors. | <mirror> <id>mirrorId</id> <mirrorOf>repositoryId</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://my.repository.com/repo/path</url> </mirror> --> <!-- 加速镜像 --> <mirror> <id>aliyun-maven</id> <mirrorOf>central</mirrorOf> <url>https://maven.aliyun.com/repository/public</url> <blocked>false</blocked> </mirror> <!-- 加速镜像 --> </mirrors>

vscode插件安装

安装以下插件以供java和maven运行

alt text

安装下面插件给spring提供

alt text

配置maven插件

alt text

设置用户配置文件(maven文件目录conf下面的setting.xml)

alt text

设置maven的可执行文件路径

alt text

vscode新建项目并运行

alt text

alt text

alt text

alt text

alt text

alt text

选择完成后系统会弹出让你选择保存文件的窗口

等待项目扫面完成 alt text

出现ready后就可以找到启动文件按F5启用调试

alt text

配置mybatis

下载如下三个插件

然后打开设置>搜索sqltool

添加下面设置

重启后就能够出现代码提示