Recently i decided to pass from Eclipse to VS Code
, everything is running smoothly for Javascript development but for Spring Boot
applications i don't know how to configure them here .
Except of the application.properties
file i have one more extra local.properties
which i use to run locally the Spring Boot Application .
I see there is a launch.json
file :
{
"configurations": [
{
"type": "java",
"name": "CodeLens (Launch) - fmApplication",
"request": "launch",
"mainClass": "com.application.zz.app.fmApplication",
"projectName": "file-manager"
}
]
}
In Eclipse i am adding additional configuration to run my Spring Boot Application like shown below :
How can i do that is Vs Code :) ?
Here is the issue on Vs Code Github Page
Unlike JavaScript, Java code needs to be compiled so it wont work out of the box with visual studio code since it's just a glorified text editor.
There are however multiple tools to accommodate for this, and the folks at VS code have a nice guide for setting you up - https://code.visualstudio.com/docs/java/java-spring-boot
Solution :
So you have an application.properties
file and locally you have a application-local.properties
(attention , you must name your local properties like that).
Then in your launch.json you add it to your program parameters :
"args": "--spring.profiles.active=local"
So your launch.json
file will look like this for example :
{
"configurations": [
{
"type": "java",
"name": "CodeLens (Launch) - fmApplication",
"request": "launch",
"mainClass": "com.intralot.l10.app.fmApplication",
"projectName": "file-manager",
"args": "--spring.profiles.active=local"
}
]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With