如何在VS代码中设置Kotlin debug launch.json配置?
我想在从Java迁移到Kotlin之后调试我的Kotlin Spring boot应用程序,但是Kotlin的launch.json的配置与Java的不同,例如,我们使用如何在VS代码中设置Kotlin debug launch.json配置?,kotlin,visual-studio-code,Kotlin,Visual Studio Code,我想在从Java迁移到Kotlin之后调试我的Kotlin Spring boot应用程序,但是Kotlin的launch.json的配置与Java的不同,例如,我们使用profiles在环境之间切换,当我添加“args”:“-Dspring.profiles.active=dev”我得到的属性参数是不允许的。在调试控制台中,我得到 Internal error: java.lang.IllegalArgumentException: io.netty:netty-transport-na
profiles
在环境之间切换,当我添加“args”:“-Dspring.profiles.active=dev”
我得到的属性参数是不允许的
。在调试控制台中,我得到
Internal error: java.lang.IllegalArgumentException: io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.42.Final:compile is not a properly formed Maven/Gradle artifact
[ERROR] java.util.concurrent.CompletionException: java.lang.IllegalArgumentException: io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.42.Final:compile is not a properly formed Maven/Gradle artifact
以下是我当前的Kotlin配置:
{
"version": "0.2.0",
"configurations": [
{
"type": "kotlin",
"request": "launch",
"name": "Kotlin Launch",
"projectRoot": "${workspaceFolder}",
"mainClass": "path.to.my.Application",
"args": "-Dspring.profiles.active=dev" // <--- showing error
}
]
}
如果要使用配置文件
或参数
,Kotlin的正确配置是什么
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Debug (Launch) - Current File",
"request": "launch",
"mainClass": "${file}",
"args": "-Dspring-boot.run.profiles=dev"
},
{
"type": "java",
"name": "Debug (Launch)",
"request": "launch",
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"mainClass": "path.to.my.application",
"projectName": "spring",
"args": "--spring.profiles.active=dev",
"vmArgs": "-Dspring.profiles.active=dev"
}
]
}