Trae 中配置全局 Maven 和 JDK
在 Trae 里搭建 Java 环境,最关键的还是把本地路径指对。很多新手容易忽略 settings.json 里的细节,导致依赖下载慢或者编译报错。下面直接上干货,跟着步骤走就能搞定。
1. 找到配置入口
依次打开:设置 > 开发环境 > Maven-for-Java(或者直接全局搜索该配置)。
找到对应选项后,点击'在 settings.json 中编辑',会弹出配置文件窗口。
2. 修改配置文件
在弹出的 JSON 文件中,填入或覆盖以下配置。注意替换其中的路径为你本地的实际安装目录。
{
"maven.excludedFolders": ["**/.*", "**/node_modules", "**/target", "**/bin", "**/archetype-resources"],
"maven.settingsFile": "E:\\****\\apache-maven-3.8.4\\conf\\settings.xml",
"workbench.colorTheme": "Default Dark+",
"java.compile.nullAnalysis.mode": "automatic",
"java.configuration.updateBuildConfiguration": "automatic",
"java.configuration.maven.userSettings": "E:\\***\\apache-maven-3.8.4\\conf\\settings.xml"

