{"id":230854,"date":"2024-04-07T23:10:12","date_gmt":"2024-04-08T06:10:12","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/java\/?p=230854"},"modified":"2024-04-07T23:10:12","modified_gmt":"2024-04-08T06:10:12","slug":"java-on-visual-studio-code-update-march-2024","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/java\/java-on-visual-studio-code-update-march-2024\/","title":{"rendered":"Java on Visual Studio Code Update &#8211; March 2024"},"content":{"rendered":"<p>Hi everyone, welcome to the March update for Visual Studio Code for Java! In this blog we are going to share several new Spring Boot features as well as testing coverage updates, so let&#8217;s get started!<\/p>\n<h3><strong>Spring Boot Feature Updates<\/strong><\/h3>\n<h4>New Refactoring Preview available for version upgrades<\/h4>\n<p>The feature to automatically upgrade your projects to the latest Spring Boot version now allows you to choose between applying those changes directly to your project or previewing them in a refactoring preview. The refactoring preview gives you an exact diff for all the changes that the automated version upgrade process produced and allows you to select which changes to apply and which not. Please note that currently all changes are unchecked, so you need to select the changes you want to apply manually.<\/p>\n<p>To refactor Spring Boot projects or upgrade Spring Boot projects to a newer version, you can directly<strong> right click on the POM.xml<\/strong> in your Spring Projects in Visual Studio Code, and click on &#8220;<strong>Refactor Spring Boot projects<\/strong>&#8221; or &#8220;<strong>Upgrade Spring Boot projects<\/strong>&#8220;, here&#8217;s how to do it.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/04\/upgradespringboot.gif\"><img decoding=\"async\" class=\"alignnone size-full wp-image-230861\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/04\/upgradespringboot.gif\" alt=\"Refactor Spring Boot\" width=\"1250\" height=\"1000\" \/><\/a><\/p>\n<p>You can also watch this short video for the full demonstration of all the features.<\/p>\n<p><iframe src=\"\/\/www.youtube.com\/embed\/2I7oDw3MqF4?si=lQLzbpjzVLcoPlrR\" width=\"560\" height=\"314\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<h4>Changing Log Levels on the fly<\/h4>\n<p>The Spring Tools in Visual Studio Code show live information from a running Spring Boot application if you have <a href=\"https:\/\/docs.spring.io\/spring-boot\/docs\/current\/reference\/html\/actuator.html\">actuators<\/a> on the project classpath and start your app from within Visual Studio Code. The latest update adds viewing and changing log levels to this. A command in the palette (<strong>&gt;Spring Boot: Set Log Levels<\/strong>) lets you select the running Spring Boot application, search through the list of active log levels, and allows you to change them directly within the running application. The change is effective in the running application only. The next time you start your app, the default log level settings are back.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/04\/thumbnail_log-levels-command.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-230859\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/04\/thumbnail_log-levels-command.png\" alt=\"Change log levels command\" width=\"1210\" height=\"306\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/04\/thumbnail_log-levels-command.png 1210w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/04\/thumbnail_log-levels-command-300x76.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/04\/thumbnail_log-levels-command-1024x259.png 1024w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/04\/thumbnail_log-levels-command-768x194.png 768w\" sizes=\"(max-width: 1210px) 100vw, 1210px\" \/><\/a><\/p>\n<h4>Add Spring Boot Starters right from within your pom.xml file<\/h4>\n<p>There is a new link showing up in the dependencies section of your pom.xml file that allows you to directly invoke the command to add additional Spring Boot starters. We hope this makes it much easier to access add Spring Boot starters directly from POM.xml.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/04\/thumbnail_add-starters-from-inside-pom.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-230858\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/04\/thumbnail_add-starters-from-inside-pom.png\" alt=\"Add starters from inside pom\" width=\"1060\" height=\"290\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/04\/thumbnail_add-starters-from-inside-pom.png 1060w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/04\/thumbnail_add-starters-from-inside-pom-300x82.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/04\/thumbnail_add-starters-from-inside-pom-1024x280.png 1024w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/04\/thumbnail_add-starters-from-inside-pom-768x210.png 768w\" sizes=\"(max-width: 1060px) 100vw, 1060px\" \/><\/a><\/p>\n<p><strong>To see all these new Spring features above, please install the<\/strong> <strong><a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=vmware.vscode-boot-dev-pack\">Spring Boot Extension Pack<\/a>.<\/strong><\/p>\n<h3><strong>Testing Coverage available<\/strong><strong> in Stable Version of Visual Studio Code<\/strong><\/h3>\n<p>We&#8217;re excited to announce that developers can now run tests with coverage in the Stable version of Visual Studio Code! This feature was previously enabled in the Insiders of Visual Studio Code and we&#8217;ve been fine-tuning it since then. To use it, developers just need to go to the testing panel as usual, and click the new &#8220;<strong>Run Tests with Coverage<\/strong>&#8221; button. Underneath this feature, the report is generated by the Jacoco library and visualized by the latest Testing Coverage API from Visual Studio Code.<\/p>\n<p>To use Testing Coverage, make sure you upgrade to the latest version of<strong> Extension Pack for Java.<\/strong><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/04\/runtestwithcoverage.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-230863\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/04\/runtestwithcoverage.png\" alt=\"Run tests with coverage\" width=\"1215\" height=\"1002\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/04\/runtestwithcoverage.png 1215w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/04\/runtestwithcoverage-300x247.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/04\/runtestwithcoverage-1024x844.png 1024w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/04\/runtestwithcoverage-768x633.png 768w\" sizes=\"(max-width: 1215px) 100vw, 1215px\" \/><\/a><\/p>\n<p>Coverage information is shown as an overlay on line numbers by default, but you can <strong>Toggle Inline Coverage<\/strong> to see complete detailed information for your source files:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/04\/inlinecoverage.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-230864\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/04\/inlinecoverage.png\" alt=\"Inline coverage\" width=\"739\" height=\"214\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/04\/inlinecoverage.png 739w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/04\/inlinecoverage-300x87.png 300w\" sizes=\"(max-width: 739px) 100vw, 739px\" \/><\/a><\/p>\n<p>You can refer to previous blog posts for more feature demos (<a href=\"https:\/\/devblogs.microsoft.com\/java\/java-on-visual-studio-code-update-december-2023\/\">December 2023 blog post<\/a> and <a href=\"https:\/\/devblogs.microsoft.com\/java\/java-on-visual-studio-code-update-january-2024\/\">January 2024 blog post<\/a>)<\/p>\n<h3><strong>Install Extension Pack for Java<\/strong><\/h3>\n<p>To use all features mentioned above, please download and install <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=vscjava.vscode-java-pack\">Extension Pack for Java<\/a> on Visual Studio Code.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/09\/javapack.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-229421\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/09\/javapack.png\" alt=\"Extension pack for Java\" width=\"1215\" height=\"238\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/09\/javapack.png 1215w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/09\/javapack-300x59.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/09\/javapack-1024x201.png 1024w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/09\/javapack-768x150.png 768w\" sizes=\"(max-width: 1215px) 100vw, 1215px\" \/><\/a><\/p>\n<p>If you are a Spring developer working on a Spring Boot application, you can also download the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=Pivotal.vscode-boot-dev-pack\">Spring Boot Extension Pack<\/a> for specialized Spring experience.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/10\/spring.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-229533\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/10\/spring.png\" alt=\"Spring boot extension pack\" width=\"1221\" height=\"224\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/10\/spring.png 1221w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/10\/spring-300x55.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/10\/spring-1024x188.png 1024w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/10\/spring-768x141.png 768w\" sizes=\"(max-width: 1221px) 100vw, 1221px\" \/><\/a><\/p>\n<h3><span style=\"font-size: 18pt;\"><strong><span class=\"x-hidden-focus\">Feedback and suggestions<\/span><\/strong><\/span><\/h3>\n<p>As always, your feedback and suggestions are very important to us and will help shape our product in future. There are several ways to give us feedback<\/p>\n<ul>\n<li>Leave your comment on this blog post<\/li>\n<li><a href=\"https:\/\/github.com\/microsoft\/vscode-java-pack\/issues\/new\/choose\" target=\"_blank\" rel=\"noopener\">Open an issue<\/a>\u00a0on our GitHub Issues page<\/li>\n<li>Send an email to: vscjfeedback@microsoft.com<\/li>\n<\/ul>\n<h3 id=\"try-it-out\" class=\"x-hidden-focus\"><span style=\"font-size: 18pt;\"><strong><span class=\"x-hidden-focus\">Resources<\/span><\/strong><\/span><\/h3>\n<p>Here is a list of links that are helpful to learn Java on Visual Studio Code.<\/p>\n<ul>\n<li class=\"x-hidden-focus\">Learn more about\u00a0<a class=\"x-hidden-focus\" href=\"https:\/\/code.visualstudio.com\/docs\/languages\/java\" target=\"_blank\" rel=\"noopener noreferrer\">Java on Visual Studio Code<\/a>.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Hi everyone, welcome to the March update for Visual Studio Code for Java! In this blog we are going to share several new Spring Boot features as well as testing coverage updates, so let&#8217;s get started! Spring Boot Feature Updates New Refactoring Preview available for version upgrades The feature to automatically upgrade your projects to [&hellip;]<\/p>\n","protected":false},"author":31999,"featured_media":230871,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[14,22,1,8,15],"tags":[],"class_list":["post-230854","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud","category-desktop","category-java","category-open-source","category-vscode"],"acf":[],"blog_post_summary":"<p>Hi everyone, welcome to the March update for Visual Studio Code for Java! In this blog we are going to share several new Spring Boot features as well as testing coverage updates, so let&#8217;s get started! Spring Boot Feature Updates New Refactoring Preview available for version upgrades The feature to automatically upgrade your projects to [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/230854","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/users\/31999"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/comments?post=230854"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/230854\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media\/230871"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media?parent=230854"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/categories?post=230854"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/tags?post=230854"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}