layout | title | categories | author_picture | author_github | seo-title | seo-description | blog_description |
---|---|---|---|---|---|---|---|
post |
Open Liberty dev mode with VS Code |
blog |
Open Liberty dev mode with VS Code - OpenLiberty.io |
Start Open Liberty in development mode with a VS Code extension. Make changes to your application while the server is up, run tests and view results, and even debug the application without leaving the editor. |
Start Open Liberty in development mode with a VS Code extension. Make changes to your application while the server is up, run tests and view results, and even debug the application without leaving the editor. |
The Liberty Dev VS Code extension lets you start Open Liberty in development mode, make changes to your application while the server is up, run tests and view results, and even debug the application without leaving the editor.
We’ve shown how Open Liberty dev mode can be run from a command line while allowing you to edit your code with any text editor or IDE. In this blog post, you’ll see how the optional extension for VS Code makes it even easier to interact with dev mode for a more seamless experience.
For a demo of the extension, check out the following video:
For Maven projects, dev mode requires the Liberty Maven Plugin. Specify the Liberty Maven Plugin with version 3.1
or above in your project’s pom.xml
file.
<plugin>
<groupId>io.openliberty.tools</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>3.1</version>
</plugin>
The following commands can be selected from the drop-down menu after right-clicking on your project name in the Liberty Dev Dashboard.
Command | Description |
---|---|
Run tests |
Runs the unit tests and integration tests that are configured for your project. This command requires dev mode to be already started. |
Start |
Starts dev mode. |
Start… |
Starts dev mode with custom parameters. For example, to run tests automatically after every change, include the |
Stop |
Stops dev mode. |
View integration test report |
Views the integration test report file. |
View unit test report |
Views the unit test report file. |
Dev mode allows you as the developer to focus on your code. When Open Liberty is running in dev mode, your code is automatically compiled and deployed to the running server, making it easy to iterate on your changes. You can run tests on demand or even automatically so that you can get immediate feedback on your changes. You can also attach a debugger at any time to debug your running application. The video above shows examples of how these can be done within VS Code with the Liberty Dev extension.
For more information, see our previous blog post on dev mode or refer to the documentation for the dev goal of the Liberty Maven Plugin.