Introducing Open Liberty dev mode


In this video, we will introduce the Open
Liberty development mode. Running Open Liberty in dev mode allows you
to develop your application with any text editor or IDE. Your changes will be automatically compiled
and deployed to your running server, making it easy to iterate on your changes, and you
will be able to run tests on demand or even automatically so that you can get immediate
feedback on your changes. For Maven projects, dev mode is run through
the Liberty Maven Plugin. To get started, specify the latest version
of the Liberty Maven Plugin in your project’s pom.xml file. Start dev mode by running the command: mvn
liberty:dev Once the server is started, we can begin making
changes. Let’s start by adding a new feature in the
server.xml file. After saving the file, we can see that the
server installs the feature and updates the application. When we visit the new endpoint URL in a browser,
the results are shown. Now we’ll demonstrate adding source code. We can create a new file and write the code,
then save the file. The application gets updated with the changes,
and refreshing the browser shows results using the updated code. Let’s do the same thing with another file. In addition to source code, other resources
can also be changed. In this example, we show changing a variable
in the server configuration that we can see taking effect when we refresh the browser. Similarly, we now demonstrate changing a web
application resource. To run tests on demand, press Enter in the
console where dev mode is running. This will run any unit tests and integration
tests that are configured for this project. When we add a new test, it will compile and
be included the next time that we run the tests. To quit dev mode, press Control-C, or you
can type q and press Enter. Now we’ll demonstrate running dev mode with
hot testing enabled. This will cause the tests to run when dev
mode starts up, as well as automatically after every change. Let’s change the endpoint path in a source
file. Notice that the tests run and fail, as expected. Once we fix the issue, the tests run again
and pass. That concludes this introduction of dev mode
for Open Liberty. You have seen how dev mode makes it easy to
develop your application and quickly iterate on and test out your changes. For more information on Open Liberty, visit
openliberty.io

Leave a Reply

Your email address will not be published. Required fields are marked *