当前位置: 代码迷 >> 综合 >> vscode 打造java maven开发环境
  详细解决方案

vscode 打造java maven开发环境

热度:75   发布时间:2023-09-20 00:15:54.0

系统安装jdk1.8,配置好环境变量JAVA_HOME,安装并配置好MAVEN_HOME

打开vscode,安装java相关插件

  1. Language support for Java ? for Visual Studio Code
  2. Java Extension Pack
  3. Debugger for Java
  4. Java Test Runner
  5. Tomcat for Java
  6. Maven for Java

  7. Project Manager

  8. Chinese (Simplified) Language Pack for Visual Studio Code

  9. Java Dependency Viewer

  10. Spring Boot Extension Pack

  11. XMLredhat.vscode-xml预览版

以上插件安装完成,就可以开始java开发了

个人推荐插件

  1. Eclipse Keymap for Visual Studio Code. (eclipse快捷键,eclipse用户最爱)
  2. Lombok Annotations Support for VS Code. (简化POJO, 很惊喜)
  3. Cloudfoundry Manifest YML Support
  4. Concourse CI Pipeline Editor

开发基本配置

常用配置项: 文件->首选项->设置

  1. maven 配置(如果本地有安装maven) 编辑setting.json

{

    "editor.suggestSelection": "first",

    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",

    "java.configuration.checkProjectSettingsExclusions": false,

    "diffEditor.ignoreTrimWhitespace": false,

    "editor.renderControlCharacters": false,

    "java.configuration.maven.userSettings": "C:\\Users\\pactera\\.m2\\settings.xml",

    "files.exclude":{

        "**/.git": true,

        "**/.svn": true,

        "**/.hg": true,

        "**/CVS": true,

        "**/.DS_Store": true,

        "**/.classpath":true,

        "**/.project":true,

        "**/.settings":true,

        "**/.factorypath":true

    },

    "java.jdt.ls.vmargs": "-XX:+UseGlGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx1G -Xms100m",

    "editor.renderIndentGuides": false,

    "git.ignoreMissingGitWarning": true

}

  相关解决方案