Java on Visual Studio Update – April 2023

Nick Zhu

Hi everyone, welcome to our April update for Visual Studio Code Java! In this blog we are going to talk about important debugging experience improvements, profile support in Maven extension, new Java Project Explorer UX, and Spring Boot Dashboard visualization enhancements. There is a ton of cover, so let’s get started.

Profile Support in Maven extension

Maven profiles can optimize your build process by allowing you to configure specific build configurations and execute specific build phases for different environments or goals. They save time and reduce errors, as you don’t have to maintain multiple POM files.

We have added the support of profiles in our Maven extension which is part of Extension Pack for Java, so you can visualize what Maven profiles you have. You can also switch between Maven profiles using this extension, so it’s much easier to manage profiles directly using the extension. Here’s a demo.

Maven profile

Expand all lazy variables in debugging mode

Back when we introduced lazy variables for our debugger, our purpose is to defer the operations for an expensive variable until the user explicitly expands to see its value, which targets to optimize the performance. However, we have heard from developers that this has caused some side-effect that in debugging mode, developers have to make extra clicks to reveal the values of some basic type variables,  which is very inconvenient.

To solve this issue, we have added a context menu item called “Auto Expand Lazy Variables” to automatically expand all lazy variables. When user clicks on this, the values of all lazy variables are displayed so user does not need to manually click on each one to see the value. If the user wants to reverts this behavior, just right click again and you will see “Manual Expand Lazy Variables“. Here’s a demo of this feature.

Auto expand lazy variable

New Java Project Explorer User Experience

We have always heard from developers that they wanted to see more items in the Java Project Explorer, especially build tool related files such as POM.xml, as well as resource files. Therefore, we have re-designed our Java Project Explorer to include additional file resources. For those developers who rely heavily in the Java Project Explorer view, now you can easily access these files directly. Note that this design is still in the early stage, please do let us know what you think, and leave your feedback at https://github.com/microsoft/vscode-java-pack/issues

Java Project Explorer

Live Properties of Running Spring Apps in Spring Boot Dashboard

Properties is a critical part of Spring application as they provide a convenient way to configure and customize the behavior of our Spring apps. However, sometimes as our application grows it’s easy to lose track of the value of these properties and it’s difficult to visualize them when the application is running. As part of our latest Spring Boot enhancements, we have added the support of visualizing live properties of running Spring applications in Spring Boot dashboard. Let’s see a quick demo

Live Spring property

Note that this could potentially expose some very important values so please use them at your own discretion. To enable this feature, you will also need to set -Dmanagement.endpoint.env.show-values=ALWAYS. You can read more about this in this guide here.

Install Extension Pack for Java

To use all features mentioned above, please download and install Extension Pack for Java on Visual Studio Code.

Extension pack for Java

If you are a Spring developer working on a Spring Boot application, you can also download the Spring Boot Extension Pack for specialized Spring experience.

Spring boot extension pack

Feedback and suggestions

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

  • Leave your comment on this blog post
  • Open an issue on our GitHub Issues page
  • Send an email to: vscjfeedback@microsoft.com

Resources

Here is a list of links that are helpful to learn Java on Visual Studio Code.

0 comments

Discussion is closed.

Feedback usabilla icon