Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97313

How to set Kotlin debug launch.json configurations in VS Code?

$
0
0

I want to debug my Kotlin Spring boot application after moving from Java to Kotlin, but the launch.json of Kotlin has different configurations than Java's, for example we're using profiles to switch between the environments, and when I add "args": "-Dspring.profiles.active=dev" I'm getting Property args is not allowed. And in the debug console I'm getting

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

Here's my current Kotlin configs:

{
    "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
        }
    ]
}

For comparison, here's my java launch.json:

{
    "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"

        }
    ]
}

What are the correct configs for Kotlin if I want to use profiles or args?


Viewing all articles
Browse latest Browse all 97313

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>