从 Eclipse 切换到 Visual Studio Code

问题描述 投票:0回答:1

我想从 Eclipse 切换到 Visual Studio Code 并开始使用 Microsoft GitHub Copilot。

我正在寻找与maven相关的设置来指定settings.xml文件,因为目前它在项目文件夹中创建了一个文件夹“~”,并且我不想拥有.m2/repository每个项目。

我也在寻找在哪里添加程序参数,例如 Spring Boot 应用程序的

--spring.config.import=config/application-backend.yaml --spring.profiles.active=env-local

java spring-boot maven visual-studio-code
1个回答
0
投票

在 vscode 中,您可以使用以下设置指定 shehe 的路径

    // Specifies the absolute path of your maven configuration file, the default value is ~/.m2/settings.xml
    // Replace /path/to/your/settings.xml with the actual path to your settings.xml file.
    "maven.settingsFile": "/path/to/your/settings.xml",

有关它的更多设置,您可以在

设置
面板中搜索settings.xml

可以在lausn中添加

args
配置,为程序添加参数。例如:

"configurations": [
    {
        "type": "java",
        "name": "Debug (Launch) - YourApplication",
        "request": "launch",
        "mainClass": "com.example.YourApplication",
        "args": [
            "--spring.config.import=config/application-backend.yaml",
            "--spring.profiles.active=env-local"
        ]
    }
]

https://code.visualstudio.com/docs/java/java-debugging#_configuration-options

© www.soinside.com 2019 - 2024. All rights reserved.